mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8090] [MERGED] fix(mari): recover when a reply hits the model's output limit #8092
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8092
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8090
Author: @ylli-selmani
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ylli-selmani
Base:
staging← Head:claude/mari-output-limit-recovery-002a30📝 Commits (2)
6d2c266fix(mari): recover when a reply hits the model's output limit76e122cfix(mari): audit a failed stream; name a closed textual call cut before prose📊 Changes
8 files changed (+322 additions, -38 deletions)
View changed files
📝
packages/server/src/services/llm/base-provider.ts(+9 -0)📝
packages/server/src/services/llm/providers/anthropic.provider.ts(+3 -2)📝
packages/server/src/services/llm/providers/google.provider.ts(+3 -4)📝
packages/server/src/services/llm/providers/openai.provider.ts(+12 -16)📝
packages/server/src/services/professor-mari/pi-runtime.ts(+107 -11)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+1 -0)📝
scripts/regressions/professor-mari/pi-runtime.regression.ts(+135 -5)📝
scripts/regressions/provider-compat.regression.ts(+52 -0)📄 Description
Linked issue
Part of #8096 (umbrella). This PR is part 1 of 2; the handbook follow-up (PR B) closes it.
Why this change
tool_calls, notlength. Mari ran it with{}arguments, got a generic "invalid arguments" error and never learned why.What changed
Providers (no visible change for the user)
base-provider.ts: newtoolCallFinishReason(). A reply with tool calls reportstool_callsunless it was cut (length/max_tokens/max_output_tokens). It is used at every finish-reason site in the OpenAI, Anthropic and Google providers. Nothing in the server compares against"tool_calls", so no caller changes.Professor Mari, pi runtime (visible to the user)
[Engine note, not from the user]). It names what was cut (tool, action, size) and asks for smaller calls: one per reply, each under about 1.5× the token limit in characters, with no redoing of steps that already succeeded. Thinking-only and prose-only cuts get their own wording.Regressions
pi-runtime.regression.ts: two cuts then a finish, budget exhausted, thinking cut, a cut while claiming, plus unit checks for the description and prompt.provider-compat.regression.ts: a local server sends a partial tool call withfinish_reason: "length", streamed and non-streamed. It fails without the provider fix.Slices
6d2c26608)76e122c53). A failed stream (not a limit cut) goes through the claim audit again and keeps the old stop note. A closed textual call dropped with cut prose is named as the call. The 1.5 characters-per-token target is a named constant.Follow-up (PR B, not in this PR): an up-front hint when Max Output Tokens is small, and "small models" lines in the built-in handbooks. Themes may need a partial-CSS Engine action.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run results:
pnpm checkpassed (one existing client lint warning, client untouched).node ./scripts/run-regressions.mjs --filter regressions/professor-mari/and--filter regressions/mari/passed. No live run against a small-output model yet.Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No user docs touched: the new status strings are server-built, like every other Mari status.
UI evidence (if applicable)
None yet: the visible change is two status lines in Mari's chat. A screenshot will follow from the manual run.
@SpicyMarinara
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.