From 301ac9a586ce5145ef78f4ea815ce48a56568354 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Tue, 1 Sep 2026 19:49:30 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20green=20main=20=E2=80=94=20pnpm=20sh?= =?UTF-8?q?im=20launch,=20idempotent-replay=20head=20snapshots,=20workspac?= =?UTF-8?q?e-free=20published=20manifest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three independent breakages kept hosted CI red on main: - scripts/run-examples-check.mjs launched npm_execpath through the current Node executable, but pnpm/setup on hosted runners exposes a native shim (bare command name), so `node pnpm` failed with MODULE_NOT_FOUND. The script now execs non-JavaScript entrypoints directly. - The sqlite migration (#149) made the example kernel return the durable prefix at the original commit revision on idempotent replays; the retired JSONL kernel returned the current head. Re-running a fixture after a reset therefore reported the pre-reset state version and failed the runtime playground e2e on every Node line. Replays now read the head again. - #151 added `"@agent-bundle/runtime": "workspace:*"` to the published agent-bundle devDependencies, tripping the release audit (npm refuses tarball manifests with workspace ranges). The optional peer is now satisfied through a pnpm-workspace override instead of a shipped range. --- examples/rsc-agent-runtime/src/runtime/state-file.ts | 7 +++++-- packages/agent-bundle/package.json | 1 - pnpm-lock.yaml | 9 ++++++--- pnpm-workspace.yaml | 6 ++++++ scripts/run-examples-check.mjs | 10 ++++++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/examples/rsc-agent-runtime/src/runtime/state-file.ts b/examples/rsc-agent-runtime/src/runtime/state-file.ts index 202efbf33..a85a7b183 100644 --- a/examples/rsc-agent-runtime/src/runtime/state-file.ts +++ b/examples/rsc-agent-runtime/src/runtime/state-file.ts @@ -157,7 +157,10 @@ export const createFileRuntimeKernel = (options: FileRuntimeKernelOptions): Runt { host: input.host, path: input.path, sessionId: input.sessionId, toolName: input.toolName }, { idempotencyKey: input.idempotencyKey, signal: mutationOptions?.signal }, ); - return snapshotAt(store, committed.revision, undefined, mutationOptions?.signal); + // Idempotent replays return the current head, exactly like the retired + // JSONL kernel: a rerun after a later reset must surface the reset + // state, not the durable prefix at the original commit. + return snapshotAt(store, committed.replayed ? undefined : committed.revision, undefined, mutationOptions?.signal); }); }, @@ -169,7 +172,7 @@ export const createFileRuntimeKernel = (options: FileRuntimeKernelOptions): Runt ...(input.seed === undefined ? {} : { seed: { edits: [], seed: input.seed } }), signal: mutationOptions?.signal, }); - return snapshotAt(store, committed.revision, undefined, mutationOptions?.signal); + return snapshotAt(store, committed.replayed ? undefined : committed.revision, undefined, mutationOptions?.signal); }); }, diff --git a/packages/agent-bundle/package.json b/packages/agent-bundle/package.json index 4335bb422..31531604f 100644 --- a/packages/agent-bundle/package.json +++ b/packages/agent-bundle/package.json @@ -99,7 +99,6 @@ "yaml": "2.9.0" }, "devDependencies": { - "@agent-bundle/runtime": "workspace:*", "@modelcontextprotocol/server": "2.0.0", "@types/react": "19.2.18", "@types/ws": "8.18.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b59653a38..be63f1bb0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + '@agent-bundle/runtime': workspace:* + importers: .: @@ -184,6 +187,9 @@ importers: packages/agent-bundle: dependencies: + '@agent-bundle/runtime': + specifier: workspace:* + version: link:../rsc-runtime '@modelcontextprotocol/client': specifier: 2.0.0 version: 2.0.0 @@ -254,9 +260,6 @@ importers: specifier: 2.9.0 version: 2.9.0 devDependencies: - '@agent-bundle/runtime': - specifier: workspace:* - version: link:../rsc-runtime '@types/react': specifier: 19.2.18 version: 19.2.18 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b6aae7d0f..38aacb47a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,6 +2,12 @@ packages: - packages/* - packages/workbench/src/inspector - examples/* +# The published agent-bundle manifest must never carry a `workspace:` range +# (npm refuses to install such a tarball, and the release audit forbids it), +# so its optional @agent-bundle/runtime peer is satisfied from the workspace +# here instead of through a devDependency in the shipped package.json. +overrides: + '@agent-bundle/runtime': workspace:* allowBuilds: '@google/genai': false msgpackr-extract: false diff --git a/scripts/run-examples-check.mjs b/scripts/run-examples-check.mjs index 43428178d..777cd2561 100644 --- a/scripts/run-examples-check.mjs +++ b/scripts/run-examples-check.mjs @@ -10,8 +10,14 @@ if (pnpmEntrypoint === undefined || pnpmEntrypoint.length === 0) { throw new Error('run-examples-check.mjs must be launched through a pnpm package script.'); } -const child = spawn(process.execPath, [ - pnpmEntrypoint, +// npm_execpath is a JavaScript entrypoint under corepack and pnpm's own +// installer, but a native shim (or a bare command name) under standalone +// setups such as pnpm/setup on hosted CI. Only JavaScript files can be +// launched through the current Node executable. +const isJavaScriptEntrypoint = /\.[cm]?js$/u.test(pnpmEntrypoint); +const command = isJavaScriptEntrypoint ? process.execPath : pnpmEntrypoint; +const child = spawn(command, [ + ...(isJavaScriptEntrypoint ? [pnpmEntrypoint] : []), '--filter', './examples/*', '--workspace-concurrency=3',