Repository navigation
fix(native-chat): the account's model list follows the newest agent process, not the last answer - #30042
fix(native-chat): the account's model list follows the newest agent process, not the last answer#30042brennanb2025 wants to merge 4 commits into
Conversation
…rocess, not the last answer Each saved listing had one clock, when Orca received it, and it decided both freshness and whose rows win. After an agent CLI updated, an older running chat's later read, a late start readback or an old Codex app-server could replace a newer start's list, and a configured default could name a model the list lacked. - Every listing and the configured default carry, in memory, when their producing process started; that decides precedence. An earlier-started producer may only fill effort menus still empty (session listings report the current model's only). - Probes rank by request time; unknown starts and listings loaded from disk rank oldest, ties falling back to arrival. Nothing new is persisted. - The configured default marks a row only when the winning list names it. - Live reads save inside the step that read the child, Codex's writers pass their app-server start, and Codex's arrival-order guard is gone. Tracked in STA-10951.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · 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:
6887e5df-9207-4b9c-b4ab-7c432c540aac
📒 Files selected for processing: 3
src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-persistence.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-store.test.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.
|
Older agent chats could replace the account model list after a newer agent had started, and OMP could lose effort choices learned for a different model. This PR makes new and stopped chats use the winning producer’s model list while older producers can fill missing effort choices. The full review found and corrected two related problems: restart could reverse the saved source winner, and stale discovery flags could override a newer Claude default. Agents whose live rows report no default retain discovery’s default on shared rows. A type-only CI correction also addressed the reported narrowing failure; its review thread is resolved. Verified: final-head full PR workflow, 39 targeted tests, source readiness review, and main-versus-branch real Electron QA on the M4Air with signed-in Claude, OMP and Codex. Claude new/later chats and Stop/reopen kept their lists and defaults; OMP retained both tested effort menus after restart and a later live read; Codex sends and model switches passed. All recorded QA processes exited and real config hashes matched. The actual tested baseline was Limits: Grok authentication was blocked in the isolated rig, so OMP covered the ACP flow; normal-account sign-in was not established. Real mixed CLI versions, Windows/Linux/SSH interruption, and unreadable process-start identities were reviewed in source rather than reproduced. Probe rank intentionally uses request time; delayed launch preparation can affect ordering until another newer listing. Empty effort reports retain learned choices, so a genuinely removed choice may remain until a nonempty report replaces it. Project-specific Claude default flags remain an unproven concern after one bounded trace. For Brennan’s review
Real Electron QA ran on the M4Air. Main was Grok authentication was blocked inside the isolated rig; this does not establish whether the normal Grok account is signed in. Real OMP covered the ACP flow. Real mixed CLI versions were not manufactured; ordering, unknown/equal starts and default edge cases were checked in source and regression tests. Claude’s main Stop/reopen check used the retained second chat; the branch used the retained first chat. All recorded QA processes exited and the real Claude/Codex config hashes were unchanged. The judgment points are producer precedence, saved source precedence, and probe request rank. These are intended differences from the common pattern, described in the PR body. |
|
Closing: superseded by #30107, where host discovery is the only writer of the model list. |
















ELI5
Orca keeps one saved list of models per account, which new and stopped chats show. Until now, whichever chat answered last could replace that list, even a chat still running an older Claude Code (or other agent) from before an update. Now the list follows the newest agent process: an older one that is still running can fill in missing details, but can't replace a newer one's models.
What Changed
The problem. After an agent CLI updates while older chats keep running (STA-10947 was one such case), the model list a new or stopped chat shows could come from the older CLI, and could flip back and forth as old and new chats read their options. Other effects:
Why. Each saved list had one timestamp, the time Orca received it, and it decided both how fresh the list is and whose list wins. Who should win is a fact about the process that produced the list, not when its answer arrived.
What you see now.
How it works.
Differences from the common pattern, labelled.
Intended: in the common pattern only a fresh probe process writes the account's list. Here, chat starts and running chats' reads also write it, ranked by process start. Orca needs this for agents with no usable probe (OMP), and for effort choices an agent reports only per running model.
Intended: effort choices learned from running chats are kept across lists from the same source; the common pattern opens one disposable discovery session and switches through its models. Orca learns OMP menus from running chats because its session-free model command does not respect the chat's enabled-model filter. A menu that genuinely disappears can remain among the last learned choices until a nonempty observation replaces it.
Intended: probes rank from request time. If launch-environment resolution delays a probe, a chat started during that delay can outrank its eventual answer until another newer listing, including a later eligible refresh after the ten-minute freshness threshold. Unknown starts and equal starts keep the stated arrival fallback.
Intended: saving preserves the winning source without another saved field by normalizing only the saved live timestamp relative to discovery. Discovery keeps its real receipt and freshness; restored live fetched time is ordering metadata.
Intended: a winning live listing supplies its default when it names one; otherwise discovery's default on shared rows survives. The configured-default membership join remains first.
Why
Ranking running producers by start and probes by request prevents earlier-ranked producers from replacing the chosen account list, without a saved version field. Alternatives considered: storing the CLI version with each list (a persisted field, and every agent would need to report a version), and removing running chats' saves (loses OMP's late lists and per-model effort choices).
Tracked in STA-10951. Follow-up to #30022 (STA-10947).
Visual Proof
Real Electron QA ran on the M4Air. Main was
c3f52428; the comparison branch wasa8a99bee, followed by a rebuilt final554ceed9with a type-only correction. Every final image above comes from554ceed9. Claude new/later chats and Stop/reopen, OMP model switching and learned menus across restart, and Codex model switching/pickers passed. Main loses Flash’s learned effort menu; the branch retains both tested menus after restart and a later live read. Main’s Flash screenshot shows the missing effort label with the picker closed; backing catalog data confirms its menu is absent.Grok authentication was blocked inside the isolated rig; this does not establish whether the normal Grok account is signed in. Real OMP covered the ACP flow. Real mixed CLI versions were not manufactured; ordering, unknown/equal starts and default edge cases were checked in source and regression tests. Claude’s main Stop/reopen check used the retained second chat; the branch used the retained first chat. All recorded QA processes exited and the real Claude/Codex config hashes were unchanged.
Testing
554ceed9733fb1ae9905579badc0512a94aef839: https://github.com/stablyai/orca/actions/runs/39024040779 (including static analysis/typecheck, all five test shards, cross-version compatibility and packaging). Four named regression test files also passed: 39 tests.Review
Full review path: this changes ordering, saved catalog behavior and chat lifecycle integration. Independent adversarial reviewers, an architecture challenger, a bounded design panel, and a fresh postdesign source/readiness review completed. Two catalog fixes and one type-only CI correction were applied in place. Final CI and QA results are recorded above. Probe request-time ordering and retention of ambiguous empty effort reports remain intended limitations. Workspace-specific Claude default influence was not reproduced after a bounded source trace.
Agent skill upstream boundary
Notes
SSH/remote: ranking stays on the execution host. No wire shape or persisted schema change; the saved live timestamp preserves relative source precedence as described above.
Checklist
N/Awith reasonAuthor: Brennan Benson (@BrennanKB5)