mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #417] [Issue]: Context trimming not applied when preset has useMaxContext: false (v1.5.7) #175
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#175
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 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/417
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Context trimming is not applied when a preset has
useMaxContext: falsewith a manually-set Max Context Window value. Long chats grow unbounded past the configured limit and responses get cut off mid-sentence, despite v1.5.7 changelog claiming this was fixed.Expected behavior
With Max Context Window set to 60000 in the preset, oversized prompts should be trimmed before generation so input stays at or below 60000 tokens. The v1.5.7 changelog states: "Connection max-context limits now trim oversized prompts before generation, and prompt inspection shows the fitted prompt that was actually sent upstream."
Actual behavior
The full message history is sent upstream with no trimming applied. Input climbs past 57000 tokens and grows ~500 per response. The model's reply gets cut off mid-sentence. Manually deleting older messages works temporarily until context climbs back up.
Steps to reproduce
useMaxContext: false) — e.g. 60000 tokens.Environment
Logs, screenshots, or video
Reproduced with both Gemma 4 and DeepSeek — both stop the same way, ruling out a content filter.
Setup details:
Additional context
Suspected cause (from a Discord investigation by Luka — please verify against current source, line numbers not confirmed):
In the dry-run preset assembly path,
effectiveMaxContextis only set whenuseMaxContextis true:When the preset's Max Context Window is set manually with
useMaxContext: false,presetMaxContextisundefined, so the trimmer has no ceiling to enforce.Suggested fix:
Worth checking the regular
/generateroute for the same pattern — if it has the same conditional, patching dry-run alone will only fix prompt previews, not actual generation.Workaround: Setting
useMaxContext: truein the preset and letting the connection's Max Context Window drive the trim restores expected behavior.Originally reported on Discord by user AKEF; this issue is being filed on their behalf.
Template check
@SpicyMarinara commented on GitHub (May 5, 2026):
Fixed.