From b8354e4304bbe816baca71ee78b33d45cd90db15 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 19 Nov 2026 15:29:40 -0600 Subject: [PATCH] test(pi): pi-unpin S2 follow-up: the adapter tests point MOSAIC_PI_BIN at their stand-in, and the sandbox test reads the new mount label (#1873) --- packages/harness/tests/creative.test.mjs | 3 ++- packages/harness/tests/skills.test.mjs | 3 ++- packages/seat/tests/sandbox.test.mjs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/harness/tests/creative.test.mjs b/packages/harness/tests/creative.test.mjs index d9ee76af8..5517c3158 100644 --- a/packages/harness/tests/creative.test.mjs +++ b/packages/harness/tests/creative.test.mjs @@ -177,7 +177,8 @@ function runAdapter(t, harness, b, { prompt = b.files.prompt, cwd } = {}) { writeFileSync(cli, '#!/bin/sh\nprintf "%s\\0" "$@" > "$ARGV_OUT"\necho \'{"type":"result","subtype":"success","result":"ok"}\'\n'); chmodSync(cli, 0o755); const s = { harness, provider: harness === "pi" ? "probe" : null, model: "claude-sonnet-5-5", workspace: b.workspace, sessionDir: join(b.dir, "session"), toolSocket: join(b.dir, "tools.sock"), turnMarker: join(b.dir, "turn.done"), bundle: { ...b.files, prompt }, harnessEnv: b.env }; - const env = { ...adapterEnv(s, { PATH: `${bin}:/usr/bin:/bin`, HOME: join(b.dir, "home") }), ARGV_OUT: join(b.dir, "argv"), MOSAIC_REQUEST: "x" }; + // #1873 S2: the pi adapter runs MOSAIC_PI_BIN, which the bundle sets to the pi it found. + const env = { ...adapterEnv(s, { PATH: `${bin}:/usr/bin:/bin`, HOME: join(b.dir, "home") }), ARGV_OUT: join(b.dir, "argv"), MOSAIC_REQUEST: "x", ...(harness === "pi" ? { MOSAIC_PI_BIN: cli } : {}) }; const r = spawnSync("/bin/sh", [join(REPO, "adapters", harness === "pi" ? "pi" : "claude", "adapter.sh")], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], env }); const argv = existsSync(env.ARGV_OUT) ? readFileSync(env.ARGV_OUT, "utf8").split("\0") : null; return { ...r, argv }; diff --git a/packages/harness/tests/skills.test.mjs b/packages/harness/tests/skills.test.mjs index e7581d8b9..c10ccf246 100644 --- a/packages/harness/tests/skills.test.mjs +++ b/packages/harness/tests/skills.test.mjs @@ -183,7 +183,8 @@ test("each adapter passes the skills only in the prompt file, with skill discove const b = buildBundle({ dir: join(dir, "bundle"), resolved, contract: "# Contract\n", harness: HARNESS[harness], models, skillsDir: REPO_SKILLS, session: { ...s, run: "run-1", launchedBy: "pm" } }); s.bundle = b.files; s.harnessEnv = b.env; - const env = { ...adapterEnv(s, { PATH: `${join(dir, "bin")}:/usr/bin:/bin`, HOME: join(dir, "home") }), ARGV_OUT: join(dir, "argv"), MOSAIC_REQUEST: "x" }; + // #1873 S2: the pi adapter runs MOSAIC_PI_BIN, which the bundle sets to the pi it found. + const env = { ...adapterEnv(s, { PATH: `${join(dir, "bin")}:/usr/bin:/bin`, HOME: join(dir, "home") }), ARGV_OUT: join(dir, "argv"), MOSAIC_REQUEST: "x", ...(harness === "pi" ? { MOSAIC_PI_BIN: cli } : {}) }; const r = spawnSync("/bin/sh", [join(REPO, "adapters", harness === "pi" ? "pi" : "claude", "adapter.sh")], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], env }); assert.equal(r.status, 0, `${harness}: ${r.stderr}`); const argv = readFileSync(join(dir, "argv"), "utf8").split("\0"); diff --git a/packages/seat/tests/sandbox.test.mjs b/packages/seat/tests/sandbox.test.mjs index c7377a1c8..ba4502b70 100644 --- a/packages/seat/tests/sandbox.test.mjs +++ b/packages/seat/tests/sandbox.test.mjs @@ -129,7 +129,7 @@ test("row 65 a harness module's mounts bind read-only after the adapter, each wi const list = binds({ ...args, harnessMounts: pi.mounts({ env: {} }) }); const at = (src) => list.findIndex((b) => b.src === src); const modules = list[at(realpathSync(join(REPO, "node_modules")))]; - assert.deepEqual(modules, { kind: "ro", src: realpathSync(join(REPO, "node_modules")), dest: join(REPO, "node_modules"), why: "pi and its packages, on the session's PATH" }); + assert.deepEqual(modules, { kind: "ro", src: realpathSync(join(REPO, "node_modules")), dest: join(REPO, "node_modules"), why: "pi and its packages (the repository's pi)" }); assert.ok(at(join(root, "a.sh")) < at(modules.src) && at(modules.src) < at(join(root, "bus.sock"))); const fixture = binds({ ...args, harnessMounts: [{ src: join(root, "tool"), why: "a fixture harness's tool" }] }); assert.deepEqual(fixture.find((b) => b.src === join(root, "tool")), { kind: "ro", src: join(root, "tool"), why: "a fixture harness's tool" });