mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1468] [Issue]: Professor Mari requests can exceed token limits from large context #727
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#727
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?
Originally created by @cha1latte on GitHub (May 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1468
Originally assigned to: @cha1latte on GitHub.
Summary
Professor Mari can run into token generation problems because some requests appear to include far too many tokens. The reporter suspects base64 or non-decompiled content may be getting loaded into the prompt/context.
Expected behavior
Professor Mari should keep request context within usable token limits and avoid including large raw/base64/generated content when answering codebase questions.
Actual behavior
Professor Mari runs into token generation problems on many requests due to excessive token usage.
Steps to reproduce
refactorversion withpnpm tauri dev.Impact area
Environment
refactorversionpnpm tauri devHardware reported: x86 laptop with NVIDIA GPU and Intel i7.
Logs, screenshots, or video
Not provided. Reported during manual Normal User First Pass by Muni.
Regression notes
Not specified.
Additional context
Source: Discord manual smoke-test report from MuniMuni during the Normal User First Pass.
Reporter note: likely cause may be loading base64 or failing to decompile/exclude large generated content properly.
Reporter also noted a fix is reportedly being worked on in
merge/prof-mari.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@cha1latte commented on GitHub (May 28, 2026):
Fixed in #1471.
The issue was that Professor Mari had unbounded context ingress from multiple paths: attachments could be injected into the task prompt verbatim, including raw image/base64 data, and code-search/read tooling could include generated output or encoded/binary-like source content. That meant large screenshots, generated artifacts, or wrapped encoded blobs could push Mari requests past provider token limits before the model ever saw the task.
The fix was architectural, not just a UI size patch. The Rust Professor Mari command/tool boundary now enforces the context contract: attachment count, metadata, per-attachment text, and total attachment text are bounded; image/binary-like attachments are represented without raw payloads; generated/cache directories such as graphify-out are skipped; encoded/binary-like source content is rejected; and wrapped base64-style payloads have a regression test. The UI also avoids sending raw image data and caps text reads, but that is defense-in-depth rather than the trusted enforcement point.
Verification included targeted Professor Mari Rust tests, full Rust workspace tests, clippy with warnings denied, pnpm check, pnpm build, Graphify refresh, proof gate, GitHub CI, and review-thread cleanup.