Repository navigation
Conversation
Greptile SummaryThis PR fixes two related bugs in the Control UI chat model picker: (1) raw Changes:
Minor observations:
Confidence Score: 4/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a11091ece
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5e9b6918f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbdd12dcc2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const overrideResolution = resolveChatModelOverride( | ||
| createChatModelOverride(trimmedModel), | ||
| trimmedProvider ? { kind: "raw", value: trimmedModel } : createChatModelOverride(trimmedModel), |
There was a problem hiding this comment.
Preserve qualified model when provider is stale
Forcing trimmedModel through { kind: "raw" } whenever modelProvider is present regresses qualified values when the provider is stale or mismatched. Fresh evidence: even with the new guard on lines 109-113, resolvePreferredServerChatModel("openai/gpt-5-mini", "zai", catalog) now falls through to resolveServerChatModelValue and returns zai/openai/gpt-5-mini instead of preserving the already-qualified model. This can surface invalid picker/default values after refresh for sessions that carry a qualified model string plus an outdated modelProvider.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 928551fdd2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (trimmedProvider) { | ||
| return { | ||
| value: resolveServerChatModelValue(trimmedModel, trimmedProvider), | ||
| source: trimmedModel.toLowerCase().startsWith(`${trimmedProvider.toLowerCase()}/`) |
There was a problem hiding this comment.
Preserve qualified model when provider is stale
When modelProvider is present, this branch always trusts it and skips catalog/qualified resolution, so a stale provider can corrupt already-qualified model refs. For example, resolvePreferredServerChatModel("openai/gpt-5-mini", "zai", catalog) now flows through resolveServerChatModelValue and yields zai/openai/gpt-5-mini instead of preserving openai/gpt-5-mini. That can surface invalid picker/default values after refresh and propagate a provider/model pair the backend does not recognize.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 884ca6346c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (storedProviderOverride) { | ||
| const providerPrefix = `${storedProviderOverride.toLowerCase()}/`; | ||
| const normalizedModel = storedModelOverride.toLowerCase().startsWith(providerPrefix) | ||
| ? storedModelOverride.slice(storedProviderOverride.length + 1).trim() || storedModelOverride | ||
| : storedModelOverride; |
There was a problem hiding this comment.
Keep parsing overrides when providerOverride is present
This new early-return path skips parseModelRef whenever providerOverride exists, so stored overrides no longer get provider-specific normalization/canonicalization. In practice, legacy rows like providerOverride: "openrouter", modelOverride: "claude-sonnet-4-6" (or stale qualified values with a mismatched provider) now resolve to raw, potentially invalid provider/model pairs instead of the normalized ref that pre-change code produced. Because resolveSessionModelRef is used by runtime session resolution paths, this can surface wrong model refs for existing sessions after upgrade.
Useful? React with 👍 / 👎.
|
Superseded by #61382. Closing this one to keep review on the cleaner replacement PR. |


Summary
namevalues frommodels.listand can restore slash-containing model ids against the wrong provider whenmodelProvideris already present separately.model-id · providerlabels instead of readable names, and models likenvidia/moonshotai/kimi-k2.5can jump to the wrong provider after refresh.name, slash-containing model ids remain provider-qualified on restore, and duplicate friendly names are disambiguated with· provider.aliassupport fromagents.defaults.models, and it does not change the backend model catalog payload.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
modelstrings as already qualified even whenmodelProviderwas provided separately.git blame, prior PR, issue, or refactor if known): reported in Bug: Control UI Model Display and Selection Issues #58835 against the built-in Control UI; the gateway already exposednameinmodels.list, but the chat picker path did not use it.namedata for the reproduced cases; the issue is in Control UI rendering and restore logic.Regression Test Plan (if applicable)
ui/src/ui/chat-model-ref.test.tsui/src/ui/chat-model-select-state.test.tsname· providerUser-visible / Behavior Changes
models.list.· providerto keep them distinct.Diagram (if applicable)
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation: N/ARepro + Verification
Environment
main, built-in Control UInvidia/moonshotai/kimi-k2.5and other catalog-backed modelsid,name, andproviderSteps
Expected
Actual
model-id · providerlabels.Evidence
Attach at least one:
Human Verification (required)
aliassupport fromagents.defaults.modelsReview Conversations
Compatibility / Migration
Yes)No)No)Risks and Mitigations
· provideronly when duplicate visible names exist in the catalog.namedisplay and provider-qualified persistence.