[GH-ISSUE #8096] [Feature]: Professor Mari recovers when a reply hits the model's output limit #7560

Closed
opened 2026-10-24 04:04:14 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ylli-selmani on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8096

Originally assigned to: @ylli-selmani on GitHub.

What problem does this solve?

When a model reply runs into the connection's output limit (Max Output Tokens), Professor Mari stops with "Professor Mari hit the model output limit. Ask her to continue…". The user has to type "continue", and she usually retries the same oversized call and gets cut again. Small local models (e.g. Gemma 3 12b) hit this on any large write: onboarding, characters, presets, themes.

On native tool-calling connections the cut was hidden: providers reported a cut tool call as tool_calls, not length. Mari ran it with empty arguments, got a generic "invalid arguments" error and never learned why it failed.

Proposed solution

  1. Providers keep reporting length when a reply with tool calls was cut.
  2. The pi runtime recovers: a short engine note tells Mari what was cut (tool, action, size) and asks her to redo it in smaller calls, up to 2 times per run. After that she stops with a clear note: raise Max Output Tokens, or ask for a smaller piece.
  3. Follow-up: a short up-front hint when Max Output Tokens is small, and "small models" guidance in the built-in handbooks (onboarding, characters, presets, extensions, themes, home widgets). For themes, partial CSS edits may need an Engine action, since a stylesheet is one document.

Alternatives considered

  • Answering the cut call with a fake failed tool result: it would replay the broken call with empty arguments to the model.
  • Sending the partial JSON back: costs context and invites the model to continue broken JSON.
  • Recovering in the classic runtime too: classic is the fallback runtime. Deferred unless someone needs it there.

Additional context

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8096 Originally assigned to: @ylli-selmani on GitHub. ## What problem does this solve? When a model reply runs into the connection's output limit (Max Output Tokens), Professor Mari stops with "Professor Mari hit the model output limit. Ask her to continue…". The user has to type "continue", and she usually retries the same oversized call and gets cut again. Small local models (e.g. Gemma 3 12b) hit this on any large write: onboarding, characters, presets, themes. On native tool-calling connections the cut was hidden: providers reported a cut tool call as `tool_calls`, not `length`. Mari ran it with empty arguments, got a generic "invalid arguments" error and never learned why it failed. ## Proposed solution 1. Providers keep reporting `length` when a reply with tool calls was cut. 2. The pi runtime recovers: a short engine note tells Mari what was cut (tool, action, size) and asks her to redo it in smaller calls, up to 2 times per run. After that she stops with a clear note: raise Max Output Tokens, or ask for a smaller piece. 3. Follow-up: a short up-front hint when Max Output Tokens is small, and "small models" guidance in the built-in handbooks (onboarding, characters, presets, extensions, themes, home widgets). For themes, partial CSS edits may need an Engine action, since a stylesheet is one document. ## Alternatives considered - Answering the cut call with a fake failed tool result: it would replay the broken call with empty arguments to the model. - Sending the partial JSON back: costs context and invites the model to continue broken JSON. - Recovering in the classic runtime too: classic is the fallback runtime. Deferred unless someone needs it there. ## Additional context - PR A (provider fix + recovery): https://github.com/Pasta-Devs/Marinara-Engine/pull/8090 - Builds on the built-in Mari handbooks from #7908. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-24 04:04:14 +07:00
Author
Owner

@ylli-selmani commented on GitHub (Oct 22, 2026):

Done on staging in two parts:

  • #8090: providers keep reporting length for a cut tool call, and the pi runtime recovers with an engine note (up to 2 times per run).
  • #8100: a short up-front hint when Max Output Tokens is 4096 or less (both the pi and the classic prompt), and a "split big writes" line in the six built-in handbooks.

Not done: a partial-CSS Engine action for themes. #8100 checked that theme.update replaces the whole stylesheet, so the themes handbook asks Mari to keep a stylesheet small on a small limit instead, and a cut one is caught by #8090's recovery. We'll open a new issue for the Engine action if live runs show themes still getting cut.

🤖 Closed with Claude Code

<!-- gh-comment-id:6348795479 --> @ylli-selmani commented on GitHub (Oct 22, 2026): Done on staging in two parts: - #8090: providers keep reporting `length` for a cut tool call, and the pi runtime recovers with an engine note (up to 2 times per run). - #8100: a short up-front hint when Max Output Tokens is 4096 or less (both the pi and the classic prompt), and a "split big writes" line in the six built-in handbooks. Not done: a partial-CSS Engine action for themes. #8100 checked that `theme.update` replaces the whole stylesheet, so the themes handbook asks Mari to keep a stylesheet small on a small limit instead, and a cut one is caught by #8090's recovery. We'll open a new issue for the Engine action if live runs show themes still getting cut. _🤖 Closed with [Claude Code](https://claude.com/claude-code)_
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#7560
No description provided.