fix(models): resolve provider-qualified aliases#100209
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 9:43 AM ET / 13:43 UTC. Summary PR surface: Source -12, Tests +115. Total +103 across 5 files. Reproducibility: yes. Source inspection shows current main routes sessions.patch model updates through the shared resolver, which only checks the whole provider/Alias string against bare aliases before direct provider/model parsing. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the shared resolver fix after maintainer acceptance of provider-scoped alias precedence and required exact-head checks/proof remain green. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main routes sessions.patch model updates through the shared resolver, which only checks the whole provider/Alias string against bare aliases before direct provider/model parsing. Is this the best way to solve the issue? Yes. The shared resolver is the right layer because sessions.patch, model commands, and other model-selection surfaces already depend on it; a UI-only or provider-fallback fix would be too narrow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4c42815348ae. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -12, Tests +115. Total +103 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecb2b524bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ### Fixes | ||
|
|
||
| - **Model aliases:** resolve provider-qualified aliases during session and chat-command model switches without collisions when providers share a display alias. Thanks @sahilsatralkar. |
There was a problem hiding this comment.
Remove normal-fix changelog entry
For this non-release model fix, the root AGENTS.md says CHANGELOG.md is release-only and release generation owns it; adding this entry directly can leave stale release-note content/credits or create avoidable release conflicts. Please keep the release-note context in the commit/PR body and leave CHANGELOG.md unchanged here.
Useful? React with 👍 / 👎.
|
Land-ready proof for synchronized head
The rewrite keeps one shared resolver for session patches and chat directives, handles duplicate display aliases within provider scope, and preserves existing bare-alias behavior. The required changelog entry and contributor credit are being aggregated into the final maintainer changelog commit on #91002, avoiding repeated runtime-CI invalidation from unrelated |
6bb0db5 to
719a7c2
Compare
719a7c2 to
bae5d0f
Compare
Co-authored-by: Sahil Satralkar <62758655+sahilsatralkar@users.noreply.github.com>
7a5cfa6 to
196edd6
Compare
|
Merged via squash.
|
* fix(models): resolve provider-qualified aliases Co-authored-by: Sahil Satralkar <62758655+sahilsatralkar@users.noreply.github.com> * docs(changelog): defer TUI batch entries --------- Co-authored-by: Sahil Satralkar <62758655+sahilsatralkar@users.noreply.github.com>
Closes #75163
Reworks the useful direction from #75198 on current
main, with provider-scoped duplicate handling and contributor credit preserved.What Problem This Solves
Fixes an issue where users switching an existing Control UI or TUI session to a provider-qualified display alias such as
lmstudio-moe/MoEwould persistMoEas the model id. Local providers then rejected the next turn because the display alias was not their canonical model identifier.Why This Change Was Made
The shared model resolver now indexes aliases by provider as well as by bare display name, so
provider/Aliasresolves without colliding when two providers use the same alias. Chat-command model selection now delegates to that same resolver instead of maintaining a second parser.User Impact
Mid-session model switches from Control UI, TUI, and model commands now persist the canonical provider/model reference. Existing bare-alias behavior remains unchanged.
Evidence
node scripts/run-vitest.mjs src/agents/model-selection.test.ts— 121 tests passed.node scripts/run-vitest.mjs src/gateway/sessions-patch.test.ts— 228 tests passed across the routed Gateway shards.node scripts/run-vitest.mjs src/auto-reply/reply/model-selection-directive.test.ts— focused chat-command regression passed.tbx_01kwrjhsjn8geh91q5w6rnh5j3:pnpm check:changedpassed, including core and test typechecks, changed-file lint, guards, and import-cycle checks./model local-a/Localrenderedmodel set to local-a/model-a;sessions.listconfirmedmodelProvider=local-a,model=model-a.tui --local: the same command rendered and persistedlocal-a/model-a..agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output— clean, no accepted/actionable findings.