mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3040] [Issue]: Editing the model ID by typing silently wipes the user's Max Output Tokens Override #1608
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#1608
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 @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3040
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
In the connection editor, every keystroke in any free-text model input resets the separate "Max Output Tokens Override" field to null. A user who deliberately set an output cap (the field's own help text gives the example "DeepSeek caps at 8192") and then edits the model ID by typing — fixing a typo or appending a suffix in the always-visible "Or type model ID directly…" box — silently loses that override. On save the payload sends
maxTokensOverride: null, so the per-connection hard cap is gone, and later requests to a provider that enforces a lower limit get an oversizedmax_tokensand are rejected or truncated. The override field visibly flips to "No override"/0, but a user focused on the model box is unlikely to notice.How to reproduce (try it yourself)
You'll see: the Max Output Tokens Override field instantly resets to 0 / "No override" on the keystroke, and the connection persists
maxTokensOverride: null.Expected: typing in the model box leaves the user-set override untouched.
Where it is
packages/client/src/components/connections/ConnectionEditor.tsx:handleManualModelChange(lines 806-813) unconditionally callssetLocalMaxTokensOverride(null). It is wired to all three free-text model inputs (custom-provider input at 1391, empty-results fallback at 1442, always-visible manual input at 1489-1496). The override field is a separateDraftNumberInput(FieldGroup at 1653-1680). Save sendsmaxTokensOverrideat line 477. Legitimate override seeding lives inselectModel(line 798).What's happening
handleManualModelChangealways nullslocalMaxTokensOverrideon every model-text change. That reset is appropriate inselectModel(a list/remote pick carries its ownmaxOutput), but it is incorrectly coupled to manual typing in a field that is independent of the override control, so editing the model string clobbers an unrelated, user-set value.Suggested fix
Remove the unconditional override reset from
handleManualModelChange(lines 806-813):Leave the per-model override seeding where it belongs — in
selectModel(line 798), which only sets the override for remote list picks that legitimately carry amaxOutput. No regression:handleManualModelChangeis wired only to the three free-text model inputs, none of which is the override control; all other reset paths (init at 282, provider switch at 994, the override field's own onCommit at 1666) are untouched, and the save payload still sends whatever the user/seed set. The only behavior delta is that a remote-model-seeded cap now persists when the user then edits the model string by typing — which is correct, since the override is a visible field. The literal flag-gating alternative (track whether the override was auto-seeded) was rejected as unnecessary state for a rarely-hit edge the visible field already surfaces.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Claiming this for the current staging sweep in draft PR #3053 (branch
codex/issue-sweep-3033-3052).@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in PR #3053 on branch
codex/issue-sweep-3033-3052(commitbfb1bc76). Closing this issue as addressed; the PR remains open for staging review/merge.