From 58221e6faa7cf9ec522b5c6a4b756d88b539409d Mon Sep 17 00:00:00 2001 From: "zhou.han" Date: Fri, 13 Nov 2026 14:20:17 +0800 Subject: [PATCH] agy-cli: the smoke fake stops a turn whose ToolSearch failed (#1069) The fake agy in smoke.mjs now returns when its old prompt's ToolSearch call comes back isError, instead of going on to its loaded-tool validator. Under a slow shutdown (Windows) that path logged unknownTool and failed "no call to the loaded tool reaches agy's validator in the old prompt". Fixture only; the bridge is unchanged. Run at 6946b93c: smoke.mjs ALL OK (337) 3 of 3 on Windows 11. With an 800ms pause injected before the bridge's process stop (WSL), the parent fails that check and this head passes it. CI test job green. Fixes #973. --- packages/agy-cli/test/smoke.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/agy-cli/test/smoke.mjs b/packages/agy-cli/test/smoke.mjs index 7741da1..2ffd46a 100644 --- a/packages/agy-cli/test/smoke.mjs +++ b/packages/agy-cli/test/smoke.mjs @@ -375,7 +375,10 @@ async function prompt(params) { // Like agy 1.5.3: a call is checked against the tools listed before this // prompt began; a tools/list_changed during the prompt does not reach it. const known = new Set(tools.map(tool => tool.name)) - if (!text.includes("")) await invoke("ToolSearch", { query: "select:loaded_tool" }) + if (!text.includes("")) { + const result = await invoke("ToolSearch", { query: "select:loaded_tool" }) + if (result?.isError) return finish("ToolSearch failed") + } if (!known.has("loaded_tool")) { log({ type: "unknownTool", convId: session.id, name: "loaded_tool" }) chunk('Encountered error in tool validation: unknown tool: "loaded_tool" — check spelling\n')