mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2419] [MERGED] generation: honor model context window #5597
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#5597
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/2419
Author: @Xelvanis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Xelvanis
Base:
refactor← Head:fix/use-max-context-window📝 Commits (2)
7a9407cgeneration: honor model context window9e27a14generation: cover context window precedence📊 Changes
4 files changed (+104 additions, -6 deletions)
View changed files
➕
src/engine/generation/context-window.test.ts(+50 -0)📝
src/engine/generation/context-window.ts(+49 -3)📝
src/engine/generation/prompt-assembly.ts(+3 -1)📝
src/engine/generation/start-generation.ts(+2 -2)📄 Description
Linked issue
Closes #2288
Why this change
useMaxContextenabled still sized prompt fitting and memory recall against the manualmaxContext, so known models with different context windows could be under-budgeted or over-budgeted.What changed
connection.maxContext.Refactor impact
Primary owner:
engine generation
Impact areas reviewed:
origin/maincontext-window parity foruseMaxContextand smallest-limit clamping.Boundary notes:
Pressure points touched:
ModeSurface,GameSurface, shared mode UI, command registration, and import modules were not touched.Validation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
jitiharness verified effective context selection for known model, manual max context, connection clamping, unknown model fallback, and prompt-trim behavior.pnpm test -- src/engine/generation/context-window.test.tspnpm typecheckpnpm check:architecturepnpm checkDurable test rationale:
effectiveMaxContextnow controls both prompt trimming and memory recall sizing foruseMaxContext.Feature Discoverability
Check exactly one:
src/features/shell/discovery/because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.Reason:
useMaxContextbehavior; no new user-discoverable surface.Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
No UI evidence. This change affects engine prompt sizing, not visible UI layout.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.