empty-reply 0.1.0: a reply with reasoning but no text ends early, so the agent retries (#900)
Adds packages/empty-reply (0.1.0): a reply made of reasoning alone, with end_turn (Anthropic) or response.completed (Responses), loses its end events so Claude Code and Codex retry; a whole reply becomes an error body or status "failed". max_tokens, refusal and incomplete are kept. A stopgap for yetone/magpie#3358 until the gateway checks this itself. Reviewed at 900 head: bun test packages/empty-reply 17 pass, bun scripts/check.mjs all packages ok, bun test scripts 22 pass (mote, Bun 1.4.2). Read every case in cases.json against the Anthropic and Responses stream shapes. The author ran Claude Code 2.1.319 and codex-cli 0.167.0 against a reasoning-only Chat upstream (ordered and rotate). Not run by the reviewer in a live gateway.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@magpie-community/middleware-empty-reply",
|
||||
"version": "0.1.0",
|
||||
"description": "Drop the end of a reasoning-only reply, so Claude Code and Codex retry instead of treating an empty turn as finished",
|
||||
"type": "module",
|
||||
"files": ["empty-reply.middleware.js", "README.md"],
|
||||
"keywords": ["magpie", "magpie-middleware", "empty-reply", "claude-code", "codex", "llm-gateway"],
|
||||
"license": "MIT",
|
||||
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/empty-reply" },
|
||||
"magpie": {
|
||||
"middleware": "./empty-reply.middleware.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user