#209: since 0.1.3 (#76) a call whose name the agent has no spelling of
(DSH with pwsh declared: psh, pash, ppwsh, pshh, bash, shell_command) was
left out with a text note, and a reply of only such calls was rewritten
to a plain stop. DSH read that as a finished answer: 16 of xiotbox's 19
cases ended an autonomous turn, and the model never saw an error it
could correct.
Now nameGuard answers the model's own name when no declared tool folds
to it, so every protocol (Chat JSON/SSE, Responses, Messages) hands the
call on with its id, arguments and tool-call finish, as every other
provider in magpie does. The agent answers an unknown name itself (DSH's
ToolRuntime, Claude Code's "No such tool available", Codex's
"unsupported call", OpenCode's invalid tool) and the model corrects it.
Case and separator folding (todowrite -> todo_write, bash -> Bash) is
unchanged, and an ambiguous fold is still never guessed: it goes on as
called. Only a call with no name is still left out with the note. Any
correction budget is the agent's, as with any provider; the plugin keeps
no per-turn state.
Tests: the #76/#209 names (bedit, bcp, ash, mcp__netcatcatty__unused,
psh, pash, ppwsh, pshh, shell_command) alone and beside a declared call,
JSON and streamed, in all three protocols: the call arrives with its id,
no note, no error, a tool-call finish; a Responses or Messages stream
comes through frame for frame. index.test's plugin-level case (loader
fetch against a local fake Zen) now expects an undeclared `edit` handed
on as a tool call. The leave-out machinery tests use a nameless call.
Run:
- packages/zen-free `bun test`: 174 pass, 0 fail. With nameGuard put
back to `|| null`: 28 fail.
- `node --test` (Node 25.8.2 and 22.22.0): 171 pass, 3 fail, the
"sends OpenCode's own headers" tests, red the same on origin/main
0b58032: Node's fetch adds accept-language and sec-fetch-mode. magpie
and OpenCode run the plugin in Bun. Filed as #212.
- Whole repo, TMPDIR and HOME in a scratch dir, `bun test`: 1771 pass,
0 fail. `bun scripts/check.mjs zen-free`: ok.
- Not tried live against Zen or with DSH: the fix is in what the plugin
hands on, shown against a fake upstream.