From 4ac1ff4782dadb03cafe387a127ca6ec87e8f494 Mon Sep 17 00:00:00 2001 From: tiandao <2388127316@qq.com> Date: Sun, 4 Oct 2026 06:57:48 +0800 Subject: [PATCH 1/2] fix(e2e): align hosted-search version assertion with Pi 1.0.1 PR #1357 bumped the workspace to Pi 1.0.1 but left the hosted-search e2e asserting manifest.version === '1.0.0', so the run fails on the installed 1.0.1 packages. Track the locked version. --- scripts/e2e-hosted-search.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/e2e-hosted-search.mjs b/scripts/e2e-hosted-search.mjs index d3d3ffdde..8a9c4492d 100644 --- a/scripts/e2e-hosted-search.mjs +++ b/scripts/e2e-hosted-search.mjs @@ -160,7 +160,7 @@ when the run ends; any change between the two fails the run.`); for (const name of ["pi-ai", "pi-agent-core", "pi-coding-agent"]) { const manifest = JSON.parse(await readFile(join(root, "packages/agent-runtime/node_modules/@earendil-works", name, "package.json"), "utf8")); evidence.installedDependencies[name] = manifest.version; - assert.equal(manifest.version, "1.0.0", `${name} must match the locked pi version`); + assert.equal(manifest.version, "1.0.1", `${name} must match the locked pi version`); } evidence.lockfileSha256 = await hash(join(root, "pnpm-lock.yaml")); evidence.head = git("rev-parse", "HEAD"); From 33eb4a03177271a1c9e7a82701fd99eab615757c Mon Sep 17 00:00:00 2001 From: vastsa Date: Sun, 4 Oct 2026 11:08:52 +0800 Subject: [PATCH 2/2] fix(e2e): follow the pinned Pi version in hosted search The hosted-search regression should track the exact Pi version declared by agent-runtime so future dependency upgrades do not stale the harness. Keep all Pi packages aligned to that pin and make the offline fixture persist runtime messages through the host RPC it exposes. --- scripts/e2e-hosted-search.mjs | 10 +++++++++- scripts/e2e/hosted-search-sidecar.mjs | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/e2e-hosted-search.mjs b/scripts/e2e-hosted-search.mjs index 8a9c4492d..78178e29d 100644 --- a/scripts/e2e-hosted-search.mjs +++ b/scripts/e2e-hosted-search.mjs @@ -157,10 +157,18 @@ when the run ends; any change between the two fails the run.`); evidence.nodeVersion = process.version; evidence.pnpmVersion = values.bundle ? "not invoked (supplied artifact)" : runPnpm(["--version"]).trim(); evidence.installedDependencies = {}; + const runtimeManifest = JSON.parse(await readFile(join(root, "packages/agent-runtime/package.json"), "utf8")); + const expectedVersion = runtimeManifest.dependencies?.["@earendil-works/pi-ai"]; + assert.ok( + typeof expectedVersion === "string" && /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(expectedVersion), + "agent-runtime must exactly pin @earendil-works/pi-ai", + ); for (const name of ["pi-ai", "pi-agent-core", "pi-coding-agent"]) { const manifest = JSON.parse(await readFile(join(root, "packages/agent-runtime/node_modules/@earendil-works", name, "package.json"), "utf8")); evidence.installedDependencies[name] = manifest.version; - assert.equal(manifest.version, "1.0.1", `${name} must match the locked pi version`); + const packageName = `@earendil-works/${name}`; + assert.equal(runtimeManifest.dependencies?.[packageName], expectedVersion, `${packageName} must share the exact pi-ai pin`); + assert.equal(manifest.version, expectedVersion, `${name} must match the agent-runtime pi pin`); } evidence.lockfileSha256 = await hash(join(root, "pnpm-lock.yaml")); evidence.head = git("rev-parse", "HEAD"); diff --git a/scripts/e2e/hosted-search-sidecar.mjs b/scripts/e2e/hosted-search-sidecar.mjs index c14fe0d13..4f57b934a 100644 --- a/scripts/e2e/hosted-search-sidecar.mjs +++ b/scripts/e2e/hosted-search-sidecar.mjs @@ -196,6 +196,12 @@ export function fixtureHost({ history = [], instructions = false } = {}) { return async (method, params) => { switch (method) { case "session.get": return { session: { id: params.id, messages: history } }; + case "session.appendMessage": { + const message = params?.message; + assert.ok(message && typeof message.id === "string", "session.appendMessage requires a message id"); + if (!history.some((entry) => entry.id === message.id)) history.push(message); + return { ok: true }; + } case "project.instructions.resolve": return { entries: instructions ? [{ source: "nested/AGENTS.md",