mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2288] [Issue]: useMaxContext flag is never honored, so prompt fitting and memory recall always use the manual maxContext instead of the model's real window #1125
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#1125
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 @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2288
Originally assigned to: @Xelvanis on GitHub.
Summary
When a preset has useMaxContext enabled (it is true in the shipped default preset), the refactor still trims the prompt and sizes memory recall against the raw manual maxContext (default 128000) and never resolves the model's real context window. Main resolves the known model window and folds it into the effective budget.
Expected behavior
With useMaxContext on, the engine should resolve the model's real context window and use it for prompt context fitting and recall budget sizing, matching main.
Actual behavior
fitMessagesToContextWindowreads onlyparameters.maxContextwith no useMaxContext branch, and recall packing reads only the raw connection maxContext. The flag is consumed by no engine code, so a model with a larger window keeps the 128000 value and a model with a smaller real window is over-budgeted, risking provider truncation or 400s. Section trim priority (history dropped first) is otherwise preserved.Steps to reproduce
Impact area
Regression notes
Worked on main. Main resolves
findKnownModel(provider, model)?.contextintoknownModelContextand folds it intoeffectiveMaxContext(packages/server/src/routes/generate.routes.ts:2242-2244,2534-2537,3818-3819), which drives fitting (:7169/7441/7589/7643) and recall budget (:5053). The refactor'sfitMessagesToContextWindowreads rawparameters.maxContext(src/engine/generation/context-window.ts:64-72) and recall reads rawconnection.maxContext(prompt-assembly.ts:2897). Grepping src + src-tauri + crates, useMaxContext exists only as a type/schema/default/passthrough (prompt.ts:188,prompt.schema.ts:53,defaults.ts:29,generate-route-utils.ts:268) with zero reads driving sizing;MODEL_LISTS/KnownModel.contextare wired only to the connection editor, never the fitter. The default preset shipsuseMaxContext:true(src-tauri/resources/default-data/db/default-preset.json:14).Environment
5ddb9840(compared against main @b4ab97f)Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: