Skip to content

fix(native-chat): the account's model list follows the newest agent process, not the last answer - #30042

Closed
brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/claude-catalog-producer-order
Closed

brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/claude-catalog-producer-order

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​124 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​105
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​202 $\color{#cf222e}{\Huge{\mathbf{−}}}$​92 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​110

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:

  • A late answer from a chat's startup could overwrite a newer chat's list.
  • An old Codex app-server could re-list over a newer check.
  • The account's configured default could name a model the list no longer had, so no row was marked default.
  • For OMP, which reports effort choices only for its current model, choices learned for one model could vanish.

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.

  • New and stopped chats show the models of the newest agent process for the account: the newest ranked chat process or background check, with the fallback rules below.
  • An older running chat can still add effort choices that are missing, but never replaces the list, its order or its default.
  • A configured default marks a model only when the list actually has it.
  • A model’s learned effort menu survives later answers that omit that menu; a nonempty report replaces it.

How it works.

  • Each observed list, and the configured default, carries in memory when its producing process started (the start time Orca already records for each chat's process). That decides precedence. The actual discovery receipt still decides freshness. After restart, the saved live timestamp preserves which source led, so a restored catalog's fetched time can be normalized; clients do not use it to order or expire catalogs.
  • Background checks rank by when they were requested. A process whose start time can't be read, and lists loaded from disk after a restart, rank oldest, with ties falling back to arrival order. The relative winner of saved sources survives restart. There is no new saved field or wire shape.
  • A running chat's options read saves its list inside the same step that read the agent process, so a newer process taking over can't be credited with an older one's list.
  • Codex passes its app-server's start time, and its separate arrival-order check is removed.

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

Flow Main Final branch
New Claude picker Main: New Claude picker Final branch: New Claude picker
Later second Claude Main: Later second Claude Final branch: Later second Claude
Claude Stop/reopen Main: Claude Stop/reopen Final branch: Claude Stop/reopen
Learned OMP Flash menu Main: Learned OMP Flash menu Final branch: Learned OMP Flash menu
OMP Stop/reopen Main: OMP Stop/reopen Final branch: OMP Stop/reopen
Codex picker Main: Codex picker Final branch: Codex picker
Codex chosen model after reopen Main: Codex chosen model after reopen Final branch: Codex chosen model after reopen
Grok blocked Main: Grok blocked Final branch: Grok blocked

Real Electron QA ran on the M4Air. Main was c3f52428; the comparison branch was a8a99bee, followed by a rebuilt final 554ceed9 with a type-only correction. Every final image above comes from 554ceed9. 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

  • One test of the whole rule: an older chat's later read can't replace a newer start's list or default but fills a missing effort choice; OMP-style current-model-only choices survive; a late older default doesn't win; a configured default the list lacks isn't marked or reported.
  • Updated tests that pinned arrival order.
  • Regression coverage also exercises saved-source authority across restart and unchanged-facts winner changes, plus a newer affirmative live default while preserving agents whose live rows name none.
  • Full PR workflow passed on final head 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.
  • No local standalone static analysis, installs, Electron builds or full-suite tests were run on the shared Mac; normal staged hooks ran on the remote worker.

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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • Static analysis, typecheck, tests and packaging passed in the full PR workflow on the final head

Author: Brennan Benson (@BrennanKB5)

…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.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d7cbcf7-5e9f-48d1-9e37-928898b58361
📥 Commits

Reviewing files that changed from the base of the PR and between a8a99be and 554ceed.

📒 Files selected for processing: 1
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-persistence.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.

📝 Walkthrough

Catalog listings now use producer process start times to determine precedence, with receipt time breaking ties. Configured-default updates also carry chat start times. Older listings can supply missing effort menus, while configured defaults apply only when the selected listing contains the configured model. The store and Codex acquisition paths pass producer start times. Persistence assigns loaded listings a zero start time and omits start times when saving. Structured option reads save live listings through a shared helper.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 554ce

No actionable merge-blocking issue remains in the reviewed changes; the investigated persistence concern does not change the catalog winner after restart.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 64.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: account model-list precedence now follows the newest agent process instead of the last answer.
Description check Passed The description is complete and directly addresses the required sections. It explains the user impact, implementation, rationale, issue tracking, visual proof, testing, review, compatibility considera…
Full details: Description check

Explanation

The description is complete and directly addresses the required sections. It explains the user impact, implementation, rationale, issue tracking, visual proof, testing, review, compatibility considerations, and checklist status.

  • Fix all pre-merge checks with AI
✨ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6887e5df-9207-4b9c-b4ab-7c432c540aac
📥 Commits

Reviewing files that changed from the base of the PR and between 669b829 and a8a99be.

📒 Files selected for processing: 3
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-persistence.ts
  • src/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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

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 c3f52428, comparison branch a8a99bee, and final rebuild 554ceed9 (the final delta was type-only).

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

Flow Main Final branch
New Claude picker Main: New Claude picker Final branch: New Claude picker
Later second Claude Main: Later second Claude Final branch: Later second Claude
Claude Stop/reopen Main: Claude Stop/reopen Final branch: Claude Stop/reopen
Learned OMP Flash menu Main: Learned OMP Flash menu Final branch: Learned OMP Flash menu
OMP Stop/reopen Main: OMP Stop/reopen Final branch: OMP Stop/reopen
Codex picker Main: Codex picker Final branch: Codex picker
Codex chosen model after reopen Main: Codex chosen model after reopen Final branch: Codex chosen model after reopen
Grok blocked Main: Grok blocked Final branch: Grok blocked

Real Electron QA ran on the M4Air. Main was c3f52428; the comparison branch was a8a99bee, followed by a rebuilt final 554ceed9 with a type-only correction. Every final image above comes from 554ceed9. 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.

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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing: superseded by #30107, where host discovery is the only writer of the model list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant