diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f7f20f09d2..8a305c2fbf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Docs: https://docs.openclaw.ai - CI/tooling: route script edits through conventional owner tests when matching `test/scripts` or `src/scripts` coverage already exists. - CI/tooling: honor option terminators in the memory FD repro script so follow-on arguments are not reparsed. - Release/CI/E2E: honor option terminators across release, Parallels smoke, plugin gauntlet, and extension-memory scripts. +- Performance: skip declaration bundling for runtime-only CLI startup and gateway watch build profiles. - Performance: reuse prepared provider handles, strict tool schemas, gateway runtime metadata, session maintenance config, plugin metadata, bundled skill allowlists, package-local plugin artifacts, and single-entry store writes. ## 2026.5.28 diff --git a/scripts/build-all.mjs b/scripts/build-all.mjs index d41385b61e1..aa1e04edaa0 100644 --- a/scripts/build-all.mjs +++ b/scripts/build-all.mjs @@ -176,11 +176,17 @@ export const BUILD_ALL_PROFILE_STEP_ENV = { }, }, gatewayWatch: { + tsdown: { + OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", + }, "runtime-postbuild": { OPENCLAW_RUNTIME_POSTBUILD_STATIC_ASSETS: "0", }, }, cliStartup: { + tsdown: { + OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", + }, "runtime-postbuild": { OPENCLAW_RUNTIME_POSTBUILD_STATIC_ASSETS: "0", }, diff --git a/test/scripts/build-all.test.ts b/test/scripts/build-all.test.ts index b63e9f7a0ba..5097d148f2e 100644 --- a/test/scripts/build-all.test.ts +++ b/test/scripts/build-all.test.ts @@ -239,20 +239,22 @@ describe("resolveBuildAllSteps", () => { ]); }); - it("skips bundled tsdown declarations for CI artifacts", () => { - const tsdown = resolveBuildAllSteps("ciArtifacts").find((step) => step.label === "tsdown"); - if (!tsdown) { - throw new Error("Missing ciArtifacts tsdown step"); - } + it("skips bundled tsdown declarations for runtime-only profiles", () => { + for (const profile of ["ciArtifacts", "gatewayWatch", "cliStartup"]) { + const tsdown = resolveBuildAllSteps(profile).find((step) => step.label === "tsdown"); + if (!tsdown) { + throw new Error(`Missing ${profile} tsdown step`); + } - expect(BUILD_ALL_PROFILE_STEP_ENV.ciArtifacts.tsdown).toEqual({ - OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", - }); - expect( - resolveBuildAllStep(tsdown, { env: { OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "0" } }).options.env, - ).toMatchObject({ - OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", - }); + expect(BUILD_ALL_PROFILE_STEP_ENV[profile].tsdown).toEqual({ + OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", + }); + expect( + resolveBuildAllStep(tsdown, { env: { OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "0" } }).options.env, + ).toMatchObject({ + OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", + }); + } }); it("uses a minimal built runtime profile for gateway watch regression", () => {