Repository navigation
fix(native-chat): a running Claude chat keeps its model when two Claude Code versions list differently - #30022
Conversation
…de Code versions list differently A send's stand-in for a model the list lacks took its rows and default from the chat's own answer but kept only rows the account's saved list names, and every running chat rewrote that list whatever CLI version it ran. After Claude Code 2.1.280 -> 2.1.302 the filter dropped the default row and sends moved to Sonnet. - The options answer names the ids its agent listed (listedModelIds); a live catalog is verified only by its own listing. An older host's answer may move only to the chat's own default row, and only where the host's list names it. - Only a session's start (and the probe) writes the account's list; later reads no longer do, so an older running CLI can't replace a newer start's list. Tracked in STA-10947.
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
85637f9f-d8c4-406a-9767-16112d391a10
📒 Files selected for processing: 12
mobile/src/session/use-mobile-structured-agent-session-send.test.tsxsrc/main/acp/acp-structured-host-live-listing.test.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-fingerprint.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-service.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-store.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.tssrc/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.tssrc/shared/agent-session-wire.tssrc/shared/structured-agent-session-model-catalog-application.test.tssrc/shared/structured-agent-session-option-view.test.tssrc/shared/structured-agent-session-option-view.tssrc/shared/structured-agent-session-options.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Preserve learned model menus on later reads and check launch-added model membership before saving. Tracked in STA-10947.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Do not report account catalog rows as this chat’s… · structured-agent-session-options-read.ts:128
src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts:128
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winDo not report account catalog rows as this chat’s verified listing.
When a stopped chat reads options after a probe or another chat updates its account catalog,
catalog.modelscontains merged account rows, not necessarily rows this chat listed.finishedListingIds(catalog)reports those rows aslistedModelIds. The client can then treat a newly discovered model as session-verified and select it instead of limiting the fallback to the chat’s own default. Persist listing IDs per session, or omitlistedModelIdsfrom at-rest answers when the chat’s own listing is unavailable. Seesrc/main/native-chat/agent-model-catalog/agent-model-catalog-entry.tsLines 146–183 andsrc/shared/structured-agent-session-option-view.tsLines 111–149.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3bdb7e79-e77d-42c3-9713-25973906d698
📒 Files selected for processing: 18
src/main/acp/acp-structured-host-live-listing.test.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-entry.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-fingerprint.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-prewarm.test.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-service.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-store.tssrc/main/native-chat/agent-session-wire/structured-agent-session-launch-permission.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.tssrc/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-provider-started-catalog.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-provider-started.tssrc/main/native-chat/agent-session-wire/structured-agent-session-start-listing.tssrc/main/native-chat/agent-session-wire/structured-agent-session-startup-attempt-host.test.tssrc/main/runtime/structured-agent-session-runtime-model-catalog-lifetime.test.tssrc/shared/agent-session-wire.tssrc/shared/structured-agent-session-option-view.test.ts
🚧 Files skipped from review as they are similar to previous changes: 2
- src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts
- src/main/native-chat/agent-model-catalog/agent-model-catalog-fingerprint.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Use the protocol schema for config options and supply the catalog row default flag. Tracked in STA-10947.
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts: 1
121-135: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert
listedModelIdson the live options result.The live read result is discarded at
structured-agent-session-options-read.test.ts:137. The following read is at rest and can rebuild IDs from the saved catalog, so the test passes if the live response omits or returns stalelistedModelIds.Suggested fix
record.options = { model: 'grok-4.6', effort: 'high' } live = true - await read() + const liveAnswer = await read() + expect(liveAnswer.listedModelIds).toEqual(reader.read().models.map(({ id }) => id)) live = false
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b4339578-28e3-4f1b-8cdf-123d572ba536
📒 Files selected for processing: 1
src/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
After Claude Code updated while older chats were still running, three chats switched from Opus to Sonnet on their next message. Orca filtered one process’s model rows using another process’s saved membership, which removed the default row. A current desktop or phone client now keeps a model that its own running process still lists, and chooses a replacement from that process’s own answer when the model is gone. Older hosts use the conservative own-default-only fallback. Older desktop or phone clients can still switch chats; updating only the host cannot repair their filtering logic. The review corrected lost live-read discovery of later model rows and effort menus, preserved the store’s existing rule for launch-only model rows, and repaired malformed older-host test fixtures. The normal commit hook also caught a file-length failure; moving an unchanged catalog-result function into the existing catalog-entry module resolved it without suppressing the check. Account catalog ordering and incremental snapshot retention remain temporary differences tracked in STA-10951. Canonical model identity is tracked in STA-10954. The PR body labels all seven differences from the common pattern. Opus 5.5 remains fixed at 1M under either alias. Final head Real signed-in Claude Code 2.1.302 passed all four Electron flows on the M4Air: new chat/two sends, same-profile app reopen/send, selecting Sonnet/two sends, and Stop/resume. The accepted sends and real Claude transcript confirm Opus, then Sonnet after the explicit pick, with the same result on main and branch. Main was built at The optional unlisted-alias transition was infeasible through the available picker, and Claude Code 2.1.280 was unavailable for a live mixed-version reproduction. Those cases use captured-listing regression tests rather than live QA. Phone, Windows and SSH runtime flows were source-reviewed rather than exercised on those devices. Normal interruption timing differed, and the branch reopen screenshot includes an unrelated notification-permission toast; no unexpected model change was observed. For Brennan’s review
Judgment points: the older-host fallback, the child’s listing and pre-save launch-only check, and account snapshots still replaced in receipt order, tracked in STA-10951. |








