Repository navigation
fix(status-bar): show a paired server's usage on its Claude and Codex account rows - #43952
Conversation
…apshot Both switchers now take their owner, roster and per-account readings from the status bar's owner observation through one projection, so a workspace on a paired server shows that server's usage on every account row.
…mote WSL clears off
…ding the Active Server
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
ELI5
When your workspace lives on a paired Orca server, the Claude account list in the status bar now shows each of that server's accounts with its own usage, the same as it does for a workspace on your own machine.
What Changed
Mechanism: the status bar already watches one owner, the host that owns the focused workspace's accounts (
useOwnerUsageRateLimits), and every meter reads from it. The Claude and Codex switchers did not:inactiveClaudeAccounts,claudeTarget) and fetched the roster separately from the readings.Now the owner observation also returns the
AccountOwnerit resolved. Both switchers take their owner, roster, per-account readings and usage target from it through one projection,getOwnerAccountRows. This replaces the Codex-only projection from #41540. For a local owner, the observation'srateLimitsis the store object itself, so local workspaces read exactly what they did before.Following from the same owner:
accounts.selectClaudecarries no runtime, so clearing that slot would clear the server's host slot instead.The native-chat usage-limit Claude menu keeps its own owner (the chat's host) and is unchanged.
Why
The server already publishes per-account usage in its
accounts.subscribesnapshot (#29430). The rows just never read it. Patching Claude the way #41540 patched Codex would have left two per-provider copies of the same owner logic, and the owner mismatch with no focused workspace in place. Reading every row from the one owner observation fixes both providers at the layer that owns "whose usage is this".I checked the other meters (Gemini, Grok, Muse, Kimi, MiniMax, Cursor, ZCode, OpenCode Go, and the Antigravity account rows). They already read the owner snapshot. Only the Claude and Codex rows read the viewer.
Linked Issue
Fixes #40733
Visual Proof
Real headless
orca servewith two seeded Claude accounts, paired to a hidden dev desktop. The host's usage endpoint was answered in-process (A at 30%, B at 75%), so no request left the machine.Before (main): server rows are blank.
After: each row shows the server's reading for that account.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Live paired repro on macOS. A throwaway Playwright spec ran a real headless serve plus a hidden paired desktop, with keychain isolation and a scratch HOME.
accounts.selectClaudeon the server, the rows followed: A became inactive at 30%, and B became active at 75%.account-switchers.remote-usage.test.tsx(renamed from the Codex-only file) adds a Claude case. It fails on main, where it reads the viewer's 99%, and passes here. The existing Codex cases still pass.pnpm check:changedpasses. The focus-read baseline was pruned because both switchers stopped reading the Active Server.Risk
The riskiest part is which host's accounts a switcher lists when no workspace is focused. That is now this device, matching the bar's numbers, where it used to be the Active Server. That is the intended fix, but it is a visible change for anyone who relied on the old fallback.
Older servers: the roster comes from the same
accounts.subscribestream the old one-shot read used. A server that publishes no per-account usage shows empty rows, as before.Mobile is untouched. A plain revert backs this out.
Level: Medium
AI Disclosure
Review
Two review-loop rounds (Codex + Claude). Round 1 found the settings-scope and remote WSL clear issues, both fixed here. Round 2 came back clean.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
{local, distro}ownership.#40896 (the active Claude row blank on a local workspace) was already fixed on main by #42466.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)