pi declared read, bash, edit and write through the gateway on Windows and
the model saw only agy's own manage_task; `read` came back
`unknown tool: "read"`. agy reads a client's tools from the bridge's
ide-tools MCP server, which it starts by running `nc` from PATH. When
that never answers, #waitForToolList gave up after 5s without a word and
the turn ran with no client tool at all, for every client.
On Windows agy 1.5 runs only nc.exe, never the nc.cmd the bridge falls
back to. A failed nc.exe build was swallowed and cached for the whole
host process, so every session after it had no tools until magpie
restarted.
- A session that declares tools and whose agy hasn't listed them after
AGY_BRIDGE_TOOL_LIST_WAIT_MS (now 20s) fails with 502
tools_not_loaded, naming the cause: on Windows, the nc.exe build's own
failure (not Bun, non-ASCII folder, bun build's exit code or "wrote no
nc.exe" plus its last stderr lines); elsewhere, the `nc` MCP server
that never answered. No session/prompt is sent.
- A live agy that never listed the tools a follow-up declares (started
with none) is replaced (session_new reason tools_unlisted), not reused.
- On Windows a failed nc.exe build is tried again after 5 minutes,
rather than never.
Tests: test/tools-listed.mjs (new, in agy-cli.test.mjs). The testkit's
fake agy can now not list tools (listTools), or not keep a watch
(watchTools), and records each listing.
Run at this tree:
- mica-run, HOME=$(mktemp -d): cd packages/agy-cli && bun test:
41 pass 0 fail; bun scripts/check.mjs agy-cli: ok. (mote was at load
130.) An earlier run of the same suite had test/usage.mjs red twice on
its 3s usage-query deadline at mica load 23; it passed 41/41 twice
alone. That is #1191.
- win-run on xiaomi-gpu (real Windows, Bun 1.4.2): tools-listed.mjs and
windows-nc.mjs, 13 pass 0 fail. The first Windows run caught that the
platform-neutral cases took the real win32 path; they now pin linux.
Broken by hand: tools-listed.mjs against the old index.mjs
(AGY_BRIDGE_TEST_INDEX = HEAD's copy): 3 of 5 red. The unlisted session
ran its turn (200, end_turn after 5s), the follow-up ran on the agy that
never listed Read, and the failed Windows build was never retried. The
two cases that should hold either way pass.
Earlier, on xiaomi-gpu: a real nc.exe built in ~335ms, and the shim
answered tools/list in 137ms first and ~28ms after.
Not tried: a real agy turn or a real Windows agy session. There is no
usable account: the Mac one is banned, and Windows agy answers
session/new with "Authentication required". So the reporter's exact
trigger (which nc.exe build failure, or none) isn't confirmed. The error
now names it on their machine.