ELI5
After Claude Code updated, three running chats quietly switched from Opus to Sonnet on the next message. Orca combined the running chat’s model rows with another process’s saved list, removed the default row, and picked Sonnet. This change keeps a running chat’s model whenever its own Claude Code still offers it; when that model is gone, the send uses that chat’s own default.
What Changed
Claude Code 2.1.280 lists
opus[1m], while 2.1.302 listsopus. Chats on both versions ran together after the update. Orca previously took model rows and their default from the chat but filtered those rows using an account list that another process could replace. Filtering away Opus made the first remaining row, Sonnet, win.The options answer now includes an optional
listedModelIdsfield alongside its rows and default. A current client selects a substitute using those facts from one answer. For a running chat, they come from its own process; at rest, they come from the same saved catalog. Ordinary rows are preserved. A launch-only row counts only when the catalog store’s existing retention rule would keep it, checked before saving so a launch cannot verify itself.Live options reads continue saving newly learned model rows and menus through the existing non-failing wrapper. This preserves models learned after an empty startup and effort menus learned after a model change, including other agent providers, when the chat stops and reopens. Saving account discovery does not filter the running chat’s own rows.
Expected behavior stays: if the chat’s own Claude Code no longer offers
opus[1m], the next send can move toopus. Opus 5.5 has a fixed 1M context window under either alias.Mixed versions: a current desktop or phone client talking to an older host may substitute only the chat’s own default, and only when that host’s saved list also names it; it never chooses the first row. An older desktop or phone client still uses its old filtering logic and can still switch a chat. Updating the host alone cannot fix that client behavior. The new field is optional and result-only, so existing paired and SSH hosts remain supported.
Differences from the common pattern:
Why
The bug class is filtering one process’s listing with another process’s membership. Keeping rows, default and membership together removes that cross-filter while retaining account discovery needed for new and stopped chats. Restricting account saves to startup would lose models and effort menus learned later. Ordering discovery writes and canonicalizing identity are separate follow-ups rather than extra persisted fields in this fix.
Tracked in STA-10947.
Visual Proof
Real signed-in Claude Code 2.1.302 passed all four Electron flows on the M4Air: new chat/two sends, same-profile app reopen/send, selecting Sonnet/two sends, and Stop/resume. The accepted sends and real Claude transcript confirm Opus, then Sonnet after the explicit pick, with the same result on main and branch. Main was built at
fa962dd1cdec9e545fd3e4baf10fae3cfd9aa1df(before the later main sync); branch was built at the exact final head. Real config hashes were unchanged; all recorded test processes exited and the admitted ports are clear.The optional unlisted-alias transition was infeasible through the available picker, and Claude Code 2.1.280 was unavailable for a live mixed-version reproduction. Those cases use captured-listing regression tests rather than live QA. Phone, Windows and SSH runtime flows were source-reviewed rather than exercised on those devices. Normal interruption timing differed, and the branch reopen screenshot includes an unrelated notification-permission toast; no unexpected model change was observed.
Testing
4a10752bb824cd8cee4f6d323222e28293d5a66f, including its aggregate gate.Review
Full review path: saved catalog behavior, cross-version options and desktop/phone selection are in scope. Two review rounds found and corrected lost live-read discovery, overly broad launch-only exclusion and malformed fixtures. Final commit reconciliation and CI passed on
4a10752bb824cd8cee4f6d323222e28293d5a66f; branch QA passed on that same head. Account ordering and canonical identity remain explicitly tracked follow-ups.Agent skill upstream boundary
Notes
No persisted fields, new operation, UI notice or minimum host version. Folder workspaces remain supported. The options field and shared selection logic apply to desktop, phone and remote hosts.
Checklist
Author: Brennan Benson (@BrennanKB5)