Zen now and then closes a space-bunny-free Chat Completions stream after some frames, with no finish_reason, usage or [DONE] (~0.1% of turns in the reporter's logs). The tool guard turned that into an error frame at the end of the 200 stream, so the agent threw away the reasoning and text it already had, and magpie can't ask a Zen Chat reply to go on. Now, for a client that streams, a Chat reply cut short that has said something (text or reasoning) and has no tool call pending ends as an ordinary answer: each open choice gets the note "(The reply was cut short: Zen closed the stream before it finished. Ask again to go on.)" and finish_reason "stop", then [DONE]. A reply whose every choice had finished only gets its [DONE]. It still fails when a tool call is pending (its arguments may be half written), when nothing was said (an empty reply), and when the reply is collapsed for a client that doesn't stream (nothing reached the client yet, so magpie can ask again). Anthropic Messages and Responses streams cut short still fail: magpie's gateway tells such a reply from a whole one itself (#370) and, for an Anthropic upstream reached through translation, goes on with it (continuation.go); a made-up message_stop or response.completed here would stop that. The error that remains names the reply's id, the events and bytes received, and an unfinished tool call, as the reporter asked. The README also says the free tier needs tools, which is why the five core tools are sent. Run: packages/zen-free `bun test` and `node --test` (161 pass). The new tests use the reporter's three frames byte for byte, at chunk sizes 7, 31 and 4096; all 6 go red on the old tool-response.mjs/provider.mjs. Broken by hand: dropping the pending-call check turns the "still fails" test red; ending cut short for non-streaming clients too turns the loader test and the "still fails" test red. Whole repo `bun test` with a temp HOME and TMPDIR: 1109 pass. `bun scripts/check.mjs`: all ✓. Through the plugin's loader against a node fake upstream on 127.0.0.1:3720 that sends role, reasoning and two text frames 50 ms apart and FINs: streamed → 200 with the text, the note, stop and [DONE]; not streamed → 502 "Upstream SSE ended without a completion marker (reply x2, 4 events, 659 bytes received)". Not run: real Zen (the cut can't be provoked) or magpie's plugin host.
14 lines
682 B
JSON
14 lines
682 B
JSON
{
|
|
"name": "@magpie-community/opencode-zen-free-auth",
|
|
"version": "0.1.4",
|
|
"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 }
|
|
}
|