From 1ea820ca17e081ef780d98e486901957fd29dcfc Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:26:50 +0200 Subject: [PATCH] test(pi): verify poll lifecycle without replacing availability The lifecycle fixture injects its Pi runtime, so its executable probe should use a real configured executable rather than depend on an installed provider or replace the availability method. Co-authored-by: Kushal Bairagya --- .../agent/agent-manager.provider-subagents.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/server/src/server/agent/agent-manager.provider-subagents.test.ts b/packages/server/src/server/agent/agent-manager.provider-subagents.test.ts index 35e66fa739..36ac1b3c0d 100644 --- a/packages/server/src/server/agent/agent-manager.provider-subagents.test.ts +++ b/packages/server/src/server/agent/agent-manager.provider-subagents.test.ts @@ -428,10 +428,13 @@ describe("provider subagent finalize", () => { // The real Pi adapter, so the miss ticks come from the poll that protects the row instead of // from a hand-written upsert. const pi = new FakePi(); - const client = new PiRpcAgentClient({ logger: pino({ level: "silent" }), runtime: pi }); - // CI runners have no pi installation; the runtime is the FakePi above, so only the - // availability probe needs a stub. - vi.spyOn(client, "isAvailable").mockResolvedValue(true); + const client = new PiRpcAgentClient({ + logger: pino({ level: "silent" }), + runtime: pi, + // The injected runtime owns execution; use an existing executable for the real availability + // probe so this test does not depend on a Pi installation or replace a client method. + runtimeSettings: { command: { mode: "replace", argv: [process.execPath] } }, + }); const workdir = mkdtempSync(join(tmpdir(), "agent-manager-provider-subagent-poll-")); const manager = new AgentManager({ clients: { pi: client },