Repository navigation
Conversation
`orca account select` and `orca account rm` accepted only OpenCode and Devin. They now cover every provider with saved accounts — Claude, Codex, OpenCode, Devin and Antigravity — through the runtime methods the status-bar switcher and Settings already use (accounts.selectClaude, selectCodex/selectCodexForTarget, selectData, antigravitySelect and the matching remove methods). No runtime or wire change. `--account` takes an id, an email/label (case-insensitive) or `system`. A name shared by several accounts is refused with their ids rather than guessing which subscription to bill. `system` is refused for Antigravity (no system default), for Claude from the WSL bridge (the RPC has no target and would reset the Windows host), and always for `rm`. `orca account list` now prints each account's id and a `system` row, accepts `--agent` for every provider, and adds the Antigravity block when the host can read it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
6e0ba0d9-2659-4ee3-823f-cd450eabb403
📒 Files selected for processing: 12
docs/site/content/docs/cli/reference.mdxsrc/cli/handlers/account-list-format.tssrc/cli/handlers/account-selection.test.tssrc/cli/handlers/account-selection.tssrc/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/data-account-commands.tssrc/cli/help.tssrc/cli/root-help-text-primary.tssrc/cli/root-help-text-secondary.tssrc/cli/specs/account.test.tssrc/cli/specs/account.ts
💤 Files with no reviewable changes: 1
- src/cli/handlers/data-account-commands.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.
The host rejects every client-selected WSL target for Antigravity account management, reads included, so the test now mirrors that refusal and checks that no select call is made instead of asserting an impossible success path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Contain status.get failures in the optional Antigravity read. · account-selection.ts:148-167
src/cli/handlers/account-selection.ts:148-167
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winContain
status.getfailures in the optional Antigravity read.
readAntigravityAccountsForListcan callstatus.getafteraccounts.listsucceeds. If that capability probe rejects, the rejection occurs before the optional-list fallback and escapes theaccount listhandler.orca account listthen fails instead of returning the Claude, Codex, OpenCode, and Devin results.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ab7c16e4-5187-486a-a8f5-39cbac8eef86
📒 Files selected for processing: 1
src/cli/handlers/account-selection.test.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.
ELI5
Orca can keep several accounts per AI coding agent (two Claude subscriptions, a work and a personal Codex, several Antigravity Google accounts…), but from the terminal you could only switch OpenCode and Devin. For everything else you had to click in the app — impossible on a headless host or from a script. This PR makes
orca account select(andorca account rm) work for every agent that has saved accounts.What Changed
Before:
orca account select/rmaccepted only--agent opencode|devin, took only an id, andorca account listshowed Claude/Codex accounts by email only (no id to pass, no Antigravity block).After:
Mechanism — CLI only, no runtime or wire change. One provider table in the new
src/cli/handlers/account-selection.tsmaps each agent to the runtime methods the status-bar switcher and Settings already use:accounts.listaccounts.selectClaudeaccounts.removeClaudeaccounts.listaccounts.selectCodex/selectCodexForTarget(WSL bridge)accounts.removeCodexaccounts.listDataaccounts.selectDataaccounts.removeDataaccounts.antigravityListaccounts.antigravitySelectaccounts.antigravityRemove--accountresolution is shared: exact id first, then a case-insensitive email / label / subject, orsystemfor the provider's own sign-in.systemis refused for Antigravity (its vault has no system default), for Claude from the WSL bridge (selectClaudehas no target and would reset the Windows host — same guard as feat(cli): select the Claude or Codex account fromorca account select#26870), and always forrm(system credentials are never removed).--agentis required forselect/rm, and a valueless--agent/--accountis rejected rather than defaulted.accounts.managed-data-profiles.v1, Antigravity checksaccounts.antigravity-native.v1. In the fullaccount list, an older host — or one that advertises the capability but has no native credential adapter (Linux today) — simply omits the Antigravity block;account list --agent antigravitystill reports why.docs/site/content/docs/cli/reference.mdxupdated.mutateDataAccountis replaced by the shared path.Why
The runtime has exposed account switching over RPC for every one of these providers for a while; only the CLI surface was missing, so headless hosts (
orca serve) and coordinating agents that create workspaces withorca worktree create --agent …could not choose which subscription they run on.This builds on the design of #26870 (Claude/Codex only, by @pawel-kotowski — id/email resolution, ambiguity refusal, WSL guards), which is currently conflicting with
main, and extends it to every provider with saved accounts, as requested in #29227 for Antigravity. Happy to coordinate if you prefer to land #26870 first.Not done here: Grok, Cursor, Gemini, Kimi, Z.ai/GLM, MiniMax and Copilot have a single native login or API key in Orca, so there is nothing to select. A per-workspace
--accountonworktree createis a natural follow-up once per-account Claude folders (#26801) land.Linked Issue
Fixes #26875
Fixes #29227
Visual Proof
N/A — CLI-only change; output examples above.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
src/cli/handlers/account-selection.test.ts(37 tests): every provider × select/rm hits the right RPC with the right params, and nothing else mutates; email/label/subject resolution ignoring case; ambiguous and unknown accounts refused without mutation;systemmapping and refusals; CodexselectCodexForTargetand Antigravity target from the WSL bridge; missing capabilities; valueless flags;list --agent, the Antigravity block, an older host, and a host whose Antigravity listing throws; formatter output.Updated expectations in
account.test.tsandspecs/account.test.ts.pnpm tc:cliclean,oxlintclean,check:code-quality:changed→ 0 new findings;src/cli/handlers+src/cli/specs: 641 tests pass.src/cli/runtime/launch*.test.ts(28 tests) fail on this Linux box identically on unmodifiedmain(they spawn/opt/orca/orca-ide); unrelated to this change.Real run on Linux (Orca 1.4.230 runtime, two saved Claude accounts), with the CLI built from this branch:
account listshows ids and thesystemrow;select --agent claude --account MAXIME@…switched the active account (case-insensitive),--account systemswitched back; unknown account,rm --account system, and--agent geminiwere refused with exit 1. On this host the runtime advertises Antigravity but cannot list it ("Linux Secret Service needs a verified adapter"), which surfaced the full-list fallback above. Not tested on macOS/Windows/WSL by hand; those paths are covered by unit tests.AI Disclosure
Written with Claude Code (Claude Opus 5.5), reviewed by me.
Review
getWslAccountTarget.rejectAccountRemoteSelectionFlagsunchanged).accounts.listkeepsrefreshUsage: false.rmstaysdestructive, never touches system credentials, and refuses ambiguous names.Agent skill upstream boundary
Notes
No runtime, protocol or mobile change; older runtimes keep working through the existing capability gates.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) —tc:cli, oxlint, changed-code quality and CLI tests run locally; CI covers the rest🤖 Generated with Claude Code