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.
This commit is contained in:
zhou.han
2026-11-13 14:20:17 +08:00
committed by GitHub
parent b40a853c20
commit 58221e6faa
+4 -1
View File
@@ -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("<conversation_history>")) await invoke("ToolSearch", { query: "select:loaded_tool" })
if (!text.includes("<conversation_history>")) {
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')