Repository navigation
feat(claude-accounts): per-project Claude account (ask on launch, remember per project) - #23228
Ethan-Rivas wants to merge 294 commits into
Conversation
6ff581f to
2cd7c2d
Compare
There was a problem hiding this comment.
ℹ️ Minor suggestions only. The core pinning/resolution logic holds up under a line-by-line read and two independent passes over the reservation lifecycle and the
__active__sentinel — no reachable correctness or security defect found. Two small notes below.
Reviewed changes
This run reviewed the PR's authored delta only — the 15 commits from 4f038e1 onward. The first 16 commits belong to the stacked #22691 and were not re-reviewed.
- Per-project preference:
Repo.agentAccounts.claude = { mode: 'ask' } | { mode: 'account', accountId }, normalized at every persistence/IPC/RPC boundary and round-tripped likeghAccount;nullclears. - Main-process resolver:
resolveProjectClaudeAccountorders explicit pin → launch config → project setting, with the__active__sentinel short-circuiting before the project setting so an "active this time" launch is never re-pinned on resume. - Both spawn lanes: renderer IPC and runtime resolve the pinned account and share
claude-pinned-spawn.ts(reserve, provenance check, mark-first in commit, release on every exit). The structured → terminal downgrade is mirrored on the renderer plan and the host. - Status/label plumbing: main stamps
claudeAccountIdon agent-status rows from the pinned PTY registry (including the persisted-layout fallback before reattach); the renderer preserves it across local writes and shows it in the tab tooltip. - Paired hosts: the account rides optional agent-session RPC params, capability-gated by
agent-session.claude-account.v1; refusal codes are tagged[claude_pinned:<code>]and stripped from CLI/mobile output.
ℹ️ Stacked base vs. target
The body says this is stacked on #22691 and that the first 16 commits are #22691's, but the pull request targets main. The resulting diff (220 files, ~9.8k additions) therefore carries #22691's commits, so merging as-is would land that work too and a reviewer cannot scope this feature from the PR files alone.
Technical details
# Stacked base vs. target
## Affected sites
- PR base is `main` (da6d483ab9); the authored delta starts at `4f038e17f1`, whose parent `87c9fe4acb` is the tip of #22691's branch.
- `pullfrog_checkout_pr` reports `base: main` and the 220-file `diffPath` includes #22691's files (e.g. `runtime-auth-pinned-launch.ts`, `claude-pinned-pty-registry.ts`).
## Required outcome
- Before merge, retarget the PR to #22691's branch, or land #22691 on `main` first and rebase, so the reviewed diff reflects only this feature.
## Open questions for the human
- Is #22691 close enough to landing that a rebase is preferable to retargeting?ℹ️ Account roster fetched from the wrong host in the tab label
Every sibling that reads the Claude roster routes through the repo owner — RepositoryClaudeAccountSection.tsx:46-49 derives activeRuntimeEnvironmentId from getRepoOwnerRoutedSettings, and choose-claude-launch-account.ts:106 passes the routed settings — but useClaudeTabAccountLabel passes the raw settings. Since fetchProviderAccountsSnapshot resolves its target from settings.activeRuntimeEnvironmentId, a tab whose repo is owned by a non-active runtime environment is queried against the wrong host, claudeTabAccountLabel finds no matching account, and the account label silently never appears.
Technical details
# Account roster fetched from the wrong host in the tab label
## Affected sites
- `src/renderer/src/components/tab-bar/use-claude-tab-account-label.ts:43` — `fetchProviderAccountsSnapshot(settings)` uses the global `activeRuntimeEnvironmentId`, not the repo owner's.
## Required outcome
- The roster fetch must target the same runtime environment the settings section and the prompt use for this repo, so a remote-environment (non-SSH) project's pinned account resolves.
## Suggested approach (optional)
- `findLaunchRepo(s, { worktreeId: tab.worktreeId })` is already available in this file; select the repo once, then pass `getRepoOwnerRoutedSettings(settings, repo)` to `fetchProviderAccountsSnapshot` (add the `repo-runtime-owner` import), matching `choose-claude-launch-account.ts:106`.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
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: 4e596faa-af21-479e-8b00-32e946f9e178
📒 Files selected for processing (220)
config/tsconfig.tc.web.jsondocs/reference/agent-status-store.mdmobile/src/transport/rpc-acceptance-policies.test.tsmobile/src/transport/rpc-acceptance-policies.tssrc/cli/cli-error-claude-pinned.test.tssrc/cli/cli-error.tssrc/cli/handlers/claude-launch-account-flag.tssrc/cli/handlers/orchestration-worker-account-cli.test.tssrc/cli/handlers/orchestration/worker-launch-handler.tssrc/cli/handlers/worktree.tssrc/cli/index-worktree-create-claude-account.test.tssrc/cli/specs/core.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/agent-launch/agent-launch-executor.test.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-mode.tssrc/main/claude-accounts/claude-account-host-mutation.tssrc/main/claude-accounts/claude-account-registration.tssrc/main/claude-accounts/claude-account-selection.tssrc/main/claude-accounts/claude-account-service-account-selection.test.tssrc/main/claude-accounts/claude-account-service-reauth-pinned.test.tssrc/main/claude-accounts/claude-host-pty-accounts.test.tssrc/main/claude-accounts/claude-host-pty-accounts.tssrc/main/claude-accounts/claude-launch-account.test.tssrc/main/claude-accounts/claude-launch-account.tssrc/main/claude-accounts/claude-pinned-config-dir.test.tssrc/main/claude-accounts/claude-pinned-config-dir.tssrc/main/claude-accounts/claude-pinned-credentials.tssrc/main/claude-accounts/claude-pinned-pty-registry.test.tssrc/main/claude-accounts/claude-pinned-pty-registry.tssrc/main/claude-accounts/environment.tssrc/main/claude-accounts/live-pty-gate.test.tssrc/main/claude-accounts/live-pty-gate.tssrc/main/claude-accounts/pinned-claude-pane-account.test.tssrc/main/claude-accounts/pinned-claude-pane-account.tssrc/main/claude-accounts/project-claude-account-resolution.test.tssrc/main/claude-accounts/project-claude-account-resolution.tssrc/main/claude-accounts/runtime-auth-service-pinned-launch.test.tssrc/main/claude-accounts/runtime-auth-service.tssrc/main/claude-accounts/runtime-auth/runtime-auth-pinned-launch.tssrc/main/claude-accounts/runtime-auth/runtime-auth-readback.tssrc/main/claude-accounts/runtime-auth/runtime-auth-sync.tssrc/main/claude-accounts/runtime-auth/runtime-auth-types.tssrc/main/daemon/daemon-provider-init.tssrc/main/ipc/agent-hooks.test.tssrc/main/ipc/agent-hooks.tssrc/main/ipc/pty-runtime-claude-account-spawn.test.tssrc/main/ipc/pty-spawn-env-terminal-basics.test.tssrc/main/ipc/pty/claude-pinned-spawn.test.tssrc/main/ipc/pty/claude-pinned-spawn.tssrc/main/ipc/pty/host-env/types.tssrc/main/ipc/pty/ipc/spawn-commit.tssrc/main/ipc/pty/ipc/spawn-env.tssrc/main/ipc/pty/ipc/spawn-preflight-claude-account.test.tssrc/main/ipc/pty/ipc/spawn-preflight.tssrc/main/ipc/pty/ipc/spawn-run-claude-pinned-release.test.tssrc/main/ipc/pty/ipc/spawn-run.tssrc/main/ipc/pty/runtime/spawn-claude-account.tssrc/main/ipc/pty/runtime/spawn-commit.tssrc/main/ipc/pty/runtime/spawn-preflight.tssrc/main/ipc/pty/runtime/spawn-state.tssrc/main/ipc/pty/runtime/spawn.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/ipc/repos/repo-update-handler.tssrc/main/persistence-update-repo.test.tssrc/main/persistence/loading-store/repo-lifecycle-operations.tssrc/main/persistence/tracking-repos/repo-hydration.tssrc/main/persistence/tracking-repos/repo-sanitization.tssrc/main/persistence/tracking-repos/repo-update-operations.tssrc/main/rate-limits/claude-fetcher-managed-account-usage.test.tssrc/main/rate-limits/claude-managed-account-credentials.tssrc/main/rate-limits/claude-managed-account-usage.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-agent-teams-launch-plan.test.tssrc/main/runtime/orca-runtime-agent-teams-launch-plan.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-create-terminal-dependencies.tssrc/main/runtime/orca-runtime-create-terminal-desktop.tssrc/main/runtime/orca-runtime-create-terminal.tssrc/main/runtime/orca-runtime-get-agent-session-execution-namespace.tssrc/main/runtime/orca-runtime-tests/claude-account-agent-session-lanes.spec.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/rpc/methods/orchestration-worker-start-mode.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-claude-account-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-claude-account.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-topology.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.tssrc/main/runtime/rpc/methods/orchestration/worker/workers.tssrc/main/runtime/rpc/methods/repo.test.tssrc/main/runtime/rpc/methods/worktree-create-args.tssrc/main/runtime/rpc/methods/worktree-create-claude-account-args.test.tssrc/main/runtime/runtime-agent-launch-resolution.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-local-worktree-terminal-startup.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-managed-worktree-create-types.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/runtime/runtime-repository-settings-controller.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/runtime-worktree-startup-claude-account.test.tssrc/main/runtime/runtime-worktree-startup-claude-account.tssrc/main/startup/main-process-account-services.tssrc/main/startup/main-process-ready-foundation.tssrc/main/startup/main-process-runtime-launch.tssrc/main/startup/main-process-runtime-service.tssrc/main/startup/main-window-agent-status.tssrc/main/startup/main-window-core-services.tssrc/main/window/attach-main-window-services.tssrc/preload/api/repository-api.tssrc/renderer/src/App.tsxsrc/renderer/src/components/claude-account-prompt/ClaudeAccountPromptDialog.test.tsxsrc/renderer/src/components/claude-account-prompt/ClaudeAccountPromptDialog.tsxsrc/renderer/src/components/claude-account-prompt/choose-claude-launch-account.test.tssrc/renderer/src/components/claude-account-prompt/choose-claude-launch-account.tssrc/renderer/src/components/claude-account-prompt/claude-account-prompt-state.tssrc/renderer/src/components/settings/RepositoryClaudeAccountSection.test.tsxsrc/renderer/src/components/settings/RepositoryClaudeAccountSection.tsxsrc/renderer/src/components/settings/RepositoryPane.tsxsrc/renderer/src/components/settings/RepositoryProjectSettingsSections.tsxsrc/renderer/src/components/settings/accounts-pane-claude-section.test.tsxsrc/renderer/src/components/settings/accounts-pane-claude-section.tsxsrc/renderer/src/components/settings/accounts-search.test.tssrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/settings/repository-claude-account.tssrc/renderer/src/components/settings/repository-search-claude-account.test.tssrc/renderer/src/components/settings/repository-search.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/use-claude-tab-account-label.tssrc/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.test.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneSurface.tsxsrc/renderer/src/components/terminal-pane/claude-pinned-launch-error-copy.test.tssrc/renderer/src/components/terminal-pane/claude-pinned-launch-error-copy.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection/cold-restore-claude-account.test.tssrc/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.tssrc/renderer/src/components/terminal-pane/pty-connection/run-deferred-connect.tssrc/renderer/src/components/terminal-pane/pty-connection/transport-output-callbacks.tssrc/renderer/src/components/terminal-pane/refused-claude-launch-recovery.test.tssrc/renderer/src/components/terminal-pane/refused-claude-launch-recovery.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport-host-session-launch.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/components/terminal-pane/terminal-pane-lifecycle-types.tssrc/renderer/src/components/terminal-pane/terminal-pane-manager-options.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-process-exit-actions.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-title-state.tssrc/renderer/src/components/use-terminal-create-actions.tssrc/renderer/src/hooks/composer-state/quick-creation-execution.tssrc/renderer/src/hooks/composer-state/quick-startup-plan.tssrc/renderer/src/hooks/ipc-events/agent-status-event-applicator.tssrc/renderer/src/hooks/ipc-events/normalize-agent-status-event.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-launch-caller-profile-census.test.tssrc/renderer/src/lib/agent-launch-caller-profiles-test-harness.tssrc/renderer/src/lib/agent-launch-routing-caller-census.test.tssrc/renderer/src/lib/agent-session-launch-plan.test.tssrc/renderer/src/lib/agent-session-launch-plan.tssrc/renderer/src/lib/claude-launch-account.test.tssrc/renderer/src/lib/claude-launch-account.tssrc/renderer/src/lib/claude-tab-account-label.test.tssrc/renderer/src/lib/claude-tab-account-label.tssrc/renderer/src/lib/launch-agent-in-new-tab-claude-account.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab-claude-account.test.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/lib/sleeping-agent-session-launch-claude-account.test.tssrc/renderer/src/lib/sleeping-agent-session-launch.tssrc/renderer/src/runtime/agent-session-launch-options.test.tssrc/renderer/src/runtime/agent-session-launch-options.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/store/repos/repo-state.tssrc/renderer/src/store/repos/repo-update.tssrc/renderer/src/store/slices/agent-status-claude-account.test.tssrc/renderer/src/store/slices/agent-status-claude-account.tssrc/renderer/src/store/slices/agent-status-contract.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/renderer/src/store/slices/agent-status-live-entry-history.tssrc/renderer/src/store/slices/agent-status-recovery-equivalence.tssrc/renderer/src/store/slices/agent-status-sleep-claude-account.test.tssrc/renderer/src/store/slices/agent-status-sleeping-records.test.tssrc/renderer/src/store/slices/agent-status-sleeping-records.tssrc/shared/agent-launch-intent.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-resume.tssrc/shared/agent-status-ipc-payload.tssrc/shared/agent-status-types.tssrc/shared/claude/claude-pinned-launch-error.test.tssrc/shared/claude/claude-pinned-launch-error.tssrc/shared/claude/project-claude-account-preference.test.tssrc/shared/claude/project-claude-account-preference.tssrc/shared/global-settings-types.tssrc/shared/launch-config-claude-account-schemas.test.tssrc/shared/protocol-version.tssrc/shared/repo-types.tssrc/shared/rpc-contract/agent-session-params.tssrc/shared/rpc-contract/client-settings-params.tssrc/shared/rpc-contract/orchestration-worker-start-params.tssrc/shared/rpc-contract/repo-update-params.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/rpc-contract/worktree-create-params.tssrc/shared/sleeping-agent-launch-config.tssrc/shared/tui-agent-resume-startup.tssrc/shared/workspace-session-sleeping-agents.tstests/e2e/fixtures/per-project-claude-account/claudetests/e2e/per-project-claude-account.spec.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.
There was a problem hiding this comment.
✅ No new code to review — the rebase replayed the same 15 commits.
Reviewed changes
The branch was rebased between reviews: every PR-authored commit SHA changed (4f038e1..6ff581f → c730a07..2cd7c2d), but pullfrog_checkout_pr returned incrementalDiffPath: null and the two diffPath payloads are byte-identical. No PR-authored file changed, so the prior review stands and there is nothing new to flag.
The two minor suggestions from the previous review remain open and are unaffected by the rebase: the owner-routed roster fetch in use-claude-tab-account-label.ts, and the explicitAccountId sentinel guard in resolveProjectClaudeAccount.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new WSL path launches unpinned, but the renderer still records and displays the project's saved account for those tabs.
Reviewed changes
This run reviewed the two commits that landed since the prior pullfrog review (2cd7c2d7a44):
- Merged
origin/main(2783aaf77e8), resolving 13 conflicts: kept the branch's--accountCLI note and pinned-spawn mark-first/release alongside main'szcodedocs,workspacePathlaunch-mode field, thepersistPtyIpcSpawnCommit/publishPtyIpcSpawnCommitsplit, and main's removal of theactivatelaunch arg. - Guarded the explicit sentinel in
resolveProjectClaudeAccount, so an explicit__active__never falls through to the project default (prior review item). - Routed the tab tooltip's account roster through
getRepoOwnerRoutedSettings(settings, repo), matching the settings section and launch prompt (prior review item). - Made WSL launches resolve unpinned: the resolver returns
undefinedfor a WSL target (recorded and saved defaults are ignored; explicit--accountstill resolves), and both spawn lanes now resolve the account after the terminal target is known.
ℹ️ WSL now falls back to the active account instead of refusing
The new commit reverses the earlier WSL behavior: a project with a saved account no longer refuses, it launches unpinned on the active account. That is a deliberate, documented choice (WSL cannot pin), but it contradicts the PR's "a refusal never falls back to another account silently" principle, and the description still lists WSL among the cases that show a refusal with "Start on active account".
Technical details
# WSL silently falls back to the active account
## Affected sites
- `src/main/claude-accounts/project-claude-account-resolution.ts:24` — a WSL target short-circuits recorded and saved defaults to `undefined`.
- `src/main/ipc/pty/ipc/spawn-preflight.ts:226` and `src/main/ipc/pty/runtime/spawn-preflight.ts:132` — both lanes resolve the account after the terminal target, so no refusal fires for a WSL default.
## Required outcome
- Confirm the silent fallback is intended for WSL, and update the PR description (and the `unsupported-host` copy's scope, now reachable only via an explicit `--account`) so the documented behavior matches the code.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (442fcb6). The rest of the PR was covered in earlier runs and is unchanged.
- Stopped recording a saved account where it cannot be pinned:
stampClaudeLaunchAccountnow skips the project's saved default for an SSH or WSL repo (viaclaudeAccountPinningUnsupportedReasonInState), while still recording an explicit pick so main refuses it with its own message. - Hid the tab account label for every unpinnable repo:
claudeTabAccountLabeltakespinningUnsupportedinstead ofisSshRepo, anduseClaudeTabAccountLabelderives it from the same helper the settings section and launch prompt already use. This closes the false label for WSL tabs, where main launches unpinned on the active account.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
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: 21821d13-d394-4c0b-90e9-358ae1c6e365
📒 Files selected for processing (49)
docs/reference/agent-status-store.mdsrc/cli/specs/orchestration-worker-specs.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-mode.tssrc/main/claude-accounts/claude-pty-account-registries-startup.tssrc/main/claude-accounts/project-claude-account-resolution.test.tssrc/main/claude-accounts/project-claude-account-resolution.tssrc/main/codex/codex-persistent-command-retention.test.tssrc/main/ipc/pty/ipc/spawn-commit.tssrc/main/ipc/pty/ipc/spawn-preflight.tssrc/main/ipc/pty/ipc/spawn-run.tssrc/main/ipc/pty/runtime/spawn-claude-account.tssrc/main/ipc/pty/runtime/spawn-commit.tssrc/main/ipc/pty/runtime/spawn-preflight.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/native-chat/agent-session-wire/agent-session-empty-delta-retention.test.tssrc/main/persistence/loading-store/profile-state-sqlite-authority.test.tssrc/main/persistence/profile-state/profile-state-authority-bootstrap.test.tssrc/main/persistence/profile-state/profile-state-live-store-factory.test.tssrc/main/runtime/orca-runtime-get-agent-session-execution-namespace.tssrc/main/runtime/orca-runtime-tests/claude-account-agent-session-lanes.spec.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/workers.tssrc/main/startup/main-process-ready-foundation.tssrc/main/window/attach-main-window-services.tssrc/renderer/src/components/tab-bar/use-claude-tab-account-label.tssrc/renderer/src/components/terminal-pane/TerminalPaneSurface.tsxsrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-process-exit-actions.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-launch-caller-profiles-test-harness.tssrc/renderer/src/lib/claude-launch-account.test.tssrc/renderer/src/lib/claude-launch-account.tssrc/renderer/src/lib/claude-tab-account-label.test.tssrc/renderer/src/lib/claude-tab-account-label.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/store/slices/agent-status-claude-account.test.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/shared/agent-launch-intent.tssrc/shared/agent-session-resume.tssrc/shared/agent-status-types.tssrc/shared/protocol-version.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- docs/reference/agent-status-store.md
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed what landed since the prior pullfrog review (1baf9ccc34): one i18n commit and a fresh origin/main merge with four conflict resolutions. Both pnpm tc:node and pnpm tc:web pass, and the PR's tests for every file touched by a conflict resolution are green (71 tests).
- Merge of
origin/main(6ce13cfe4d, main ataedb9305cd), four conflicts resolved as unions:TerminalErrorToast.tsx— kept the branch'sdescribeClaudePinnedLaunchErrorshort-circuit ahead of main's newlocalizeTerminalSpawnHints, and main'swithoutTerminalSpawnIssueRequestis still consumed bydisplayError.en.json/es.json— main'sptyAllocationLimit/terminalProcessLimitstrings unioned with the branch'sClaudePinnedLaunchblock; both files parse and carry a singleClaudePinnedLaunchkey.agent-status-sleeping-records.ts— branch'sclaudeAccountIdcarrier survives (copyLaunchConfig,withMainPinnedClaudeAccount) alongside main'sagentVerdictFields/agentTurnEndedUncleanlyverdict plumbing.
- Korean
rememberlabel reworded to a complete phrase (i18n only).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
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: 6b60d13a-672e-4bb9-b9ac-b2b430a74d36
📒 Files selected for processing (21)
docs/reference/agent-status-store.mdsrc/main/ipc/pty/runtime/spawn-commit.tssrc/main/persistence-update-repo.test.tssrc/main/persistence/tracking-repos/repo-update-operations.tssrc/main/runtime/orca-runtime-create-terminal.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/startup/main-process-ready-foundation.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.test.tssrc/renderer/src/components/terminal-pane/TerminalErrorToast.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/agent-status-recovery-equivalence.tssrc/renderer/src/store/slices/agent-status-sleeping-records.tssrc/shared/agent-session-resume.tssrc/shared/protocol-version.tssrc/shared/workspace-session-sleeping-agents.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- docs/reference/agent-status-store.md
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — the fix reads correctly; one rough edge in the new record shape inline.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (6ce13cfe4d). All prior pullfrog threads were already resolved and are unaffected.
- Stopped synthesizing a launch config to carry main's pinned account — when a restarted Claude pane has no renderer launch record,
sleepingRecordFromEntryno longer builds alaunchConfigout of today'sagentArgs/agentEnv; the account now rides the record, so resume no longer presents current settings as the session's original launch options. - Added a record-level
claudeAccountId— new optional field onSleepingAgentSessionRecordand the workspace-session schema, set top-level when no launch config exists and still merged intolaunchConfig.claudeAccountIdwhen one does. - Both resume issuers fall back to it — cold restore (
cold-restore-resume-startup.ts:100) and the generic resume path (sleeping-agent-session-launch.ts:88) resolvelaunchConfig?.claudeAccountId ?? record.claudeAccountId. - Test updated to assert the account lands on the record rather than the launch config.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (42dd573c9d). It closes the one open item from that review, and no new concerns surfaced.
- Compared the record-level pinned account in both capture-equivalence predicates —
sleepingRecordsEquivalentIgnoringCaptureTimeandrecoveryRecordMatchesnow also requireexisting.claudeAccountId === next.claudeAccountId, so a record whose account changed after a restart is no longer treated as unchanged and the stale account is replaced on capture. The comparison is consistent withlaunchConfigsEqual, which already coverslaunchConfig.claudeAccountId; a record-level vs. launch-config-level mismatch still compares unequal. - Added a regression test —
agent-status-sleep-claude-account.test.tsasserts that two records differing only in their record-levelclaudeAccountId(nolaunchConfig) are unequal under both predicates, and that a copy is equal.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
[High impact] The PR appears safe to merge based on the findings established in this review. SummaryThe PR adds per-project Claude account selection and pinned launches, including persistence, prompts, restore behavior, and refusal handling. Changes since the previous review also include CI, mobile localization, relay queue, and Windows uninstall work. No new actionable finding was established. All three previous Greptile threads are manually resolved. Reviews (13) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed what landed since the prior pullfrog review (573ff1d): a single origin/main merge whose only conflict was one renderer transport file. pnpm tc:node, pnpm tc:web, and pnpm tc:cli are clean, and the three renderer tests over the touched file pass (26 tests).
- Merged
origin/main(b9d05c0, main atd0db35c), resolving one conflict inremote-runtime-pty-transport.tsas a clean union: kept main's #23701 reattach input buffer — thewithRemoteReattachInputBufferimport and wrapper, theconnectForRecoveryindirection, and thesetConnectForRecoverymethod — alongside the branch'screateAgentSessionLaunchOptions, which carries the launch config's Claude account to a capable host.
The resolution holds up under a two-way check: the diff against the first parent shows exactly main's side, and the diff against the second parent shows exactly the branch's side. No PR-authored line was lost and no main change was dropped.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the one commit since the prior pullfrog review (b9d05c0).
- Fail closed when a crashed pinned read-back is deferred —
reconcilePinnedKeychainCredentialsnow returns'reconciled' | 'deferred', anddoSyncForCurrentSelectionthrows the existing "Unlock the Keychain and retry." error when the scoped Keychain item of a crashed pinned session cannot be read, instead of materializing the possibly-spent managed credentials onto the host. The two non-strict callers (reconcilePinnedAccountCredentials,revalidatePinnedSeedMarkers) keep ignoring the result, and the marker survives so the next launch or startup retries.
Verified: pnpm tc:node clean, the full src/main/claude-accounts suite green (284 tests), and the added test asserts the runtime credentials file is left byte-identical with the seed marker intact — it fails without the fix.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (fc4d926): an ask-on-launch project now fails closed when its Claude account roster can't load, instead of silently starting on the active account.
- Cancelled the launch when the roster fails to load — both
{ kind: 'default' }fallbacks inchooseClaudeLaunchAccountForWorkspace(thefailedProviders.includes('claude')branch and thecatch) now call a newcancelForUnavailableAccounts(), which shows an error toast and returns{ kind: 'cancelled' }. All three consumers already treat cancellation as "do not launch":launchWithClaudeAccountChoicereturns without callinglaunch,chooseClaudeLaunchAccountIdForReporeturnsnull, andquick-creation-execution.ts:133aborts the submit. - Added the localized message —
auto.components.ClaudeAccountPromptDialog.accountsUnavailablein all six locales. - Added a regression test — mocks the roster client to throw and asserts the workspace choice resolves to
{ kind: 'cancelled' }with exactly onetoast.error; the assertion holds even thoughshouldPromptForClaudeAccountwould decline a single-account prompt, because the account-count gate is only reached after a successful fetch.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed what landed since the prior pullfrog review (29c7bf41): a single origin/main merge whose four conflicts all resolved as unions, plus one small refactor. pnpm tc:node, tc:cli, and tc:web are clean, and the tests over every conflict-resolved file plus the agent-launch and worktree-startup lanes pass.
- Merged
origin/main(6cb85c2, main ata5ce8251e3, #23697 "Agent launches carry the surface that started them"), resolving four conflicts as unions so neither side is dropped:src/cli/handlers/worktree.ts— main'slaunchSource: 'cli'rides alongside the branch'sstartupClaudeAccount.worker-worktree-creation.ts— main'sstartupLaunchSource: 'orchestration'and the branch'sstartupClaudeAccountboth stay inside thewithAgentTerminalbranch.worktree-create-args.ts— bothparams.startupClaudeAccountandparams.launchSourceare mapped onto the runtime create args.worktree-create-params.ts— the branch'sstartupClaudeAccountfield and itsrequires startupAgent claudesuperRefine sit next to main'slaunchSourceparam.
- Extracted the account resolver into
OrcaRuntimeWithGetWorktreeTerminalProvisioningHost.resolveStartupClaudeAccount(request, createRouteKind), whichcreate-managed-worktree.tsnow calls; it is behavior-identical to the inlineresolveWorktreeStartupClaudeAccountcall it replaces.
The merge holds under a two-way check: git diff a5ce8251e3 6cb85c2 over the touched files contains only the branch's additions, so no main change was dropped and no branch line was lost. All prior pullfrog threads were already resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Merging origin/main added empty-workspace-default-chat to AGENT_LAUNCH_CALLER_PROFILES without bumping the census count, so agent-launch-caller-profile-census.test.ts fails on the branch (expected 14 to be 13). The fix is a one-line count bump; the detail is inline on the harness profile below.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (6cb85c2): a fresh origin/main merge (4858006, main at f4829f0). The 13 files both parents touched all resolved as unions, and pnpm tc:node, tc:web, and tc:cli are clean.
- Merged
origin/mainand resolved every both-parents file as a union, so no branch line and no main change was dropped:spawn-commit.ts— main'screateTerminalSessionStateSaveFailureMessage(error)calls alongside the branch's relocatedmarkRuntimeClaudePtySpawned.TerminalPaneSurface.tsx/use-terminal-pane-title-state.ts— main'ssessionStateSaveFailureMessagerename alongside the branch's refused-launch recovery wiring.agent-launch-caller-profiles-test-harness.ts/agent-launch-routing-caller-census.test.ts— main'sempty-workspace-default-chatentry alongside the branch'sterminal-pane-start-on-active-account.launch-agent-in-new-tab.ts— main'spendingActivationSpawnalongside the branch'sclaudeAccountId/stampClaudeLaunchAccount.- Six locale JSONs and
en-runtime-required.json— main'sTerminalSessionStateSaveFailureDialog/terminal.sessionSaveFailurekeys alongside the branch's Claude-account strings; no duplicate keys and all files parse.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (4858006). It is a test-only fix for the caller-census failure that review raised.
- Fixed the merged caller-census count —
agent-launch-caller-profile-census.test.ts:36now asserts 14 profiles. The mergedAGENT_LAUNCH_CALLER_PROFILEStable carries both main'sempty-workspace-default-chatand this branch'sterminal-pane-start-on-active-account, so the stale13failed on the branch. Verified the census test passes (32 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…t-account # Conflicts: # src/renderer/src/lib/agent-launch-caller-profile-census.test.ts # src/renderer/src/lib/agent-launch-routing-caller-census.test.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (fb34204): a fresh origin/main merge (aa7ec46, main at 6e1b7e7, #23815 "remove junk tests that assert source text"). Only two files conflicted; pnpm tc:node, tc:web, and tc:cli are clean.
- Merged
origin/main, resolving both conflicts by deletion — main removed the two caller-census test files (agent-launch-caller-profile-census.test.ts,agent-launch-routing-caller-census.test.ts), so dropping them here (and the prior commit's count bump with them) matches main's repo-wide cleanup of source-text assertions. No dangling references remain. - Kept the branch's caller profile through main's harness cleanup —
agent-launch-caller-profiles-test-harness.tsadopted main's trimmed shape (sourceMarkers/passes*/readsBackgone) while retaining the branch'sterminal-pane-start-on-active-accountprofile; the fourit.eachcaller suites still exercise all 14 profiles (308 tests green). - Preserved
claudeAccountIdthrough main's subagent refactor — the field survives onAgentStatusEntryafter main split subagent normalization intoagent-status-subagent-snapshot.ts, and stays out ofpickParsedAgentStatusPayloadexactly as before. - Unioned the locale keys — main's new strings sit alongside the branch's
ClaudePinnedLaunchblock in all six locales plusen-runtime-required.json; all files parse, no duplicate keys, no conflict markers anywhere insrc/.
Verified locally: src/main/claude-accounts suite (283 tests) and the four caller-profile suites (308 tests) pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…t-account # Conflicts: # src/main/runtime/orca-runtime-agent-session-operation.test.ts # src/main/runtime/orca-runtime-create-managed-worktree.ts # src/shared/global-settings-types.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (aa7ec46): a fresh origin/main merge (7eea324faf, main tip a57863ba16). Its three conflicts all resolved as clean unions, and pnpm tc:node, tc:web, and tc:cli are clean.
- Merged
origin/mainand resolved all three conflicts as unions — each verified two ways (git diff 7eea324 a57863bover the conflict files contains only the branch's added lines, so no main change was dropped):orca-runtime-agent-session-operation.test.ts— main's file plus the branch's two Claude-account tests; #23744 reworked trust into the spawn-time hook (agent-workspace-trust-spawn.ts) and droppedregisterAgentTrustHandlers, so the branch correctly no longer registers it.orca-runtime-create-managed-worktree.ts— main's version plus the branch's twostartupClaudeAccountIdlines; #23744'ssshConnectionId/markTrustedplumbing is gone with it, matching main.global-settings-types.ts— the branch'saskClaudeAccountPerProjectsits alongside main'sagentWorkspaceTrustEnabled.
- Kept the feature scope intact through the merge — the set of files changed versus the base is identical before and after (219 files, none dropped or gained), and no conflict markers remain anywhere in
src/. - Verified the new cross-feature integration — main's #23744 trust hook now lives in
ipc/pty/{ipc,runtime}/spawn-options.tsand runs after the branch'spreparePinnableClaudeAuthinspawn-preflight.ts, so a pinned launch still writes folder trust into its own pinned config dir. Thesrc/main/claude-accountssuite (283 tests) and the agent-workspace-trust plus pinned-spawn tests (104 tests) are green.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single commit since the prior pullfrog review (7eea324faf): a fresh origin/main merge (c5d64ed, main at 0b79720). Its 32 conflict resolutions all read as clean unions, and pnpm tc:node, tc:web, and tc:cli are clean.
- Merged
origin/mainand resolved every both-parents file as a union, verified two ways (git diff 0b79720 c5d64edover the conflict files contains only branch additions, so no main line was dropped;git diff 7eea324 c5d64edcontains only main's changes, so no branch line was lost):agent-hooks.ts/register-core-handlers.ts— main's newagentStatus:hasVerifiableAgentProcesshandler andensureStructuredAgentSessionHostUnlessRefusedsit alongside the branch'swithPinnedClaudeAccountroster stamping andgetPersistedTerminalLayoutslookup.orca-runtime-create-terminal.ts/local-worker-start.ts/main-process-account-services.ts/attach-main-window-services.ts/main-process-runtime-service.ts— main's paired viewer colours,invalidateAuthorizedRootsCacheForRepo, dispatch-capability removal, and real-home hooks reader ride alongside the branch'sclaudeAccountIdlaunch threading.SortableTab.tsx— main'suseTabStripSlotProps/TAB_CONTAINER_WIDTH_CLASSESalongside the branch'suseClaudeTabAccountLabeland tooltip account suffix.docs/reference/agent-status-store.mdand the seven locale JSONs — main's agent-verdict and native-chat rewrites unioned with the branch's pinned-Claude-account section and strings; every file parses with no duplicate keys.accounts-pane-claude-section.test.tsx— the branch-only test model picked up main's newminiMaxApiKeyProtection/miniMaxCookieProtectionfields so it still type-checks.
Verified locally: no conflict markers anywhere in src/, pnpm tc:node / tc:web / tc:cli all clean, src/main/claude-accounts (283 tests), the tab-bar suites (565 tests), and the tests over every conflict-resolved file pass. All prior pullfrog threads are [RESOLVED].
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…t-account # Conflicts: # src/main/window/attach-main-window-services.ts
…t-account # Conflicts: # src/main/agent-launch/agent-launch-mode.ts
…t-account # Conflicts: # src/shared/agent-session/lifecycle/agent-session-resume.ts # src/shared/agent-session/lifecycle/resume/agent-resume-record-from-status.ts # src/shared/agent-session/lifecycle/resume/sleeping-agent-launch-config.ts
…t-account # Conflicts: # src/main/runtime/session-lifecycle/projection/claude-running-pane-account-move.ts
…t-account # Conflicts: # src/shared/rpc-contract/client-ui/client-settings-params.ts # src/shared/rpc-contract/orchestration/orchestration-worker-start-params.ts # src/shared/rpc-contract/terminal/agent-session-params.ts # src/shared/rpc-contract/workspaces/worktree-create-params.ts
…t-account # Conflicts: # src/shared/workspace-session/workspace-session-sleeping-agents.ts
…t-account # Conflicts: # src/main/runtime/rpc/methods/orchestration/worker/follow-up/worker-earlier-work.ts
…t-account # Conflicts: # src/cli/orchestration/workers/worker-launch-handler.ts
…t-account # Conflicts: # src/main/runtime/rpc/methods/orchestration/worker/start/local-worker-start.ts # src/main/runtime/rpc/methods/orchestration/worker/worker-start-method.ts
…chema lazily Main's zod-prefer-lazy-ratchet refuses eager top-level Zod schemas; the branch's TerminalLaunchConfigParam now uses lazyZodSchema like the rest of the RPC contract.
…restarts and cold restore orcad never seeded the pinned-PTY registry, so after a restart its surviving --account panes looked unpinned and an account switch could move them; it now seeds from its own data folder before the backend starts. Cold restore of a live pane read the pinned account only from the live launch config or the sleep record's top level, missing a record that carries it inside its launchConfig.
…ndow account switches Switching the Claude account in the window restarted every local pane on the outgoing account, pinned ones included, which moved a pinned pane off its account. The host path already skips pinned panes; the renderer scan now does too, using the same pin source the tab label reads (status row, then launch config, honouring SSH/WSL and the active sentinel). Pinned panes are left out of the move and the cannot-move list: they are not stranded, they are working as pinned. Account-restart resume startups for Claude also carry the pinned account id, as cold restore does, so a restart from another path keeps the pin.
…e pane unpinned on account restart A pane started on the active account carries ACTIVE_CLAUDE_ACCOUNT; dropping it let the restart fall through to the project's saved account instead of the one the window switched to.
…kspace in a pinned project up front The pinned-account refusal only looked at an existing workspace, so a chat worker creating a new workspace in a pinned repo created the worktree first and then silently became a terminal. A repoSelector place now resolves its repo through showRepo and reads the saved account through the same resolver, so the refusal happens before anything is created. An unresolvable selector stays unrefused; the post-creation re-check still covers it.
…lacement cannot honor A follow-up keeps the account its worker started on. A reused terminal or chat, a reopened chat, a reopened terminal and a fresh start with an earlier account all ignore or overwrite the caller's --account without a word. Refuse it right after placement, comparing resolved ids so an email of the same account still passes, and still allow it on a fresh start whose earlier worker had no account.
No path can send a follow-up with a caller --account: the only follow-up start (send and settled follow-through) builds its own params without one, so the guard was dead code.
…er test for what happens A worker preflight has no settlement context, so the pinned project turns the chat into a terminal before the workspace is created rather than refusing it.
…t-account # Conflicts: # src/main/runtime/rpc/methods/orchestration/worker/follow-up/worker-earlier-work.ts # src/main/runtime/rpc/methods/orchestration/worker/start/local-worker-start.ts
…t-account # Conflicts: # src/main/runtime/session-lifecycle/projection/restart-agent-pane-in-place.ts # src/shared/rpc-contract/terminal/terminal-unary-params.ts
…t-account # Conflicts: # src/main/ipc/register-core-handlers/register-core-handlers.ts # src/renderer/src/components/terminal-pane/errors/TerminalErrorToast.tsx # src/renderer/src/i18n/locales/en.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
…t-account # Conflicts: # src/main/ipc/register-core-handlers/register-core-handlers.ts # src/renderer/src/components/terminal-pane/controller/TerminalPaneSurface.tsx
…t-account # Conflicts: # src/renderer/src/components/agent/launch-menu/AgentMenuItems.tsx
…t-account # Conflicts: # src/renderer/src/components/agent/launch-menu/use-tab-agent-menu-launch.ts
…t-account # Conflicts: # src/renderer/src/i18n/locales/ko.json
…t-account # Conflicts: # src/main/runtime/workspaces/startup/workspace-terminal-provisioning.ts
…t-account # Conflicts: # src/main/window/attach-main-window-services.ts
…t-account # Conflicts: # src/renderer/src/i18n/locales/ja.json
… active account across restarts A pane started on the active account recorded nothing in the main pinned-PTY registry, so after Orca restarted (always on Windows, where the renderer's launch config does not survive) restart-in-place fell back to the project's saved account. Spawns that chose the active account now record ACTIVE_CLAUDE_ACCOUNT per PTY. The pinned lookup still reports these panes as unpinned for labels and account moves; only restart-in-place reads the recorded choice.
…ntime spawn honours
…t-account # Conflicts: # src/main/agent-launch/agent-launch-mode-wording.ts # src/main/agent-launch/agent-launch-mode.ts # src/main/runtime/construction/orca-runtime-terminal-worker-restart-resume.ts # src/main/runtime/session-lifecycle/projection/restart-agent-pane-in-place.ts # src/main/startup/runtime-startup/main-process-runtime-launch.ts # src/renderer/src/App.tsx # src/renderer/src/components/settings/accounts/claude/accounts-pane-claude-section.tsx # src/renderer/src/i18n/locales/es.json # src/shared/agent-launch/contracts/agent-launch-intent.ts # src/shared/remote-runtime/protocol/account-runtime-capabilities.ts
…t-account # Conflicts: # src/cli/specs/worktree-create.ts

ELI5
If you use Claude with more than one account (say work and personal), Orca today has one "active" account for everything, so you have to remember to switch before working in each project, and switching affects every project at once. This PR lets each project remember its Claude account. Optionally, Orca asks the first time you start Claude in a project and remembers your choice, so work repos always start on the work account and personal repos on the personal one, even side by side. If the saved account can't be used, Claude doesn't quietly start on a different account; the pane explains why and lets you start on the active account for that one launch.
What Changed
Before: one global Claude account per machine. Every Claude tab, workspace and resume used whichever account was selected when it started. #22691 adds
--accountfor the CLI and RPC only; the desktop app's launches (new tab, ⌘⌥T, New Workspace, resume) can't use it.After, for the user:
Default·Ask every time· each signed-in Claude account. Disabled for SSH and WSL projects, with a note.Mechanism:
Repo.agentAccounts.claude = { mode: 'ask' } | { mode: 'account', accountId }, round-tripped likeghAccount(feat(github): bind projects to a specific gh account #13664): persistence, IPC, therepo.updateschema (nullclears).SleepingAgentLaunchConfig.claudeAccountIdcarries a launch's account (or an "active this time" sentinel), so resume and restore replay it. A status row carries no account once its pane's process is gone (a sleeping Done row republished after a reload or restart), so a resume record rebuilt for the same conversation keeps the saved record's account instead of losing it.prepareForClaudeLaunch(target, { accountId })sets up that account's folder (claude-profiles/<id>/home, via the router's newprepareAccountLaunch) and pointsCLAUDE_CONFIG_DIRat it. The pane gets no which-account pointer, so main'sclaudeshell function isn't defined there and a later switch can't redirect it. The selected account takes main's normal path. Because nothing is copied, there are no reservations, Keychain seeding, read-back or switch guards.[claude_pinned:<code>]token (account-missing,provenance,unsupported-host) so the renderer can localize them; the CLI and mobile strip it from human output (--jsonkeeps it).claudeAccountIdonto agent-status rows from it, and the tab label reads that.terminal.createAgentSession/ensureAgentSessioncarry the account only to hosts advertising the newagent-session.claude-account.v1capability (their params are strict, so older hosts would otherwise reject the launch).resolvePlannedRoute, including Continue's menu pick, so a pinned project gets a terminal. An in-place Source Control section launch is placed in its folder, so account lookups use itstrustWorktreeId(the section's own worktree).agentLaunch) refused for its account reports the refusal itself instead of the generic pane-refused code, so the pane can offer the fix. Its retry carriesreplacesRefusedLaunchso the refusal recorded for that pane doesn't block it, and the host's plan keeps the retry's "active this time" choice.pinned_claude_accountreason), and a structured → terminal handoff keeps the session's own account. A pinned launch also skips the new-tab wait for a host's agent list, since it is a terminal whatever the host answers.Why
Defaultkeeps today's behavior, so users who don't use it see no change.Linked Issue
Fixes #23227
Visual Proof
Settings → Repository has no Claude account choice
New "Claude Account" section: Default / Ask every time / each account
"+ → Claude" starts on the global account with no choice
With "ask" on, a prompt picks the account (Remember for this project)
Tab tooltip shows no account
A pinned tab shows its account email
If the saved account can't be used: explanation + Start on active account
The refused pane restarted in place on the active account
Testing
I manually tested these changes locally
Automated tests added/updated
Unit and integration tests:
e2e:
tests/e2e/per-project-claude-account.spec.tsruns the real app hidden, with fake managed accounts and a stand-inclaude. It checks the settings options, the prompt, Remember, that the pinnedCLAUDE_CONFIG_DIRis the account's own folder (set up on first use), no re-prompt plus the tab label, and a refusal restarting in place on the active account. It runs on Linux CI and skips on macOS and Windows. Screenshots are written only whenORCA_PER_PROJECT_CLAUDE_ACCOUNT_SCREENSHOT_DIRis set.Manual: to re-run on the account-folder rebuild (the earlier manual runs were on the credential-copying design): two projects on two accounts at once with
/statusconfirming each, a one-time pick versus Remember, the prompt over New Workspace and Cancel creating nothing, a refusal and in-place restart, switching the selected account while a pinned tab runs, and an app restart bringing pinned tabs back on their accounts with labels.Platforms: macOS (manual, to re-run). Linux runs in CI (e2e). Windows: unit tests only; the e2e skips there (the stand-in
claudeis POSIX). WSL projects are deliberately not pinned. SSH projects are never pinned (covered by tests).pnpm tcpasses.pnpm check:changedpasses except for the agent-hooks server suites (src/main/agent-hooks/server/testing/**), which fail with "unable to open database file" in this environment and also fail on a cleanmain.AI Disclosure
Built with Claude Code (Claude Opus 5.5, with Sonnet 5 / Haiku 4.5 sub-agents for smaller tasks): design, implementation, tests and reviews, including the rebuild on main's account folders. Every change was reviewed and tested by me.
Review
AI review summary:
agentAccounts.claude) for later agents. Non-Claude terminals take the same code path as before.Dialog/Select/Checkbox/Switch; strings throughtranslatein all 5 locales; design-system lint clean on changed lines.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Known limitations
Related: #22893 (opt-in isolation from external agent config) is complementary: pinned sessions run in their account's own folder and never write to
~/.claude.Follow-ups: WSL pinning on main's WSL account folders, per-worktree overrides, project-group inheritance (#6921 discussion), per-account usage bars, and Codex once it has a per-launch account primitive.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) (pnpm check:changedruns lint, typecheck and tests on the changed files; the fullpnpm buildwasn't run locally, CI covers it)