fix(model-routing): keep user-selected models strict - #5801
Merged
alteixeira20 merged 2 commits intoAug 12, 2026
Conversation
RaresKeY
marked this pull request as ready for review
July 28, 2026 16:56
alteixeira20
approved these changes
Aug 12, 2026
alteixeira20
left a comment
Collaborator
There was a problem hiding this comment.
Audited against current dev. The strict foreground routing boundary is appropriately scoped, preserves generic fallback transport, keeps legacy default_model_fallbacks inert for foreground Chat/Agent routing, and CI is green. Approved.
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This replaces #5632, which GitHub closed during the repository transfer and fork-network separation. The branch has been rebuilt on the current dev history; the implementation scope is unchanged.
Keep foreground Chat and every Agent tool-call round on the endpoint and model selected for the session. A shared foreground policy boundary now supplies the Chat candidate list and the Agent fallback slice, so both paths are strict by default instead of silently consulting the historical default-model list.
Existing nonempty
default_model_fallbacksvalues remain stored as legacy data for rollback and manual reference. They are not migrated, cleared during endpoint cleanup, inherited by Utility routing, used to choose a new default chat, or returned as candidates to background callers. The retired Settings editor is hidden, and ordinary default-model saves no longer rewrite those preserved values.The generic fallback transport remains available for workload-specific policies. This PR only changes which candidates are authorized; the explicit per-user replacement policy is tracked separately in #5626 and #5627.
Target branch
dev, notmain.Linked Issue
Fixes #4561
Part of #5625
Type of Change
Checklist
dev.How to Test
Run the focused and adjacent suite:
Expected result: 330 tests pass.
Run syntax checks:
Configure two model endpoints and retain a nonempty legacy default fallback list. Select the primary endpoint/model in a Chat session, make it fail before output, and verify the stream surfaces that failure without calling the legacy endpoint.
Repeat in Agent mode with a tool call followed by another model round. Verify every recorded request uses the selected endpoint/model and no fallback event is emitted.
Change the default endpoint/model in Settings and verify the preserved legacy list is not rewritten. Delete an endpoint referenced only by that legacy list and verify the stored data remains intact but has no routing effect.
The focused/adjacent suite passes 330 tests. Python compilation, JavaScript syntax, and diff checks pass. A full isolated run reached 4,671 passing tests and 5 skips; its 11 unrelated failures are contained in a 12-failure baseline set reproduced on clean current
origin/dev.Visual / UI changes — REQUIRED if you touched anything that renders
The obsolete Default Chat Model fallback editor is hidden so Settings no longer promises behavior that is intentionally disconnected. No new style, component, spacing, or mobile behavior is introduced.
Screenshots / clips
Pending browser verification. Expected result: the Default Chat Model card shows only Endpoint and Model controls; the legacy Fallbacks row is absent.