Files
plugins/packages/zen-free/package.json
T
yetone da7e2f67a5 zen-free 0.1.3: a call of a tool the agent doesn't have is left out with a note, not a failed turn (#76, tkhs101)
#76: Zen's free models sometimes call a tool by a name the agent never
declared (tkhs101's table: bedit, bcp, ash, mcp__netcatcatty__unused,
beside declared edit, bash, mcp__netcatty-external__list_hosts). The
guard answered each with "Upstream called a tool not declared by the
client", which failed the whole turn. The rows without a name are from
before 0.1.1 (published 10-10 11:51 UTC), which added the name.

Now such a call (or one with no name) is left out of the reply instead:
- chat: dropped from tool_calls/function_call; the reply's content says
  "(The model called a tool this agent doesn't have: "bedit". The call
  was left out.)"; kept calls are renumbered from 0; finish_reason
  becomes "stop" when no call is left, including a repeated finish.
- responses: the function_call item becomes a message item with the
  note (added, text deltas, done, and in response.completed); its
  argument events are not passed on.
- anthropic: the tool_use block becomes a text block with the note; its
  input deltas are not passed on; stop_reason tool_use becomes end_turn
  when no call is left.
A call of an unsupported type (custom tools, non-object input) still
fails as before.

Run:
- bun test packages/zen-free: 155 pass, 0 fail; node --test
  packages/zen-free/*.test.mjs: 155/155; bun scripts/check.mjs zen-free.
- The new tests on the old tool-response.mjs: 35 fail.
- Breaking the finish rewrite by hand: 5 fail.
- Chat stream fixtures use the shape a live step-5-preview-free stream
  sent (name whole in the first delta, arguments in pieces, two
  tool_calls finishes). Zen sends names whole, so the names in #76 are
  the model's own; a real misnamed call was not reproduced live.
2026-10-11 08:06:44 +08:00

14 lines
682 B
JSON

{
"name": "@magpie-community/opencode-zen-free-auth",
"version": "0.1.3",
"description": "OpenCode Zen free models through the public credential, with native streaming protocols",
"type": "module",
"main": "./index.mjs",
"files": ["index.mjs", "provider.mjs", "models.mjs", "stream.mjs", "tool-response.mjs", "README.md", "LICENSE"],
"keywords": ["opencode", "opencode-plugin", "zen", "free", "magpie"],
"license": "MIT",
"repository": { "type": "git", "url": "https://github.com/magpie-community/plugins", "directory": "packages/zen-free" },
"scripts": { "test": "bun test" },
"magpie": { "icon": "https://opencode.ai/favicon-v3.ico", "maxConcurrency": 2 }
}