Repository navigation
[Bug]: Claude account switched from mobile takes effect, but the desktop keeps showing and attributing usage to the old account #17261
Description
Operating system
Windows
Orca version
v1.4.192
Details
Short summary
Switching the active Claude account from the paired mobile app takes effect — new sessions consume the NEW account's quota — but the desktop keeps displaying the OLD account as active, and the status-bar usage meter attributes the numbers to it. Consumption moves; attribution does not.
What happens
- Desktop and phone paired; two managed Claude accounts, A active.
- On the phone: Accounts → select account B (
accounts.selectClaudeRPC). - The switch is real: credentials are re-materialized and the next usage fetch on the host measures account B.
- The desktop status bar still shows account A as the active account, with the incoming numbers painted under A's label. Account B's row reads as inactive with no data. Restarting the switcher popover does not fix it; the desktop only corrects after some unrelated action forces a settings refetch.
Why (traced in the source)
- Both paths call the same service: the mobile RPC (
src/main/runtime/rpc/methods/accounts.ts→runtime.selectClaudeAccount) and the desktop IPC (claudeAccounts:select) both land inClaudeAccountSelection.select. - That selection writes the new active id with
store.updateSettings({ activeClaudeManagedAccountId, ... })— withoutnotifyListeners.Store.updateSettingsonly broadcasts whennotifyListeners === true(src/main/persistence/applying-settings/settings-update.ts:246), so nosettings:changedever reaches the renderer. - The desktop UI never notices because it normally compensates client-side: after a switch initiated in the status bar, the renderer itself calls
fetchSettings()(StatusBar.tsx) and re-derives the active-account label from its own settings copy. A comment inruntime-provider-accounts-client.tsstates the gap outright: "Local: one-shot reads of the desktop services (they have no push channel here; the pane refetches after each mutation)." - The
rateLimits:updatepush the desktop does receive carries usage numbers and the runtime target, but no active-account id — so fresh numbers from account B arrive and are rendered under the stale label of account A. Measurement on the main process is actually correct (credentials are resolved per fetch viasyncForCurrentSelection); only the desktop's attribution/labeling is stale.
Scope — the trigger is "any selection not initiated by the desktop renderer", not mobile specifically
- CLI:
orca account addselects the new account through the same no-notify writes (claude-account-registration.ts), so it should reproduce the same stale desktop label. - Codex: the codex account service writes
activeCodexManagedAccountIdwith the same pattern (src/main/codex-accounts/service.ts), so a Codex switch from mobile should show the same symptom.
Suggested fix
Minimal: pass { notifyListeners: true } on the selection writes (claude-account-selection.ts, claude-account-registration.ts, and the Codex counterparts). The renderer side already merges settings:changed into the app store (settings-sidebar-ipc-bridge.ts), and the status bar's claudeAccountSyncKey is derived from those settings, so the label and the roster refetch correct themselves with no new wire surface. Main-side onSettingsChanged listeners are all keyed to specific settings keys, so the extra broadcast is low-risk.
More robust alternative: give the desktop renderer the same push the mobile client already gets (runtime.onAccountsChanged), unifying both paths on one channel.
Related, not duplicates
- #16466 — same family of symptom (meter attributed to the wrong account) but a different mechanism: remote-runtime scope resolution of the meter's source. This report is about local selection mutations never notifying the desktop renderer.
- #14833 — adjacent: per-account usage display gaps for inactive accounts.
- #12098 — broad account-switching report; this issue isolates one specific mechanism with a code trace.
Activity
fix(accounts): notify the renderer when the active account changes ou…
ryofukutani commentedon Sep 22, 2026
Reproduced on macOS (Darwin 25.6), Orca 1.4.207, with a trigger that is neither the mobile app nor the desktop renderer: a local script on the same Mac calls
accounts.selectClaudethrough the Orca runtime to rotate to another managed Claude account when the active one runs low.What we observed (2026-09-22, JST). Account names are replaced with letters.
settings.activeClaudeManagedAccountIdinprofiles/local-default/orca-data.jsonbecame S.~/.claude/.credentials.jsonwas rewritten. We confirmed the token belongs to S: theanthropic-organization-idheader returned by/api/oauth/usagefor that token matches S'sorganizationUuidinclaudeManagedAccounts./statusin Claude Code exactly.This matches the analysis in the issue body. The selection path writes the settings without
notifyListeners, so the renderer keeps its own stale copy.One additional data point. The stale label was not the previously active account (E); it was I. I is the first entry of
claudeManagedAccounts. We did not confirm why I was shown. A renderer copy that is several RPC-initiated switches old would explain it, since the script had switched accounts several times that day without any switch from the desktop UI. So the wrong label can point at an account that has not been active for hours, which makes the mismatch harder to spot than "one switch behind".— Claude (session: dev-project-ca), posting on behalf of the reporter
nwparker commentedon Oct 24, 2026
Thanks for the report! Please retest on 1.4.239+ (desktop and mobile). If the desktop still shows the old account, share: Orca desktop and mobile versions, OS, and a screenshot of the status bar before and after switching. A refresh behavior detail helps too: does it correct itself after reopening Settings or restarting Orca?
nwparker commentedon Oct 27, 2026
Thanks for the report! This is fixed on main by #26801 (8b2a5e4, re-landing #24434): ClaudeAccountSelection.saveSettings now writes with
notifyListeners: true, so selections made from mobile, the CLI, or another window broadcast settings:changed and the desktop switcher/status bar update. Closing — please reopen if you still see it on the latest build.