You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(native-chat): preserve models missing from provider listings - #35266
A chat could switch models after Claude rejected its saved choice, and discovery could delete the remembered Grok/OMP model when a refreshed list omitted it.
Claude now keeps the chosen model after a model-not-found response and shows one failed-turn notice. Repeated sends keep that choice; explicitly picking another model allows the next send. Discovery refreshes update menus without deleting remembered preferences. New chats display the literal saved model ID when the host inventory does not name it, including IDs that collide with built-in labels.
ACP model errors retain the existing generic provider-rejection display and actual diagnostic. Authentication, temporary errors and lost sessions retain their own failure cause. Existing clients can classify and acknowledge the failed request, and the desktop keeps its localized error lead. Terminal launches continue passing the remembered model flag and displaying the CLI's own output.
The legacy clear-model-if-missing request remains valid and is ignored by an upgraded owning host. Older owning hosts retain their own behavior. No saved field, settings migration, new refusal gate or new RPC was added.
Based on main after #31927 landed. tracked in STA-10947; tracked in STA-11527.
Plan and review path
Full path: this changes provider-error recovery and settings/read consumers across client versions. Remove observation-driven model writes and reuse the existing failure, explicit-pick and settings mechanisms. Two correctness review rounds are complete with no open findings. Final reference, performance and readiness reviews pass; real Claude/Codex upgrade and recovery QA passed.
Common pattern and compatibility
Provider rejection remains an error and does not change the chosen model. Refreshing a model menu does not delete a remembered preference.
Intended: keep the old clearing request as a host no-op and keep ACP's generic failure representation so released clients retain error text, latest status and read acknowledgement.
Intended: the remembered choice remains effective even when the advertised list suggests a default. The provider decides whether the chosen ID works; replacement always requires an explicit pick.
Intended: terminal output remains owned by the CLI; the existing model picker saves explicit picks for later launches.
Validation
Targeted host/runtime, translator, settings, desktop-hook, shared-status and notification-read tests passed. Review fixes cover optional assistant/result correlation metadata, authentication/internal/lost-session ACP errors, current rejection classification and old-client read acknowledgement. The normal pre-commit hooks passed.
Recorded fixtures and provider-source response shapes cover model refusals. The original unit replay combines a captured assistant frame with a recorded result envelope. QA also captured a separate real Claude assistant/result pair for the same invalid ID; native UI error/recovery was exercised independently.
CI is green on merged head6860e68a, including all five root test shards, typecheck/static checks, mobile verification, cross-version wire contracts, packages and persistence. CI executed the mobile omission/pick hook tests; no local dependency install was needed. The required production UUID-list operation contract runs at64/640 inputs and checks bounded work and cleanup.
The one main sync preserves the reviewed model mechanism and incoming startup changes; eight named files passed109 tests plus one paired-settings compatibility case. On the admitted M4Air, previous-main-created chats survived a graceful upgrade. Claude rejected the saved invalid ID twice without changing it, then returned two real replies after an explicit valid pick. Codex returned two real replies on its original restored thread, retaining its selected model. Its first hung request was a QA transport configuration issue reproduced outside Orca; enabling WebSocket support in the isolated provider config repaired it. Passed Claude flows were not rerun. Whole-window main/branch, recovery, Codex and unlisted-picker screenshots are in the review comment.
Deferred cosmetic P2: if Claude provides no model ID, Chinese notices contain the English fallback “this model.” No delivery, selection or recovery behavior is affected. The picker screenshot uses a disclosed unlisted saved-model fixture; provider responses and successful replies are real.
The PR preserves saved models when provider listings omit them and stops Claude from silently switching after a model error.
Saved model choices stay in place when provider lists leave them out.
Claude keeps the chosen model after a model-not-found reply.
ACP option failures keep their provider details in the existing rejection flow.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Saved model choice] --> B[Launch or send]
B --> C{Provider accepts?}
C -->|Yes| D[Run turn]
C -->|No| E[Show failure]
E --> F[Keep saved choice]
F --> B
F --> G[User picks another model]
G --> B
H[Refresh model listing] --> I[Update menu]
I --> F
The changes keep saved model selections when discovery omits them and remove automatic settings writes that cleared those selections. Structured option views and launch requests retain literal model IDs. Unavailable-model rejections gain a failure kind, user-facing wording, and updated submission and attention projections. Claude session state removes launched- and retired-model tracking, while Claude journaling adds model-not-found failure handling and result deduplication.
Priority: Normal
Merge Risk: Low · up to 6860e
Legacy Fast selection can use the default tier, and launch-only models can widen shared catalogs. Translated errors may also contain English fallback text. These bounded issues merit owner awareness before merge.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: preserving models that are missing from provider listings.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description provides a clear summary, rationale, compatibility details, testing evidence, visual-proof references, deferred work, and linked issue identifiers. It does not reproduce the template h…
Full details: Description check
Explanation
The description provides a clear summary, rationale, compatibility details, testing evidence, visual-proof references, deferred work, and linked issue identifiers. It does not reproduce the template headings or checklist, and the issue identifiers are not explicit links, but the substantive information is mostly complete.
Full details: Docstring Coverage
Explanation
Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 25 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
206-209: Trivial · Data Integrity & Integration · Low value
Remove the obsolete launchOnlyModelId fields and comments.
The live-listing path now intentionally saves all listing.models. The changed ACP test expects a newly reported model to enter the saved catalog. No repository code produces or consumes launchOnlyModelId, so the remaining fields describe a filter that no longer exists.
🧹 Remove the obsolete fields
configured?: { model?: string; effort?: string }
- /** Launch-injected rows require independent account-catalog membership. */- launchOnlyModelId?: string
/** Successful model listings can still report that chats cannot start. */
unavailable?: AgentSessionUnavailable
}
@@
models: AgentSessionModelOption[]
fastModeSupport?: AgentSessionFastModeSupport
- /** Launch-injected rows require independent account-catalog membership. */- launchOnlyModelId?: string
/** null invalidates a stale default; absent means the session cannot resolve one. */
configuredDefault?: AgentModelCatalogConfiguredChoice | null
}
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1c046150-0ac7-464b-afa6-863a55b0596b
Commits
Reviewing files that changed from the base of the PR and between 78ad9f4 and 5481d96.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Files skipped from review as they are similar to previous changes: 5
src/renderer/src/i18n/en-runtime-required.json
src/shared/agent-session-failure-copy.ts
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/zh-Hant.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
A chat could silently change models after Claude rejected its saved choice, while refreshed provider lists could delete remembered defaults. The chat now keeps the chosen model until the user explicitly picks another. Claude shows one failed-turn notice; an unlisted model stays visible by its literal ID.
The full review completed in two correctness rounds. Fixes preserve actual ACP authentication/internal/lost-session causes, correlate Claude assistant/result failures with optional IDs, and preserve current and released-client failed-request/read acknowledgement. Fresh architecture, reference, performance and final readiness reviews found no open P0/P1. Intended: the explicit choice stays effective even if inventory suggests a different default; provider acceptance decides whether it works. Existing clearing requests remain accepted as a no-op on upgraded hosts; older owning hosts retain their own behavior.
Verified on 6860e68a5e60638dc474ef009ade3cf70fbebcd6:
CI and mobile verification are green, including all five root test shards, static/type checks, cross-version contracts and packaging. The mobile omission/pick hook actually ran; the UUID-list contract checks production work at64/640 inputs. The one main merge preserves the reviewed mechanism and incoming startup changes.
Previous-main-created chats survived a graceful upgrade on the admitted M4Air. Claude failed twice while retaining the invalid model, then returned two real replies after an explicit Sonnet pick. Codex returned two real replies on its original restored thread, retaining GPT-6.1-Sol. Its first hung request also reproduced outside Orca; enabling WebSocket support in the isolated QA provider config repaired it. The interrupted attempt and separate CLI diagnostic reply are excluded from the two successful UI replies. Passed Claude flows were not rerun.
ACP classification uses provider-source-shaped fixtures and old-reader/notification contracts; no live Grok/OMP model rejection is claimed. A separate real Claude CLI request captured the actual assistant/result pair; the native UI runs independently proved the error and recovery. The unlisted picker uses a disclosed saved-model fixture. All owned copies/probes stopped and the QA lease was released.
Deferred cosmetic P2: when Claude supplies no known model ID, Chinese notices contain the English fallback “this model.” Model choice, delivery and recovery are unaffected. No other unresolved finding remains.
For Brennan's review
Same rejected saved model on main and the branch:
Main: changes current model to Opus
Branch: keeps the chosen ID after both attempts
Explicit recovery, with two real Claude replies:
Restored Codex thread, with two real shipping-composer replies:
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
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.
A chat could switch models after Claude rejected its saved choice, and discovery could delete the remembered Grok/OMP model when a refreshed list omitted it.
Claude now keeps the chosen model after a model-not-found response and shows one failed-turn notice. Repeated sends keep that choice; explicitly picking another model allows the next send. Discovery refreshes update menus without deleting remembered preferences. New chats display the literal saved model ID when the host inventory does not name it, including IDs that collide with built-in labels.
ACP model errors retain the existing generic provider-rejection display and actual diagnostic. Authentication, temporary errors and lost sessions retain their own failure cause. Existing clients can classify and acknowledge the failed request, and the desktop keeps its localized error lead. Terminal launches continue passing the remembered model flag and displaying the CLI's own output.
The legacy clear-model-if-missing request remains valid and is ignored by an upgraded owning host. Older owning hosts retain their own behavior. No saved field, settings migration, new refusal gate or new RPC was added.
Based on main after #31927 landed. tracked in STA-10947; tracked in STA-11527.
Plan and review path
Full path: this changes provider-error recovery and settings/read consumers across client versions. Remove observation-driven model writes and reuse the existing failure, explicit-pick and settings mechanisms. Two correctness review rounds are complete with no open findings. Final reference, performance and readiness reviews pass; real Claude/Codex upgrade and recovery QA passed.
Common pattern and compatibility
Validation
Targeted host/runtime, translator, settings, desktop-hook, shared-status and notification-read tests passed. Review fixes cover optional assistant/result correlation metadata, authentication/internal/lost-session ACP errors, current rejection classification and old-client read acknowledgement. The normal pre-commit hooks passed.
Recorded fixtures and provider-source response shapes cover model refusals. The original unit replay combines a captured assistant frame with a recorded result envelope. QA also captured a separate real Claude assistant/result pair for the same invalid ID; native UI error/recovery was exercised independently.
CI is green on merged head6860e68a, including all five root test shards, typecheck/static checks, mobile verification, cross-version wire contracts, packages and persistence. CI executed the mobile omission/pick hook tests; no local dependency install was needed. The required production UUID-list operation contract runs at64/640 inputs and checks bounded work and cleanup.
The one main sync preserves the reviewed model mechanism and incoming startup changes; eight named files passed109 tests plus one paired-settings compatibility case. On the admitted M4Air, previous-main-created chats survived a graceful upgrade. Claude rejected the saved invalid ID twice without changing it, then returned two real replies after an explicit valid pick. Codex returned two real replies on its original restored thread, retaining its selected model. Its first hung request was a QA transport configuration issue reproduced outside Orca; enabling WebSocket support in the isolated provider config repaired it. Passed Claude flows were not rerun. Whole-window main/branch, recovery, Codex and unlisted-picker screenshots are in the review comment.
Deferred cosmetic P2: if Claude provides no model ID, Chinese notices contain the English fallback “this model.” No delivery, selection or recovery behavior is affected. The picker screenshot uses a disclosed unlisted saved-model fixture; provider responses and successful replies are real.