From d0da361088a4a052e9086336b64dd07cf646abce Mon Sep 17 00:00:00 2001 From: shuv1337 Date: Sat, 14 Nov 2026 00:21:56 -0800 Subject: [PATCH] fix(release): account for the extra prepared server cache entry The Windows payload validator counts every file under win-unpacked, including the prepared server compile cache: one bytecode entry per bundled server module the packaged engine compiles, plus manifest.json. The upstream sync rebuilt the server bundle and it now emits the @opencode/client service-probe chunk as its own module, so the cache has 23 entries instead of 22 and the payload is 100 files instead of 99. Nothing new entered the runtime payload; the 76 runtime files and 32 sidecar natives are unchanged, and macOS payload composition is identical apart from the cache keys. Raise the cap to 100 and assert the boundary in the test through the constant so it cannot drift from it again. Model: deepseek-v4.1-flash, harness: OpenCode --- scripts/build-desktop-artifact.test.ts | 6 +++--- scripts/build-desktop-artifact.ts | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/build-desktop-artifact.test.ts b/scripts/build-desktop-artifact.test.ts index 507c5d87d3346..853c18f42c569 100644 --- a/scripts/build-desktop-artifact.test.ts +++ b/scripts/build-desktop-artifact.test.ts @@ -1682,7 +1682,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { const cacheDir = path.join(fixture.packagedAppDir, "resources", "server-compile-cache"); yield* fs.makeDirectory(cacheDir, { recursive: true }); - for (let index = result.fileCount; index < 99; index++) { + for (let index = result.fileCount; index < WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT; index++) { yield* fs.writeFileString(path.join(cacheDir, String(index)), "prepared bytecode"); } const validate = validateWindowsPackagedPayload({ @@ -1691,12 +1691,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { targetArch: "x64", appVersion: WINDOWS_PAYLOAD_FIXTURE_VERSION, }); - assert.equal((yield* validate).fileCount, 99); + assert.equal((yield* validate).fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT); yield* fs.writeFileString(path.join(cacheDir, "unexpected"), "extra file"); const error = yield* validate.pipe(Effect.flip); assert.instanceOf(error, WindowsPackagedPayloadValidationError); assert.equal(error.reason, "file-limit-exceeded"); - assert.equal(error.fileCount, 100); + assert.equal(error.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT + 1); }), ).pipe(Effect.provideService(HostProcess.Platform, "linux")), ); diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 0eadc0d6de989..ac2ead34d736c 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -1085,8 +1085,10 @@ export function resolveWindowsServerAsarIgnoreGlobs(arch: typeof BuildArch.Type) ]; } -// The Windows release has 76 runtime files plus 22 prepared server cache entries and their manifest. -export const WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT = 99; +// The Windows release has 76 runtime files plus one prepared server cache entry per bundled +// server module the packaged engine compiles, and their manifest. The bundle now splits the +// @opencode/client service-probe chunk into its own module, so that is 23 entries and 100 files. +export const WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT = 100; export const WINDOWS_SERVER_RESOURCE_SOURCE_DIR = "apps/desktop/prod-resources/windows-server"; export const WINDOWS_SERVER_EXTRA_RESOURCES = [ {