mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2660] [Issue]: Switching a connection's provider keeps the previous model's max-tokens cap → responses silently truncated #1311
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#1311
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 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2660
Originally assigned to: @SpicyMarinara on GitHub.
Summary
When a user switches a connection's provider in the editor, the per-model max-tokens override from the previous provider's model is not reset, so it is saved and silently caps the new model's output length.
Expected behavior
Switching providers should reset model-specific state (including
localMaxTokensOverride), just as it resets model/baseUrl/apiKey, so the new provider/model isn't constrained by the old model's output cap.Actual behavior
The provider button handler clears model/baseUrl/apiKey but leaves
localMaxTokensOverride(auto-populated from the previous model'smaxOutput). On save, the stale override is persisted and the server enforces it as a hard cap (Math.min) on the new model's responses.How it breaks the pipeline
Code trace (staging @
b826f8f4):packages/client/src/components/connections/ConnectionEditor.tsx:876–893clearsmodel/baseUrl/apiKeybut notlocalMaxTokensOverride(norlocalDefaultParameters).localMaxTokensOverrideis auto-set from a remote model'smaxOutputinselectModel(~:700).:401:maxTokensOverride: localMaxTokensOverride ?? null).applyProviderMaxTokensOverride/capMaxTokens(Math.min), so e.g. a stale8192override truncates a new 128k-output model.connprop, which does not fire on an in-editor provider switch.Steps to reproduce
maxOutput= 8192 (this sets the override to 8192).Suggested fix
In the provider-switch handler, reset
localMaxTokensOverridetonull(and consider resettinglocalDefaultParameters) alongside the existing model/baseUrl/apiKey clearing.Environment
b826f8f4)Additional context
Identified via systematic source review on staging (refs @
b826f8f4). Symptom is "my replies keep getting cut short after I changed providers." Filed alongside related pipeline issues.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 20, 2026):
Implemented on branch codex/spicymarinara-assigned-issues: switching providers in the connection editor now resets stale model-specific max-token overrides and default parameters. Final validation will run after the full assigned sweep per maintainer request.