Skip to content

Route provider account surfaces through the active Remote Orca Server - #7999

Merged
Jinwoo-H merged 4 commits into
mainfrom
Jinwoo-H/remote-issue-1
Jul 10, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
Jinwoo-H/remote-issue-1

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With a Remote Orca Server selected as the active runtime, Settings > Accounts and the Claude/Codex status-bar switchers still read and mutated the desktop-local account services: the pane listed this device's accounts under a remote-runtime session, selecting an account reported success while remote terminals kept the server-owned account, and Add/Re-authenticate silently authenticated on the desktop.

This routes provider account list / select / remove through the active runtime:

  • New runtime-provider-accounts-client.ts follows the existing runtime-*-client seam (getActiveRuntimeTarget + callRuntimeRpc) and mobile's accounts.* contract ({ accountId } params, accounts-snapshot results).
  • Listing uses a live accounts.subscribe watch, not accounts.list: the server's accounts.list blocks on refreshAccountsForMobile(), which we observed hanging >15s behind broken provider auth during live validation. The subscribe ready message carries the snapshot synchronously and later broadcasts stream usage refreshes into the open pane. The mobile-facing accounts.list semantics are intentionally untouched.
  • The pane + switchers label the scope with the paired server's name, disable interactive add/re-auth (they spawn local claude login / codex login PTYs that would authenticate this device), hide the host/WSL account-location toggle, and skip local-only refreshes (fetchSettings, inactive-usage caches, Codex reset credits, sign-in affordances) in remote scope.
  • The remote snapshot wins over accounts reconstructed from local GlobalSettings in the status bar (resolveCodex/ClaudeStatusAccountState).
  • Local and WSL behavior is unchanged when no remote runtime is active.

The first commit is a pre-existing one-line switch-exhaustiveness lint failure on main (notification-authorization-status.ts) that blocks pnpm lint for every branch; drop it if a dedicated fix lands first.

Relationship to #7976

Community PR #7976 (@SiteupAgencia) identified the same root cause and the right RPC seam — credit to them for the direction, including the blocked-accounts.list observation. This PR reimplements the account slice narrowly because #7976 bundles several unrelated changes (agent-activity reordering in orca-runtime.ts, worktree-card compact-summary UX reversal, native-chat suppression, hermes.png) and its account slice has defects detailed in the review comment on that PR (one-shot subscribe that never live-updates, a mobile-facing accounts.list semantics change, remote rate-limits injected into the local push-fed store slot causing flicker, account reloads keyed on settings object identity).

Reproduction & live validation (adapted /brennan-test-ssh harness)

Two disposable dev instances of this worktree: a headless --serve server and a desktop client, each seeded with divergent fake managed accounts (server-codex-1/2, server-claude-1 vs desktop-codex-1/2, desktop-claude-1), paired via runtimeEnvironments.addFromPairingCode with the orca://pair URL from --serve-json, server set as Active Server.

Before (main): pane said "Showing accounts for this device", listed only desktop-* accounts, Add Account enabled; clicking desktop-codex-2 flipped the local service to desktop-codex-2 and showed "Active" while the server stayed on server-codex-1; the status-bar switcher showed the local account.

After (this branch, same harness):

  • Pane: "Showing accounts managed by Repro Server", lists server-claude-1, server-codex-1/2 with "Repro Server" badges, Add Account/Re-authenticate disabled, no Account-location section.
  • Clicking server-codex-2 in the pane → server snapshot now reports activeAccountId: server-codex-2; local service state and settings untouched.
  • Status-bar Codex switcher lists only server accounts under a "Repro Server" group; switching to server-codex-1 changed the server's selection; local untouched.
  • Clearing the Active Server restores the exact local view (desktop accounts, enabled Add).

Validation

  • pnpm typecheck, pnpm lint (incl. localization catalog/parity, max-lines ratchet) green
  • 149 renderer test files / 1021 tests green (status-bar/, settings/, runtime/)
  • New unit coverage: local vs remote routing for watch/select/remove (incl. "params are only { accountId }" contract), remote snapshot streaming + unsubscribe-on-close, subscription failure surfacing, remote-wins status-bar account state, pane copy/disable states both scopes

Known follow-ups (unchanged behavior, called out for transparency)

  • Status-bar usage numbers (rate-limit bars) still come from the desktop's own poll even in remote scope; fixing that needs a runtime-scoped rate-limit store slot (the Fix remote agent workflows and runtime performance #7976 approach of injecting remote snapshots into the local push-fed slot flickers, so it was deliberately left out).
  • Server-side accounts.selectCodex/selectClaude awaits a provider usage refresh before returning; with wedged auth the RPC can be slow (30s timeout applied client-side).

