[GH-ISSUE #8777] stop streamed-output fallbacks, empty JSON replies and partial package completions #8495

Closed
opened 2026-11-07 16:43:20 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8777

Originally assigned to: @SpicyMarinara on GitHub.

Found by the 2026-11-03 release-prep bug sweep of Marinara Engine. Each finding was confirmed by two independent verifiers.

A release-prep audit found three LLM streaming failure paths. Two independent verifiers checked each one.

  1. With an "If it fails" fallback connection, a primary that streamed part of a reply through onToken and then errored on the chatComplete path got the fallback's whole reply appended after it. This hits tool rounds, /api/generate/raw and dry runs, and the garbled reply is saved. Callers that build their result from the streamed chunks (agent calls) got the same mix in the text they parse.
  2. OpenAI-compatible endpoints that ignore stream:true and answer with JSON made the main no-tools reply (provider.chat()) come back empty. The earlier fix covered only chatComplete.
  3. Since this release, the capability package host always streams. A stream that broke after partial text resolved with finishReason "error" instead of rejecting. Packages such as Otome Hearth, Gacha Forge and Long-Term Memory could then parse and save truncated scenes or memories as complete.
    Some callers pass onToken only to keep a watchdog or progress display alive (Game setup, session conclusion, campaign progression, Lorebook Keeper, agent progress). Those still use the fallback, because nothing they streamed reached the user.

No issue is linked: these came from the release-prep audit. Per CONTRIBUTING, an issue should be opened before this PR is submitted.

🤖 Generated with Claude Code

Originally created by @SpicyMarinara on GitHub (Nov 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8777 Originally assigned to: @SpicyMarinara on GitHub. Found by the 2026-11-03 release-prep bug sweep of Marinara Engine. Each finding was confirmed by two independent verifiers. A release-prep audit found three LLM streaming failure paths. Two independent verifiers checked each one. 1. With an "If it fails" fallback connection, a primary that streamed part of a reply through onToken and then errored on the chatComplete path got the fallback's whole reply appended after it. This hits tool rounds, /api/generate/raw and dry runs, and the garbled reply is saved. Callers that build their result from the streamed chunks (agent calls) got the same mix in the text they parse. 2. OpenAI-compatible endpoints that ignore stream:true and answer with JSON made the main no-tools reply (provider.chat()) come back empty. The earlier fix covered only chatComplete. 3. Since this release, the capability package host always streams. A stream that broke after partial text resolved with finishReason "error" instead of rejecting. Packages such as Otome Hearth, Gacha Forge and Long-Term Memory could then parse and save truncated scenes or memories as complete. Some callers pass onToken only to keep a watchdog or progress display alive (Game setup, session conclusion, campaign progression, Lorebook Keeper, agent progress). Those still use the fallback, because nothing they streamed reached the user. No issue is linked: these came from the release-prep audit. Per CONTRIBUTING, an issue should be opened before this PR is submitted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bsakaguchi 2026-11-07 16:43:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8495
No description provided.