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(status-bar): show remote Codex account usage in account rows - #41540
When you open another Orca host from this desktop, Codex's account rows now show that host's percentages and reset times, alongside its upper quota card.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$233
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$233
Prod
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$185
$\color{#cf222e}{\Huge{\mathbf{−}}}$52
$\color{#1a7f37}{\Huge{\mathbf{+}}}$133
What Changed
Pass the existing owning-host observation from the status bar into the Codex switcher. Keep the account roster and active/inactive quotas from the same accounts.subscribe snapshot, so a host account switch updates names, selection and readings together. The existing owner fence also applies to that roster; the separate one-shot remote roster load is disabled. Local account loading retains the existing hook.
The remote menu follows the quota runtime published by its host. Runtime selection remains local-only: the existing runtime-target refresh operates through the viewer's preload API, and there is no supported owner-targeted quota-runtime RPC to call. The remote menu omits that control, and its handler rejects remote runtime changes. No wire method is added. Missing remote readings never fall back to the viewer cache, unverifiable inactive readings stay hidden, and pending switch/reset UI remains keyed by owner.
Why
The upper card already followed the execution host. The row controller read the viewer's local inactive cache and runtime target, while remote mode skipped the local preview fetch and hid the active row. The existing accounts stream already carries the needed remote data; the correction consumes that observation without adding another quota probe or wire method.
Real component fixtures, English, with synthetic paired-host accounts. Before uses unchanged main; after uses this branch, with separate fresh headless renderers. These are presentation captures, not physical paired-device acceptance.
After — light:
Before and dark theme
Before — light:
Before — dark:
After — dark:
Testing
I manually tested these changes locally on a physical paired client; pending. Headless component inspection is recorded below.
Automated tests added/updated.
Every added regression fails without the correction and checks rendered quota attribution.
Final head: ae79d29f517c8c84bd48af4630b0fae88b6bf8a2, tree 648a3cc4f0f9f48be4481a2c12fb1752816e61ec. Frozen PR base: fbec96cf29dc4c93ba442a1958f5ecb4000b1f1a; source/check merge base: 61a69df3a6df9fb997672577e162e96354abf9d6. The review correction is an ordinary forward commit from 450c082f848d6880e3297107a450ebd7cb120a40.
All 30 check:changed checks pass against the frozen PR base, including node/web types, related tests, lint, changed-code quality, formatting, localization and source/React ratchets. The required pre-push invocation confirms the same passing content after normal commit hooks.
Five focused rendered-menu regressions pass, plus the three existing owning-host stream cases. The initial three cover conflicting viewer runtime/account IDs, absent host readings and unverifiable ownership; their original reverted-code control is retained. Two review regressions reproduce the old code exactly: the previous account row displays 25% instead of its own 4% after a host switch, and a host with WSL accounts exposes the viewer-backed runtime selector. Both fail at 450c082f848d6880e3297107a450ebd7cb120a40 and pass with this correction. The stream case runs the real owner hook and account-list hook; it does not mock those hooks.
The published English before/after PNGs retain their initial 450c082 capture source and verification. Post-review cold headless renders of both pairedHost and pairedHostWithWsl pass in light and dark themes, without console errors. The existing image gallery remains intact; no physical paired-device acceptance is implied.
Normal managed commit hooks run. Installed Windows-to-Mac, Linux and physical-device acceptance remain pending; no live account was switched, signed in or reset during validation.
Risk
Level: Medium. A wrong owner or runtime could label one account with another host's quota. A single owner-fenced snapshot owns both roster and readings; missing remote rows cannot fall back to the viewer cache, and unverifiable-host rows do not show old percentages. Remote runtime controls cannot invoke the viewer's refresh action. Reverting these files restores the old switcher data source.
AI Disclosure
Implemented and checked with OpenAI Codex assistance.
Review
Self-review only. macOS, Linux and Windows use the same renderer path. Paired-host account identity, readings and the published WSL usage target come from the same observation; folder and Git workspaces keep the existing owner resolver. The remote runtime selector is intentionally unavailable until there is an owner-targeted API; local runtime selection is unchanged. Existing local-only sign-in and reset capabilities remain guarded. Mobile already consumes the host account snapshot and needs no wire change. Older hosts that omit per-account readings yield empty rows rather than viewer values.
Agent skill upstream boundary
Not applicable; no agent skill source, tests, registry or documentation is copied or modified.
Notes
This changes quota attribution in the desktop menu. The existing Used/Remaining display preference and account-row styling are independent. Upstream Actions await maintainer approval before running.
Checklist
This PR is small and focused
I explained what changed and why
I stated the risk and rollback
Before/after screenshots attached
Self-reviewed for correctness, security and performance
Cross-platform, SSH/remote and shortcut/path scope considered
Full lint, typecheck, test and application build pass; local selected checks pass, hosted CI awaits maintainer approval
One focused fix with a linked issue
Exact-base local checks and meaningful reverted-code regression control pass
English visual proof attached with explicit validation limits
Cross-platform, remote, WSL, mobile and folder-workspace scope considered
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The owner-usage hook now retains provider-account snapshots and returns the snapshot when it matches the current owner. The status bar passes owner usage and an owner-scoped key to the Codex switcher. The switcher uses remote account and quota data for an active remote runtime, and renders active usage from that data. The provider account list can disable loading and observation. New fixtures and tests cover paired-host quotas, account switching, unverifiable ownership, and WSL accounts.
Severity of issue fixed: Medium
Merge Risk: Moderate · up to f5ee4
When a paired host does not publish usage, the Codex account list for that host may come up empty, so the user cannot pick accounts. This should be fixed or confirmed before merge. The rest of the change preserves owner-scoped quota display and looks sound.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: remote Codex account usage now appears in the account rows of the status-bar switcher. The change set matches it: the owning-host accounts snapshot feeds the switcher…
Linked Issues check
[#41536] asks that the owning-host snapshot drive the upper card, active-account row, inactive-account rows, and runtime target, without viewer substitution. At head f5ee4a5, use-codex-switcher-contro…
Out of Scope Changes check
The changed files serve the #41536 data-source correction. use-codex-switcher-controller.ts and CodexSwitcherMenu.tsx carry the owner-scoped data path, activeUsage, and the remote runtime guard. Statu…
Description check
The description is thorough and follows the template. It has an ELI5, What Changed, Why, a linked issue (Fixes #41536), Visual Proof with before and after images, Testing, Risk with level and rollback…
Full details: Title check
Explanation
The title states the main change: remote Codex account usage now appears in the account rows of the status-bar switcher. The change set matches it: the owning-host accounts snapshot feeds the switcher's roster and quotas, and the remote menu omits the viewer-backed runtime control. The title is short, specific, and uses a conventional fix(scope) prefix.
Full details: Linked Issues check
Explanation
[#41536] asks that the owning-host snapshot drive the upper card, active-account row, inactive-account rows, and runtime target, without viewer substitution. At head f5ee4a5, use-codex-switcher-controller.ts derives runtimeTarget from ownerUsage.remoteOwner when present. When a remote runtime is active, activeUsage comes from ownerUsage.rateLimits.codex, inactiveCodexAccounts from the owner snapshot (emptied when usageMetadata.unverifiableOwner is set), and codexTarget from the owner snapshot with a host default. Remote account state comes from ownerUsage.accounts.codex. The local account-list load is disabled for remote owners through the enabled argument of useProviderAccountList. handleSelectRuntime returns early for an active remote runtime, so the viewer refresh action is not called. Local paths keep the viewer fallback. The incremental change since 605b6fd is small in the controller and is consistent with the prior verdict. Regression tests in CodexSwitcherMenu.remote-usage.test.tsx cover colliding viewer account IDs, absent host readings, unverifiable ownership, and WSL runtime exposure. Physical paired-host acceptance and hosted checks are non-coding or pending and are not assessed. Limit: I did not read the full incremental diff across all files; the whole-PR diff of the controller was read.
Full details: Out of Scope Changes check
Explanation
The changed files serve the #41536 data-source correction. use-codex-switcher-controller.ts and CodexSwitcherMenu.tsx carry the owner-scoped data path, activeUsage, and the remote runtime guard. StatusBarSurface.tsx, use-status-bar-controller.ts, and use-owner-usage-rate-limits.ts pass ownerUsage and ownerUsageKey so the menu and its pending state are keyed per owner. use-provider-account-list.ts adds the enabled option used by the owner fence. codex-sign-in-action.ts changes a dependency type to match the direct setAccounts value. The fixture and the remote-usage test file support the regression coverage, including the pairedHostWithWsl case. No unrelated feature or refactor was found. Limit: the full incremental diff since 605b6fd was not read hunk by hunk because the diff exceeded the inspection buffer; the scope check of that range rests on the change summary and the controller diff read.
Full details: Description check
Explanation
The description is thorough and follows the template. It has an ELI5, What Changed, Why, a linked issue (Fixes #41536), Visual Proof with before and after images, Testing, Risk with level and rollback, AI Disclosure, Review, the agent skill boundary section, Notes, and a checklist. Some items are unchecked, including manual testing on a physical paired client, full hosted CI, and physical paired-client acceptance. The author states these openly as pending, and the rest of the description is substantive, so the check passes.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Clear inactive Codex rows when the owner is… · use-codex-switcher-controller.ts:73-76
src/renderer/src/components/status-bar/use-codex-switcher-controller.ts:73-76 Minor · Functional Correctness · Quick win
Clear inactive Codex rows when the owner is unverifiable.
When the owner is unverifiable and the last-known snapshot has no stamped Codex slot, the menu can show cached inactive Codex rows as current. The Codex marker in use-codex-switcher-controller.ts is absent in two cases. The first is a null Codex slot. The second is a non-null Codex slot that is unconfigured and has no usage data, which the mapper returns without stamping it. The retained inactiveCodexAccounts list then passes the hook's guard.
Clear the list in the projection, next to the spread of base:
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Thanks for this, the owner-snapshot approach is the right fix. I pushed a few commits on top so it can land: merged current main (fixing a moved shared/constants import in the test), kept the host's account roster when a host publishes no usage (the open CodeRabbit thread), and moved the switcher's owner key into StatusBarSurface so the controller stays under the 300-line lint cap. The remote Codex reset (#40219) builds on your plumbing in a separate PR.
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.
ELI5
When you open another Orca host from this desktop, Codex's account rows now show that host's percentages and reset times, alongside its upper quota card.
What Changed
Pass the existing owning-host observation from the status bar into the Codex switcher. Keep the account roster and active/inactive quotas from the same
accounts.subscribesnapshot, so a host account switch updates names, selection and readings together. The existing owner fence also applies to that roster; the separate one-shot remote roster load is disabled. Local account loading retains the existing hook.The remote menu follows the quota runtime published by its host. Runtime selection remains local-only: the existing runtime-target refresh operates through the viewer's preload API, and there is no supported owner-targeted quota-runtime RPC to call. The remote menu omits that control, and its handler rejects remote runtime changes. No wire method is added. Missing remote readings never fall back to the viewer cache, unverifiable inactive readings stay hidden, and pending switch/reset UI remains keyed by owner.
Why
The upper card already followed the execution host. The row controller read the viewer's local inactive cache and runtime target, while remote mode skipped the local preview fetch and hid the active row. The existing accounts stream already carries the needed remote data; the correction consumes that observation without adding another quota probe or wire method.
Linked Issue
Fixes #41536
Visual Proof
Real component fixtures, English, with synthetic paired-host accounts. Before uses unchanged main; after uses this branch, with separate fresh headless renderers. These are presentation captures, not physical paired-device acceptance.
After — light:
Before and dark theme
Before — light:
Before — dark:
After — dark:
Testing
I manually tested these changes locally on a physical paired client; pending. Headless component inspection is recorded below.
Automated tests added/updated.
Every added regression fails without the correction and checks rendered quota attribution.
Final head:
ae79d29f517c8c84bd48af4630b0fae88b6bf8a2, tree648a3cc4f0f9f48be4481a2c12fb1752816e61ec. Frozen PR base:fbec96cf29dc4c93ba442a1958f5ecb4000b1f1a; source/check merge base:61a69df3a6df9fb997672577e162e96354abf9d6. The review correction is an ordinary forward commit from450c082f848d6880e3297107a450ebd7cb120a40.All 30
check:changedchecks pass against the frozen PR base, including node/web types, related tests, lint, changed-code quality, formatting, localization and source/React ratchets. The required pre-push invocation confirms the same passing content after normal commit hooks.Five focused rendered-menu regressions pass, plus the three existing owning-host stream cases. The initial three cover conflicting viewer runtime/account IDs, absent host readings and unverifiable ownership; their original reverted-code control is retained. Two review regressions reproduce the old code exactly: the previous account row displays 25% instead of its own 4% after a host switch, and a host with WSL accounts exposes the viewer-backed runtime selector. Both fail at
450c082f848d6880e3297107a450ebd7cb120a40and pass with this correction. The stream case runs the real owner hook and account-list hook; it does not mock those hooks.The published English before/after PNGs retain their initial
450c082capture source and verification. Post-review cold headless renders of bothpairedHostandpairedHostWithWslpass in light and dark themes, without console errors. The existing image gallery remains intact; no physical paired-device acceptance is implied.Normal managed commit hooks run. Installed Windows-to-Mac, Linux and physical-device acceptance remain pending; no live account was switched, signed in or reset during validation.
Risk
Level: Medium. A wrong owner or runtime could label one account with another host's quota. A single owner-fenced snapshot owns both roster and readings; missing remote rows cannot fall back to the viewer cache, and unverifiable-host rows do not show old percentages. Remote runtime controls cannot invoke the viewer's refresh action. Reverting these files restores the old switcher data source.
AI Disclosure
Implemented and checked with OpenAI Codex assistance.
Review
Self-review only. macOS, Linux and Windows use the same renderer path. Paired-host account identity, readings and the published WSL usage target come from the same observation; folder and Git workspaces keep the existing owner resolver. The remote runtime selector is intentionally unavailable until there is an owner-targeted API; local runtime selection is unchanged. Existing local-only sign-in and reset capabilities remain guarded. Mobile already consumes the host account snapshot and needs no wire change. Older hosts that omit per-account readings yield empty rows rather than viewer values.
Agent skill upstream boundary
Notes
This changes quota attribution in the desktop menu. The existing Used/Remaining display preference and account-row styling are independent. Upstream Actions await maintainer approval before running.
Checklist