Fixes #7973 (STA-1558)

Made with Orca 🐋

Jinwoo-H and others added 2 commits July 9, 2026 21:57
Pre-existing on main; blocks pnpm lint for every branch. Same one-line
resolution as the hunk bundled in community PR #7976.

Co-authored-by: Orca <[email protected]>
With a Remote Orca Server selected as the active runtime, Settings >
Accounts and the Claude/Codex status-bar switchers read and mutated the
desktop-local account services: the pane listed this device's accounts,
selection reported success while remote terminals kept the server-owned
account, and Add/Re-authenticate silently authenticated on the desktop.

Add runtime-provider-accounts-client, which scopes list/select/remove to
getActiveRuntimeTarget(): local surfaces keep the existing window.api
IPC, while a remote owner routes through the server's accounts.* RPC
(mobile's contract: params are just accountId, result is the accounts
snapshot). Listing uses a live accounts.subscribe watch instead of
accounts.list because the latter blocks behind provider usage refreshes
and can hang for minutes behind broken auth; the ready message carries
the snapshot synchronously and later broadcasts stream usage refreshes
into the open pane.

The pane and switchers label the scope with the paired server's name,
disable interactive add/re-auth (they spawn local login PTYs), hide the
host/WSL account-location toggle, and let the remote snapshot win over
accounts reconstructed from local GlobalSettings in the status bar.
Local and WSL behavior is unchanged when no remote runtime is active.

Fixes #7973

Co-authored-by: Orca <[email protected]>
Depending on the settings object identity re-ran the remote snapshot
round trip on every unrelated settings mutation.

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8adc146e-bf4f-4f15-a631-da5f5f078caf

📥 Commits

Reviewing files that changed from the base of the PR and between 853e972 and 8316d94.

📒 Files selected for processing (6)
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
✅ Files skipped from review due to trivial changes (3)
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/ko.json

📝 Walkthrough

Walkthrough

Adds remote-runtime ownership handling for Claude and Codex accounts. Provider account snapshots can be watched or fetched locally or through runtime subscriptions, while selection and removal route through local IPC or remote RPC. Settings and status-bar account controls now display remote ownership, suppress local-only authentication actions, and use remote account state. Tests and localization strings cover the new behavior, and notification authorization parsing adds an explicit undefined case.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The one-line notification-authorization-status lint fix is unrelated to #7973 and adds change outside the remote account-routing scope. Move the lint fix to a separate PR or clearly justify it as prerequisite maintenance and keep this PR focused on remote account routing.
Docstring Coverage ⚠️ Warning Docstring coverage is 10.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed It concisely summarizes the main change: routing provider account surfaces through the active remote server.
Description check ✅ Passed It covers the summary, validation, follow-ups, and risk notes closely enough to satisfy the template overall.
Linked Issues check ✅ Passed The implementation matches #7973 by routing list/select/remove through remote RPC, preferring remote snapshots, and disabling local add/re-auth in remote mode.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a789bd49-c6bf-44bd-8456-a725df2133c2

📥 Commits

Reviewing files that changed from the base of the PR and between 4baaca6 and 249396a.

📒 Files selected for processing (12)
  • src/main/ipc/notification-authorization-status.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/status-bar-runtime-groups.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/runtime-provider-accounts-client.test.ts
  • src/renderer/src/runtime/runtime-provider-accounts-client.ts

…scope

The per-row getCodexAccountAuthWarning still read the desktop's own
rate-limit poll, so a server-owned account could show 'Needs re-auth'
based on local auth state; and the empty-state copy told users to add
an account 'here' while the Add button is disabled under a remote owner.

Co-authored-by: Orca <[email protected]>
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Addressed both CodeRabbit findings in 8316d94: the per-account Codex "Needs re-auth" badge is now gated by the same remote-scope check as the section-level warning, and the empty-state copy has a remote variant that points at the server instead of the disabled local Add button (translated in all five locales).

@Jinwoo-H
Jinwoo-H merged commit 6731773 into main Jul 10, 2026
2 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/remote-issue-1 branch July 10, 2026 02:30
bbingz added a commit to bbingz/orca that referenced this pull request Jul 10, 2026
Keep Grok accounts section imports with remote provider account client
helpers from stablyai#7999, and preserve both status-bar usage + remoteServer
locale keys.
@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote provider account UI silently reads and mutates local accounts

2 participants