Repository navigation
Re-land Claude per-account folders (#24434, #26405) with the upgrade and proxy fixes - #26801
Conversation
…tion v43 daemons (the revert) lack the claude account function, so new terminals must not reuse them. v42 and v43 stay attachable.
# Conflicts: # src/main/claude/claude-structured-launch-resolution.ts # src/renderer/src/components/native-chat/NativeChatNoticeRow.tsx # src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx # src/renderer/src/i18n/en-runtime-required.json
|
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. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughClaude account sign-in now uses dedicated profile folders and runtime APIs. Profile routing and setup support host and WSL accounts. Account listings, settings, native chat, and the status bar expose sign-in state. Usage fetching reads profile credentials. The changes also remove managed-auth synchronization and live-PTY refresh gating, and add detection and notices for terminals opened before per-account folders were introduced. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 47.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 82 functions across 56 files. (7 skipped: 7 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
eae53e32-9943-46b2-a190-2fccb9035e26
⛔ Files ignored due to path filters (1)
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (267)
.github/workflows/pr.ymlconfig/scripts/claude-account-windows-spawn-repro.mjsconfig/scripts/node-pty-windows-pty-teardown-patch.test.mjssrc/cli/handlers/account-list-format.tssrc/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/main/__fixtures__/shell-wrapper-snapshots/daemon-bash-rcfile.txtsrc/main/__fixtures__/shell-wrapper-snapshots/daemon-fish-init.txtsrc/main/__fixtures__/shell-wrapper-snapshots/daemon-zsh-zshenv.txtsrc/main/__fixtures__/shell-wrapper-snapshots/local-bash-rcfile.txtsrc/main/__fixtures__/shell-wrapper-snapshots/local-fish-init.txtsrc/main/__fixtures__/shell-wrapper-snapshots/local-zsh-zshenv.txtsrc/main/__fixtures__/shell-wrapper-snapshots/relay-zsh-zshenv.txtsrc/main/agent-auth-restart-preservation.test.tssrc/main/agent-auth-restart-preservation.tssrc/main/claude-accounts/claude-account-folder.test.tssrc/main/claude-accounts/claude-account-folder.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-add-account.test.tssrc/main/claude-accounts/claude-account-service-api-parity.test.tssrc/main/claude-accounts/claude-account-service-config-dir-capture.test.tssrc/main/claude-accounts/claude-account-service-credential-capture.test.tssrc/main/claude-accounts/claude-account-service-login-process.test.tssrc/main/claude-accounts/claude-account-service-reauth-rollback.test.tssrc/main/claude-accounts/claude-account-service-test-harness.tssrc/main/claude-accounts/claude-account-service.test.tssrc/main/claude-accounts/claude-auth-capture.tssrc/main/claude-accounts/claude-command-process.test.tssrc/main/claude-accounts/claude-command-process.tssrc/main/claude-accounts/claude-credential-persistence-ratchet.test.tssrc/main/claude-accounts/claude-login-completion.oracle.test.tssrc/main/claude-accounts/claude-login-session.tssrc/main/claude-accounts/claude-managed-auth-storage.tssrc/main/claude-accounts/claude-profile-installed-router.tssrc/main/claude-accounts/claude-profile-paths.test.tssrc/main/claude-accounts/claude-profile-paths.tssrc/main/claude-accounts/claude-profile-provisioning.test.tssrc/main/claude-accounts/claude-profile-provisioning.tssrc/main/claude-accounts/claude-profile-router.test.tssrc/main/claude-accounts/claude-profile-router.tssrc/main/claude-accounts/claude-profile-setup.test.tssrc/main/claude-accounts/claude-profile-setup.tssrc/main/claude-accounts/claude-profile-shell-composition.test.tssrc/main/claude-accounts/claude-profile-wsl-paths.tssrc/main/claude-accounts/claude-profile-wsl-router.test.tssrc/main/claude-accounts/claude-profile-wsl-router.tssrc/main/claude-accounts/claude-windows-interactive-login.test.tssrc/main/claude-accounts/environment.tssrc/main/claude-accounts/keychain.test.tssrc/main/claude-accounts/keychain.tssrc/main/claude-accounts/live-pty-gate.test.tssrc/main/claude-accounts/live-pty-gate.tssrc/main/claude-accounts/managed-auth-path.tssrc/main/claude-accounts/oauth-refresh.test.tssrc/main/claude-accounts/oauth-refresh.tssrc/main/claude-accounts/runtime-auth-path-materialization.test.tssrc/main/claude-accounts/runtime-auth-service-account-switching.test.tssrc/main/claude-accounts/runtime-auth-service-deselect-restore.test.tssrc/main/claude-accounts/runtime-auth-service-keychain-snapshots.test.tssrc/main/claude-accounts/runtime-auth-service-launch-refresh.test.tssrc/main/claude-accounts/runtime-auth-service-materialization.test.tssrc/main/claude-accounts/runtime-auth-service-readback-identity.test.tssrc/main/claude-accounts/runtime-auth-service-shared-credential-failures.test.tssrc/main/claude-accounts/runtime-auth-service-shared-credentials.test.tssrc/main/claude-accounts/runtime-auth-service-snapshot-validation.test.tssrc/main/claude-accounts/runtime-auth-service-test-harness.tssrc/main/claude-accounts/runtime-auth-service-wsl-runtime.test.tssrc/main/claude-accounts/runtime-auth-service.test.tssrc/main/claude-accounts/runtime-auth-service.tssrc/main/claude-accounts/runtime-auth-shared-credentials-fixture.tssrc/main/claude-accounts/runtime-auth/runtime-auth-credential-identity.tssrc/main/claude-accounts/runtime-auth/runtime-auth-credential-matching.tssrc/main/claude-accounts/runtime-auth/runtime-auth-file-storage.tssrc/main/claude-accounts/runtime-auth/runtime-auth-keychain-snapshots.tssrc/main/claude-accounts/runtime-auth/runtime-auth-managed-credentials.tssrc/main/claude-accounts/runtime-auth/runtime-auth-preparation.tssrc/main/claude-accounts/runtime-auth/runtime-auth-readback.tssrc/main/claude-accounts/runtime-auth/runtime-auth-runtime-state.tssrc/main/claude-accounts/runtime-auth/runtime-auth-snapshot-capture.tssrc/main/claude-accounts/runtime-auth/runtime-auth-snapshot-restore.tssrc/main/claude-accounts/runtime-auth/runtime-auth-state.tssrc/main/claude-accounts/runtime-auth/runtime-auth-sync.tssrc/main/claude-accounts/runtime-auth/runtime-auth-types.tssrc/main/claude-accounts/runtime-paths.test.tssrc/main/claude-accounts/runtime-paths.tssrc/main/claude-accounts/service.tssrc/main/claude-accounts/shared-credential-fields.test.tssrc/main/claude-accounts/shared-credential-fields.tssrc/main/claude-accounts/shared-credential-reconciliation.test.tssrc/main/claude/claude-model-catalog-probe.tssrc/main/claude/claude-stream-json-connection.test.tssrc/main/claude/claude-stream-json-connection.tssrc/main/claude/claude-structured-auth-parity.test.tssrc/main/claude/claude-structured-effort-default-at-rest.test.tssrc/main/claude/claude-structured-launch-account-routing.test.tssrc/main/claude/claude-structured-launch-home.tssrc/main/claude/claude-structured-launch-resolution.test.tssrc/main/claude/claude-structured-launch-resolution.tssrc/main/claude/claude-structured-session-acquisition.tssrc/main/daemon/daemon-foreground-confirmation-protocol.test.tssrc/main/daemon/daemon-init-provider-installation.test.tssrc/main/daemon/daemon-protocol-version.tssrc/main/daemon/daemon-provider-init.tssrc/main/daemon/daemon-provider-state.tssrc/main/daemon/pty-subprocess/shell-launch-plan.tssrc/main/ipc/claude-accounts.tssrc/main/ipc/pty-listener-teardown-and-orphans.test.tssrc/main/ipc/pty-spawn-env-terminal-basics.test.tssrc/main/ipc/pty/ipc/claude-old-terminal.test.tssrc/main/ipc/pty/ipc/claude-old-terminal.tssrc/main/ipc/pty/ipc/spawn-commit.tssrc/main/ipc/pty/ipc/spawn-env.tssrc/main/ipc/pty/ipc/spawn-preflight.tssrc/main/ipc/pty/provider/bind-listeners.tssrc/main/ipc/pty/provider/liveness.tssrc/main/ipc/pty/provider/local-configure.tssrc/main/ipc/pty/provider/state-cleanup.tssrc/main/ipc/pty/register-handlers.tssrc/main/ipc/pty/runtime/spawn-commit.tssrc/main/ipc/pty/runtime/spawn-preflight-requested-shell.test.tssrc/main/ipc/pty/runtime/spawn-preflight.tssrc/main/macos-keychain/generic-password.test.tssrc/main/macos-keychain/generic-password.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adapter.tssrc/main/native-chat/agent-session-wire/structured-agent-session-failure-text.tssrc/main/native-chat/agent-session-wire/structured-agent-session-pre-spawn-first-answer.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-queued-mutations.tssrc/main/native-chat/claude-structured-managed-account-support.test.tssrc/main/native-chat/claude-structured-managed-account-support.tssrc/main/native-chat/structured-agent-session-create-support.test.tssrc/main/native-chat/structured-agent-session-create-support.tssrc/main/persistence-worktree-lineage-and-backups.test.tssrc/main/persistence/leasing-ssh-ptys/ssh-target-state.tssrc/main/persistence/loading-store/normalize-loaded-profile-state.tssrc/main/persistence/loading-store/profile-state-direct-flush.test.tssrc/main/persistence/loading-store/ssh-profile-operations.tssrc/main/persistence/loading-store/store-domain-composition.tssrc/main/persistence/restoring-sessions/pane-alias-normalization.tssrc/main/providers/local-pty-windows-spawn-environment.tssrc/main/providers/windows-shell-args.test.tssrc/main/providers/windows-shell-args.tssrc/main/rate-limits/claude-active-usage-fetch.tssrc/main/rate-limits/claude-cli-usage-fetch.tssrc/main/rate-limits/claude-fetcher-cli-fallback.test.tssrc/main/rate-limits/claude-fetcher-fable-usage.test.tssrc/main/rate-limits/claude-fetcher-keychain-credentials.test.tssrc/main/rate-limits/claude-fetcher-managed-account-usage.test.tssrc/main/rate-limits/claude-fetcher-test-harness.tssrc/main/rate-limits/claude-fetcher.tssrc/main/rate-limits/claude-managed-account-credentials.tssrc/main/rate-limits/claude-managed-account-usage.tssrc/main/rate-limits/claude-managed-usage-panel.tssrc/main/rate-limits/claude-oauth-credentials.tssrc/main/rate-limits/claude-oauth-recovery.tssrc/main/rate-limits/claude-oauth-usage-extra-usage.test.tssrc/main/rate-limits/claude-profile-usage.test.tssrc/main/rate-limits/claude-pty-reset-parser.tssrc/main/rate-limits/claude-pty-stop-markers.tssrc/main/rate-limits/claude-pty-usage-parser.tssrc/main/rate-limits/claude-pty.test.tssrc/main/rate-limits/claude-pty.tssrc/main/rate-limits/claude-usage-error-classification.test.tssrc/main/rate-limits/claude-usage-error-classification.tssrc/main/rate-limits/claude-usage-refresh-plan.test.tssrc/main/rate-limits/claude-usage-refresh-plan.tssrc/main/rate-limits/claude-usage-result.tssrc/main/rate-limits/hidden-pty-cleanup.test.tssrc/main/rate-limits/hidden-pty-cleanup.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service/service-account-refresh.tssrc/main/rate-limits/service/service-fetch-policy.tssrc/main/runtime/orca-runtime-get-structured-agent-session-create-support.tssrc/main/runtime/orca-runtime-get-worktree-ps.tssrc/main/runtime/orca-runtime-structured-claude-account-gate.test.tssrc/main/runtime/orca-runtime-structured-claude-gate-wiring.test.tssrc/main/runtime/rpc/methods/accounts.test.tssrc/main/runtime/rpc/methods/accounts.tssrc/main/runtime/runtime-account-controller.tssrc/main/runtime/runtime-service-command-surface.tssrc/main/runtime/structured-agent-create-support-opencode-rig.test.tssrc/main/runtime/structured-agent-launch-support.tssrc/main/runtime/structured-agent-runtime-registrations.tssrc/main/runtime/structured-agent-session-runtime.tssrc/main/runtime/structured-claude-runtime-adapter.tssrc/main/shell-wrapper-generated-file-snapshot.test.tssrc/main/startup/main-process-account-services.tssrc/main/startup/main-process-ready-foundation.tssrc/main/startup/main-process-ready-identity-write.test.tssrc/main/startup/main-window-core-services.test.tssrc/main/startup/main-window-core-services.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-stream-and-serialization.tssrc/renderer/src/app-shell/use-app-shell-services.tssrc/renderer/src/components/native-chat/NativeChatNoticeRow.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/agent-session-failure-words-text.tssrc/renderer/src/components/native-chat/native-chat-claude-sign-in.test.tsxsrc/renderer/src/components/native-chat/native-chat-claude-sign-in.tssrc/renderer/src/components/native-chat/native-chat-structured-session-notices.tssrc/renderer/src/components/settings/accounts-pane-account-actions.tssrc/renderer/src/components/settings/accounts-pane-claude-section.test.tsxsrc/renderer/src/components/settings/accounts-pane-claude-section.tsxsrc/renderer/src/components/settings/accounts-pane-removal-dialogs.tsxsrc/renderer/src/components/status-bar/ClaudeSwitcherMenu.tsxsrc/renderer/src/components/status-bar/InlineProviderUsage.tsxsrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/StatusBarSurface.tsxsrc/renderer/src/components/status-bar/claude-status-sign-in.test.tsxsrc/renderer/src/components/status-bar/inline-usage-bars.test.tsxsrc/renderer/src/components/status-bar/status-bar-claude-accounts.tssrc/renderer/src/components/status-bar/status-bar-runtime-groups.test.tssrc/renderer/src/components/status-bar/status-bar-runtime-targets.tssrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/components/status-bar/usage-roster-row-state.test.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/components/terminal-pane/ClaudeOldTerminalBanner.tsxsrc/renderer/src/components/terminal-pane/CodexOldTerminalDialog.tsxsrc/renderer/src/components/terminal-pane/CodexSharedServerBanner.tsxsrc/renderer/src/components/terminal-pane/OldTerminalDialog.tsxsrc/renderer/src/components/terminal-pane/PaneTopWarningBanner.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneRuntimePortals.tsxsrc/renderer/src/components/terminal-pane/claude-old-terminal-banner.test.tsxsrc/renderer/src/components/terminal-pane/open-terminal-beside-tab.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/claude-account-sign-in-notice.test.tssrc/renderer/src/lib/claude-account-sign-in-notice.tssrc/renderer/src/lib/claude-account-sign-in.tssrc/renderer/src/store/slices/ui-notice-dismissals.test.tssrc/renderer/src/store/slices/ui/ui-slice-contract-contextual.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/renderer/src/store/slices/ui/ui-slice-trust-actions.tssrc/renderer/src/web/preload-api/web-terminal-api.tssrc/shared/agent-session-failure-copy.tssrc/shared/agent-session-failure-words.tssrc/shared/agent-session-failure.tssrc/shared/agent-session-refusal-details.tssrc/shared/agent-session-refusal-reason-words.tssrc/shared/claude-profile-activation-contract.test.tssrc/shared/claude-profile-routing.tssrc/shared/claude-shell-function.test.tssrc/shared/claude-shell-function.tssrc/shared/constants.tssrc/shared/global-settings-types.tssrc/shared/local-build-compatibility-contract.jsonsrc/shared/local-build-compatibility-contract.tssrc/shared/managed-account-types.tssrc/shared/persisted-state-types.tssrc/shared/persisted-ui-state-types.tssrc/shared/protocol-version.tssrc/shared/rate-limit-types.tssrc/shared/rpc-contract/accounts-params.tssrc/shared/rpc-contract/client-ui-params.tssrc/shared/structured-agent-session-dispatch-rejection.tssrc/shared/wsl-login-shell-command.ts
💤 Files with no reviewable changes (86)
- src/main/claude-accounts/claude-account-service-login-process.test.ts
- src/main/claude-accounts/runtime-auth-service-wsl-runtime.test.ts
- src/main/claude-accounts/runtime-auth-service-materialization.test.ts
- src/main/native-chat/claude-structured-managed-account-support.test.ts
- src/main/claude-accounts/claude-account-service-config-dir-capture.test.ts
- src/main/claude-accounts/claude-account-service-add-account.test.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-keychain-snapshots.ts
- src/shared/constants.ts
- src/main/runtime/orca-runtime-get-worktree-ps.ts
- src/main/startup/main-process-account-services.ts
- src/main/claude-accounts/shared-credential-fields.test.ts
- src/main/claude-accounts/claude-account-service-credential-capture.test.ts
- src/main/claude-accounts/oauth-refresh.test.ts
- src/main/claude-accounts/runtime-auth-service-keychain-snapshots.test.ts
- src/main/claude/claude-stream-json-connection.test.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-preparation.ts
- src/main/ipc/pty-listener-teardown-and-orphans.test.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-runtime-state.ts
- src/main/claude-accounts/claude-account-service-account-selection.test.ts
- src/main/claude-accounts/runtime-auth-service-readback-identity.test.ts
- src/main/claude-accounts/shared-credential-reconciliation.test.ts
- src/main/claude-accounts/claude-account-service-test-harness.ts
- config/scripts/claude-account-windows-spawn-repro.mjs
- src/main/ipc/pty/runtime/spawn-commit.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-state.ts
- src/main/claude-accounts/claude-account-service-api-parity.test.ts
- src/main/persistence/loading-store/profile-state-direct-flush.test.ts
- src/main/claude-accounts/runtime-auth-service-launch-refresh.test.ts
- src/main/claude/claude-stream-json-connection.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-credential-identity.ts
- src/main/claude/claude-model-catalog-probe.ts
- src/main/daemon/daemon-init-provider-installation.test.ts
- src/main/claude-accounts/runtime-auth-shared-credentials-fixture.ts
- src/main/claude-accounts/claude-account-service-reauth-rollback.test.ts
- src/shared/rate-limit-types.ts
- src/main/startup/main-window-core-services.test.ts
- src/main/claude-accounts/runtime-paths.test.ts
- src/main/ipc/pty/ipc/spawn-commit.ts
- src/main/native-chat/agent-session-wire/structured-agent-session-queued-mutations.ts
- src/main/ipc/pty/provider/state-cleanup.ts
- src/main/persistence-worktree-lineage-and-backups.test.ts
- src/main/runtime/structured-agent-runtime-registrations.ts
- src/main/startup/main-process-ready-identity-write.test.ts
- src/main/ipc/pty/provider/local-configure.ts
- src/main/ipc/pty/runtime/spawn-preflight.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-managed-credentials.ts
- src/main/claude-accounts/runtime-auth-service-snapshot-validation.test.ts
- src/main/claude-accounts/live-pty-gate.test.ts
- src/main/claude-accounts/runtime-auth-service-test-harness.ts
- src/main/ipc/pty/provider/liveness.ts
- src/main/claude-accounts/runtime-auth-service-account-switching.test.ts
- src/main/claude-accounts/runtime-auth-service-deselect-restore.test.ts
- src/main/ipc/pty/ipc/spawn-preflight.ts
- src/main/rate-limits/service/service-account-refresh.ts
- src/main/ipc/pty/provider/bind-listeners.ts
- src/main/claude-accounts/claude-login-completion.oracle.test.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-file-storage.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-snapshot-capture.ts
- src/main/persistence/loading-store/normalize-loaded-profile-state.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-snapshot-restore.ts
- src/main/claude-accounts/runtime-auth-path-materialization.test.ts
- src/main/claude-accounts/runtime-paths.ts
- src/main/claude-accounts/runtime-auth-service-shared-credentials.test.ts
- src/main/rate-limits/claude-usage-error-classification.ts
- src/main/claude-accounts/claude-windows-interactive-login.test.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-credential-matching.ts
- src/main/native-chat/claude-structured-managed-account-support.ts
- src/main/ipc/pty/ipc/spawn-env.ts
- src/main/persistence/restoring-sessions/pane-alias-normalization.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-readback.ts
- src/main/macos-keychain/generic-password.ts
- src/main/claude-accounts/claude-managed-auth-storage.ts
- src/main/claude-accounts/runtime-auth-service-shared-credential-failures.test.ts
- src/main/daemon/daemon-provider-init.ts
- src/main/runtime/structured-agent-session-runtime.ts
- src/main/rate-limits/claude-cli-usage-fetch.ts
- src/main/persistence/leasing-ssh-ptys/ssh-target-state.ts
- src/main/startup/main-process-ready-foundation.ts
- src/main/claude-accounts/claude-auth-capture.ts
- src/main/claude-accounts/runtime-auth/runtime-auth-sync.ts
- src/main/claude-accounts/live-pty-gate.ts
- src/main/runtime/structured-claude-runtime-adapter.ts
- src/main/claude-accounts/shared-credential-fields.ts
- src/main/claude-accounts/oauth-refresh.ts
- src/main/claude-accounts/managed-auth-path.ts
- src/shared/persisted-state-types.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.
# Conflicts: # src/main/claude/claude-model-catalog-probe.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Restore the auth-switch gate before starting a… · claude-structured-session-acquisition.ts:61-63
src/main/claude/claude-structured-session-acquisition.ts:61-63
🔒 Security & Privacy | 🟠 Major | ⚡ Quick winRestore the auth-switch gate before starting a structured acquisition.
A session started during an account switch can resolve inherited Claude authentication for the old selection, then resolve the config directory for the new selection. The child can therefore use the wrong account credentials or fail authentication. Restore the pre-spawn check at this acquisition boundary.
Suggested fix
-import type { +import { + AgentSessionPreSpawnError, + type AgentSessionAcquisition, StructuredAgentSessionAcquireInput } from '../native-chat/agent-session-wire/structured-agent-session-adapter' +import { CLAUDE_AUTH_SWITCH_IN_PROGRESS_MESSAGE } from '../claude-accounts/environment' +import { isClaudeAuthSwitchInProgress } from '../claude-accounts/live-pty-gate' import { openClaudeStreamJsonConnection } from './claude-stream-json-connection' @@ }): Promise<AgentSessionAcquisition> { + if (isClaudeAuthSwitchInProgress()) { + throw new AgentSessionPreSpawnError(new Error(CLAUDE_AUTH_SWITCH_IN_PROGRESS_MESSAGE), { + reason: 'accountSwitchInProgress' + }) + } const sessionId = input.identity.sessionId
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
94d64b31-e2f1-4e84-8816-731047eef3a5
⛔ Files ignored due to path filters (1)
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (8)
src/main/claude/claude-model-catalog-probe.tssrc/main/claude/claude-structured-effort-default-at-rest.test.tssrc/main/claude/claude-structured-session-acquisition.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adapter.tssrc/main/runtime/structured-agent-runtime-registrations.tssrc/main/runtime/structured-claude-runtime-adapter.tssrc/main/startup/main-process-account-services.tssrc/renderer/src/app-shell/use-app-shell-services.ts
💤 Files with no reviewable changes (5)
- src/main/runtime/structured-agent-runtime-registrations.ts
- src/main/startup/main-process-account-services.ts
- src/main/claude/claude-model-catalog-probe.ts
- src/main/runtime/structured-claude-runtime-adapter.ts
- src/main/claude/claude-structured-session-acquisition.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
# Conflicts: # src/main/daemon/daemon-provider-init.ts # src/main/daemon/daemon-provider-state.ts # src/shared/wsl-login-shell-command.ts
… accounts mirror ~/.claude (#26769) * Run a Claude account on System default until it has its own login An account saved before per-account folders has no login in its folder. While System default (~/.claude, or the user's own CLAUDE_CONFIG_DIR) is signed in to the same email, the router sends every launch there and writes that choice into the pointer file, so nobody is logged out by the update. Once the account signs in to its own folder, the next launch uses it. The WSL router follows the same rule with the guest's ~/.claude. * Refresh each Claude account folder from ~/.claude before every launch ~/.claude (or the user's own CLAUDE_CONFIG_DIR) is now the master copy. Each account folder gets its whole settings.json, including the proxy address and its key, and every .claude.json key except the login, Claude's account caches and install ids, so first-run questions are not asked again. Every other top-level entry is linked (folders) or copied (files), except Claude's per-folder daemon, jobs, live sessions, login files and throwaways. sessions is no longer shared, and an earlier link is undone. The refresh runs before every Claude Orca starts, for each new terminal and on account switch. Orca never writes back to ~/.claude. The ledger that tracked selective sharing is gone. * Route chat auth and unselected-account usage through the Claude router Chats decided whether to drop inherited Anthropic auth from the selection alone, so an account running on System default lost the user's own key. They now ask the router, as terminals, AI commit messages, automations and usage already do. Usage for an unselected account is read where its launches would run. A test reads every entry point through the fallback and fails if a launch path outside the router reads the Claude selection or builds an account folder. The router's two launch errors move to their own file to keep it under the line limit. * Show Claude account sign-in prompts only when an account cannot run With the fallback, an account System default is signed in to already works, so: - The one-time "Finish setting up your Claude accounts" toast is gone. - Accounts System default covers no longer need a sign-in: no Sign in in the status bar menu or Settings, and they can be selected. - The old-terminal banner shows only when claude in that terminal would run a different account than the selected one, and asks again after a switch. Its wording is unchanged. The retired toast's saved flag stays in the paired-client schema so an older client's write is still accepted. The email comparison moves beside the login reader to keep the router under the line limit. * Keep the user's shell Anthropic auth on Claude account launches A signed-in account's launches used to drop ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and CLAUDE_CODE_OAUTH_TOKEN from the inherited environment while ANTHROPIC_BASE_URL passed through, so a proxy set in the shell got the subscription login and answered 401. Host launches on an account now keep the shell's auth with its address, as System default does. Chats still name the account kind in a failed sign-in, now from the router rather than from whether auth was dropped. * Share from ~/.claude only what Claude itself would seed into a new folder The deny list missed much of Claude's runtime state, so tokens, locks and live files such as .session_ingress_token, server-sessions.json and remote-control were copied or linked over each account's own every launch. The list now mirrors the one Claude uses when it seeds a fresh config folder from ~/.claude: its runtime entries, every hidden entry, daemon files and agent memory. teams, ide, downloads and scratch are on it, so they stay per folder. * Merge trusted folders and MCP servers into an account instead of replacing them Each refresh replaced the account's projects and mcpServers with ~/.claude's, so folder trust and allowed tools recorded only in the account were lost, and a refresh landing between Orca's folder-trust write and Claude's start brought the trust dialog back. Both are now merged per folder path or server name: ~/.claude wins for entries it has, the account keeps the rest, and a folder trusted in the account stays trusted. Both writers take Claude's lock on the file, so the order no longer matters. * Require the same organization before System default stands in for an account The fallback compared emails only, so one email saved for two organizations made both accounts run on whichever organization System default was signed in to. When the saved account and System default's login both name an organization, it must now match too, on the host and in WSL, and the old-terminal banner uses the same comparison. The saved-account lookup the three checks repeated is now one helper. * Treat v42 terminals as having the claude account function v42 daemons shipped the same claude function and pointer path as v44, so claude in those terminals already follows the selected account. The old-terminal banner now shows only for daemons before v42 and for v43, the revert, which dropped the function. * Fail the routing test when a new module resolves the claude binary The census only caught code that read the Claude selection, not a new launcher that runs claude without asking the router. A second check now lists every module that resolves the claude binary or loads the Agent SDK, each with why it is routed, and fails on any new one, or on a listed one that no longer matches. * Skip the account refresh on launches that run on System default A launch that falls back to System default never uses the account folder, so starting a setup for it on every launch was wasted work. Account switches still set the folder up for a later sign-in. * Give a terminal opened before the login shell's env only the account pointer At startup, a pane could be routed before the login shell reported the user's own CLAUDE_CONFIG_DIR, so the fallback compared against ~/.claude.json instead. Until that env arrives a pane gets only the pointer, and the pointer is rewritten once it does, so claude typed there reads the right folder. The recent claude --version answer moves beside the version probe to keep the router under the line limit. * Drop the chat-only Anthropic auth stripping and override refusal Chats no longer drop the shell's Anthropic auth on any account, so the chat launch's override refusal and the policy's stripAuthEnv could only be reached from test fixtures. The structured auth policy is now just which login a failed sign-in names. Terminals keep their refusal, which still guards WSL launches; the failure reason stays in the shared vocabulary for older peers. * Publish a new account state file whole The first .claude.json write went straight to the target, so a crash mid-write could leave Claude a truncated state file. It is now written to a staged file and linked into place without replacing one Claude created meanwhile. * Read an unselected WSL account's usage where the WSL router would run it Usage for an unselected WSL account read its saved folder directly, so an account the guest's ~/.claude covers showed no usage, and the read bypassed the router. It now asks the WSL router, after the same check that the distro is already running. * Keep the shell's Anthropic auth when the claude function runs an account The claude shell function (POSIX, fish and PowerShell) unset ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, AWS_BEARER_TOKEN_BEDROCK and auth-like ANTHROPIC_CUSTOM_HEADERS before running Claude in an account folder, so a proxy set in the shell lost its key while keeping its address. It now only sets CLAUDE_CONFIG_DIR and Orca's marker, as on System default. Protocol 44 is unreleased, so no new bump; the shell-wrapper snapshots are regenerated. * Never drop the user's Anthropic auth from a Claude launch Orca's launches stripped ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, AWS_BEARER_TOKEN_BEDROCK and auth-like ANTHROPIC_CUSTOM_HEADERS for WSL terminals, terminal splits and through the preparation's stripAuthEnv flag, and refused a launch whose agent env set them. If the user's shell overrides the login, that is their setup: every launch now keeps it, on accounts, System default and WSL alike. The flag, the strip paths and the override refusal are gone; the refusal's reason stays in the shared vocabulary so older peers still decode it. Orca's own process env and the claude --version probe still drop these variables: they are Orca's, not the user's launch. * Leave out of an account's state everything Claude resets when it signs out The .claude.json copy left out the login and keys matching cache patterns, but still carried account state such as additionalModelOptionsAnsweredAt, artifactRosterDenied, lastSeenOrgDefaultUpdatedAt and the subscription notices. The copy now leaves out the exact keys Claude resets on logout, beside the install ids, Console API key and first-token date; the cache patterns stay for account caches logout does not reset. Onboarding is still copied. * Judge an old terminal's Claude banner by the pane's own runtime The banner compared every old pane with the host selection and showed whenever only a WSL account was selected, so old host panes showed it with nothing to say and old WSL panes were judged by the host's account. The pane now names its runtime: a host pane is compared with the host selection, a WSL pane with its distro's selection through the WSL router, and a pane whose runtime is unknown, or with no account selected for it, stays hidden. * Leave an account's settings file alone when only Orca's hooks differ from the default home's * Reread a WSL account's Claude state only when the file changes * Move tests merged from main onto the account-only Claude auth policy
# Conflicts: # src/main/text-generation/commit-message-agent-environment.ts
It only types the chat command resolver it injects; main's launch-routing guard (#26801) matched the name.
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
On the assembled Pod tree (Orca past #26801 and the process-host package): - the OAuth credential reads the router's routed folder as routedHome, the name #26801 gave selectedHome, and still as selectedHome on older bases; - the relay types its VM process structurally instead of importing a node:child_process type, which check:process-host-imports refuses; - the terminal override test builds its VM env names from the prefix, so the decouple codemod's rename of ORCA_AGENT_HOOK_TOKEN reaches them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> 7b65247ec6dfea892e4f7e6c2e6b08c18163ebf9: sandbox anthropic-api route upstream; Mac Claude Code login opt-in, default off
…#26464) * fix: refresh host environments before structured agent command resolution * fix: ship the owning server CLI for managed remote agents * test: include the shipped CLI in remote install fixtures * Bind packaged agent CLI calls to their execution host * Keep owning-server CLI binding scoped to managed agents * Serve the last shell environment to chat starts and refresh it in the background Only the first chat start waits for the login shell; later starts get the last snapshot and refresh it in the background once it is 10 s old. On Windows hosts without the registry addon (managed server slots), the saved PATH is reread with reg.exe. The Windows server CLI launcher stager now checks the target architecture, and the CLI help says ambient selectors are ignored inside a managed server. * Keep the last good shell environment when a refresh fails, and load the Windows profile once A login-shell capture now says whether the shell produced the env or Orca fell back to its own, and only a real capture replaces the snapshot. Windows loads the PowerShell profile once per process and refreshes only the saved PATH. The reg.exe fallback queries the whole key so a missing user Path no longer drops the saved PATH. The first capture starts when the resolvers are created. * Keep the last good login-shell env for other readers while a forced refresh runs * Mark the Claude launch resolver as a reviewed router-aware module It only types the chat command resolver it injects; main's launch-routing guard (#26801) matched the name. * Keep a settled login-shell env for readers during a refresh and share the first run - Any settled cached entry, a fallback included, now serves other readers while a forced capture runs; only a real capture replaces it. - Native chat's first capture shares a run a startup reader already began, so the login shell runs once per process at startup on macOS/Linux. - Type the injected Claude resolver without naming resolveClaudeCommand. - Cover the runtime's Claude command options, the owning-host --host check, and the PTY flag drop. * Drop an inherited owning-host flag from daemon terminal panes The persistent terminal daemon merges its own environment into every pane, so an inherited ORCA_CLI_OWNING_HOST reached desktop panes even though main strips it from the spawn env. Drop it with the other per-launch CLI variables. * Route agents to their own server through ordinary launch defaults; start the first chat after an install The native-chat agent environment now sets the owning server's ORCA_USER_DATA_PATH and empty ORCA_ENVIRONMENT / ORCA_PAIRING_CODE / ORCA_REMOTE_PAIRING, which the CLI already reads as unset; empty rather than deleted, because the spawn merges the launch overlay over the server's own env. The ORCA_CLI_OWNING_HOST flag, the CLI's skip of ambient selectors, the launchers' export of it, the terminal clean-up, the help-text exception and the WSL launcher guard are gone, so a person's terminal follows their own settings as on main. A launch that finds no program in the shell snapshot waits for one shared refresh (at most one shell timeout) and resolves again; create support rereads the shell once before refusing. On Windows a failed PowerShell profile load is retried on the next refresh instead of being kept until restart. * One shared shell reread when an agent's program is missing The pre-create check for OpenCode, OMP and Pi forced its own login-shell capture on every refusal: not shared with launches, one per concurrent check, triggered by an installed-but-too-old version too, and an older capture finishing last could overwrite a newer cached environment. On Windows, every launch miss also reran a failed PowerShell profile load, bypassing the 10-second limit. - One saved shell environment per host: chat launches, their misses, the pre-create check and AI commit messages read it and share one refresh. - The pre-create check resolves the agent's program the way a launch does, so only a missing program waits for the refresh; registrations declare how to resolve their launch and check its version. - A forced login-shell capture joins one already running for the same shell, so captures cannot land out of order. - On Windows, a miss within 10 s of a failed PowerShell load rereads only the saved PATH. * One owner for the cached shell environment Review found two more races in the reread-on-miss machinery, both from the host wrapper keeping its own snapshot beside the login-shell cache: - A launch that found no program could join a reread that started before the agent was installed, and spend its one retry on the old PATH. - On Windows, saved-PATH rereads renewed the snapshot's age, so a failed PowerShell profile was never retried while launches kept missing. The login-shell cache is now the only owner of the captured environment, the run in progress and which result wins (the newest run started; a fallback never replaces a captured env). It takes three options instead of `force`: - startedAfter: a lookup that found nothing waits for a run that started no earlier than the lookup did, joining one if it has, else starting one. - refreshAfterMs: serve the last result and rerun in the background once the last attempt is older. - keepCaptured: a captured env is kept for good; only a fallback is rerun (Windows' PowerShell profile). The host wrapper keeps only policy: the 10 s interval, on Windows the saved PATH laid over the profile env on every read (a miss forces a fresh registry read), and the settings overlays. Its snapshot, pending promise, staleness and Windows "loaded" bookkeeping are gone. A lookup's start time travels with the miss (resolveAgainAfterRefreshOnMissingProgram passes it). * Read an injected shell environment once per runtime, as main does The previous commit read an injected environment on every acquisition, which broke main's 'caches shell exports but re-reads configured overrides for a resume' contract. It is read once when the resolvers are made again. * Model lists reread the environment on a missing program, as launches do Live QA: the first new chat after installing Claude showed "Claude wasn't found on the computer running this chat". The chat launch itself reread the login shell and started the new binary, but Claude's model-list check ran first, with the environment read before the install, and never retried: catalog probes were deliberately built without the miss refresh. The retry now lives in each agent's one shared lookup of its binary and environment, which a launch and a model listing both call: resolveCodexStructuredInvocation, resolveAcpLaunchInvocation, a new shared resolvePiRpcInvocation, and resolveClaudeChildEnvSources (which already had it). Each catalog probe is given the runtime's refreshAfterMissingProgram, and the catalog context no longer strips it, so a listing and a launch reread the same single-owner environment the same way. * Pass optional launch lookups through directly instead of conditional spreads * Read the host shell env through resolveLoginShellEnvironment; drop the extra wait cap CI on the merge with main failed main's new codex-workspace-relative-path test (#26684), which mocks the login-shell module with only resolveLoginShellEnvironment: the wrapper called captureLoginShellEnvironment and imported the spawn-timeout constant. The wrapper only needs the env, so it reads through resolveLoginShellEnvironment again, as on main. The miss wait no longer races its own 5 s timer: the shell run it waits for is already killed at the spawn timeout, so the second cap was a guard over the same bound. The constant goes back to private, as on main. * Test that a hung login shell holds a launch miss for at most one shell timeout The bound lives in the one owner: the shell run is killed at the spawn timeout (5 s) and settles to a fallback, which never replaces a captured snapshot. A mutation raising that timeout fails this test. * A program found through a relative PATH entry is not missing Main's #26684 runs Codex through a workspace-relative PATH entry (`bin`, `node_modules/.bin`). The lookup searches such an entry against Orca's own directory and returns the bare name; the spawn then finds the program in the chat's directory. Counting that bare name as missing made every such launch wait for a login-shell reread. The retry now fires only when the lookup truly found nothing: a bare name back from a PATH whose entries are all absolute. Each agent's one lookup tells it which PATH it searched. * Count a relative PATH entry as found only when it holds the program; Windows miss waits for a saved PATH read started after it looked A bare name with a relative PATH entry is checked from the launch's working directory, so an agent in neither entry still gets its one reread. On Windows the miss no longer joins a registry read that began before the lookup.
v1.4.225 는 건너뛰었다. 충돌 360건(DU 176 · UU 142 · UD 33 · AU 9)을 풀었다. 델타(포크 유입) 11,400 파일, +503,784/−442,644, upstream 863 커밋. upstream 이 SSH relay 서버·클라이언트를 지웠다(stablyai#27214·stablyai#27215). 이제 SSH 호스트는 원격에 관리형 Orca 서버(orcad)를 설치해야만 도는데, 이 빌드는 그 템플릿을 싣지 않고 첫 배포가 nodejs.org 에서 Node 를 받으며 원격 서버는 이 데스크톱의 정책을 읽지 않는다. 사용자 결정으로 SSH 호스트를 컴파일 상수(src/shared/ssh-remote-hosts-removal.ts)로 제거했다 — 연결·추가· 편집·가져오기를 main 에서 거부하고 렌더러 진입점을 감췄다. 목록과 삭제는 남겼다. WSL 배포판 호스트와 deployOrcad 는 disableRemoteOrcaServer 로 막았다. - DU 176: 포크가 지운 표면(cloud/, 업데이터, 피드백, Bitbucket·Gitea·Azure DevOps 등) 유지. 충돌 없이 들어온 업데이터 잔재(src/main/updater/ 신규 6, updater-handler-context, update-restart-preservation, headless serve 자동 업데이트 배선), cloud/ 신규 70파일· cloud-* 워크플로 2개, anti-slop 패치 선언을 지우고 원장 absentPaths/absentSymbols 에 올렸다. - UU 142: upstream 이 옮긴 코드에 포크 줄을 이식했다. 구조화 세션 재기동 게이트는 공통 admittedRecord(), 관리형 Claude 계정(stablyai#26801 계정별 폴더)은 라우터의 선택 함수 별칭, 런타임 다운로드 게이트는 src/main/node-runtime/, 서브모듈 SCM 은 소유자 target 라우팅. - 스킬 설치: upstream 의 npx skills@1.7.2 대신 포크 오프라인 설치 유지, 업데이트 = 재설치. 같은 머지에서 닫은 것(행동 테스트 + 뮤테이션 검증): - Claude 로그인 RPC(beginClaudeSignIn/finishClaudeSignIn) 등록 게이트 - Jira 이슈 제목 생성의 에이전트 허용목록 - pty:spawn agentLaunch 계획 경로의 허용목록 재검사 - 위임 모바일 기기 동기화(disableMobilePairing 아래 민팅 0·기존 회수) - codex 사용량 자식의 사내 NO_PROXY 병합 - HTML 미리보기 공유 버튼(artifact 공유 제거) max-lines: upstream 이 상한에 맞춘 파일에 포크 줄을 둘 자리가 없어 이관했다 — local-worker-start 의 워커 패널 앵커는 별칭 임포트 + AsyncLocalStorage, AccountsPane 은 upstream 이름의 포크 대역 컴포넌트, 사용량 게이트는 fetchUsageIfAllowed. 검증: typecheck·lint 통과, 원장 94/94. 3자 대조(순정 v1.4.226·포크 tip)에서 머지 전용 실패 35파일을 모두 고쳤다 — 숨긴 기능(SSH·작업 공급자)의 upstream 스위트는 seam 모듈만 모킹해 휴면 코드를 계속 검증하고, 지운 표면의 신규 테스트 3개는 삭제했다. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and proxy fixes (#26801) * Revert "Revert Claude per-account folders (#24434, #26405) before release (#26638)" This reverts commit 9ca9b4e. * Move the terminal daemon protocol to 44 for the re-landed claude function v43 daemons (the revert) lack the claude account function, so new terminals must not reuse them. v42 and v43 stay attachable. * Move the local build compatibility contract to daemon protocol 44 * Point the old-terminal test at daemon protocol 44 * Claude accounts re-land: never sign anyone out, keep proxies working, accounts mirror ~/.claude (#26769) * Run a Claude account on System default until it has its own login An account saved before per-account folders has no login in its folder. While System default (~/.claude, or the user's own CLAUDE_CONFIG_DIR) is signed in to the same email, the router sends every launch there and writes that choice into the pointer file, so nobody is logged out by the update. Once the account signs in to its own folder, the next launch uses it. The WSL router follows the same rule with the guest's ~/.claude. * Refresh each Claude account folder from ~/.claude before every launch ~/.claude (or the user's own CLAUDE_CONFIG_DIR) is now the master copy. Each account folder gets its whole settings.json, including the proxy address and its key, and every .claude.json key except the login, Claude's account caches and install ids, so first-run questions are not asked again. Every other top-level entry is linked (folders) or copied (files), except Claude's per-folder daemon, jobs, live sessions, login files and throwaways. sessions is no longer shared, and an earlier link is undone. The refresh runs before every Claude Orca starts, for each new terminal and on account switch. Orca never writes back to ~/.claude. The ledger that tracked selective sharing is gone. * Route chat auth and unselected-account usage through the Claude router Chats decided whether to drop inherited Anthropic auth from the selection alone, so an account running on System default lost the user's own key. They now ask the router, as terminals, AI commit messages, automations and usage already do. Usage for an unselected account is read where its launches would run. A test reads every entry point through the fallback and fails if a launch path outside the router reads the Claude selection or builds an account folder. The router's two launch errors move to their own file to keep it under the line limit. * Show Claude account sign-in prompts only when an account cannot run With the fallback, an account System default is signed in to already works, so: - The one-time "Finish setting up your Claude accounts" toast is gone. - Accounts System default covers no longer need a sign-in: no Sign in in the status bar menu or Settings, and they can be selected. - The old-terminal banner shows only when claude in that terminal would run a different account than the selected one, and asks again after a switch. Its wording is unchanged. The retired toast's saved flag stays in the paired-client schema so an older client's write is still accepted. The email comparison moves beside the login reader to keep the router under the line limit. * Keep the user's shell Anthropic auth on Claude account launches A signed-in account's launches used to drop ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and CLAUDE_CODE_OAUTH_TOKEN from the inherited environment while ANTHROPIC_BASE_URL passed through, so a proxy set in the shell got the subscription login and answered 401. Host launches on an account now keep the shell's auth with its address, as System default does. Chats still name the account kind in a failed sign-in, now from the router rather than from whether auth was dropped. * Share from ~/.claude only what Claude itself would seed into a new folder The deny list missed much of Claude's runtime state, so tokens, locks and live files such as .session_ingress_token, server-sessions.json and remote-control were copied or linked over each account's own every launch. The list now mirrors the one Claude uses when it seeds a fresh config folder from ~/.claude: its runtime entries, every hidden entry, daemon files and agent memory. teams, ide, downloads and scratch are on it, so they stay per folder. * Merge trusted folders and MCP servers into an account instead of replacing them Each refresh replaced the account's projects and mcpServers with ~/.claude's, so folder trust and allowed tools recorded only in the account were lost, and a refresh landing between Orca's folder-trust write and Claude's start brought the trust dialog back. Both are now merged per folder path or server name: ~/.claude wins for entries it has, the account keeps the rest, and a folder trusted in the account stays trusted. Both writers take Claude's lock on the file, so the order no longer matters. * Require the same organization before System default stands in for an account The fallback compared emails only, so one email saved for two organizations made both accounts run on whichever organization System default was signed in to. When the saved account and System default's login both name an organization, it must now match too, on the host and in WSL, and the old-terminal banner uses the same comparison. The saved-account lookup the three checks repeated is now one helper. * Treat v42 terminals as having the claude account function v42 daemons shipped the same claude function and pointer path as v44, so claude in those terminals already follows the selected account. The old-terminal banner now shows only for daemons before v42 and for v43, the revert, which dropped the function. * Fail the routing test when a new module resolves the claude binary The census only caught code that read the Claude selection, not a new launcher that runs claude without asking the router. A second check now lists every module that resolves the claude binary or loads the Agent SDK, each with why it is routed, and fails on any new one, or on a listed one that no longer matches. * Skip the account refresh on launches that run on System default A launch that falls back to System default never uses the account folder, so starting a setup for it on every launch was wasted work. Account switches still set the folder up for a later sign-in. * Give a terminal opened before the login shell's env only the account pointer At startup, a pane could be routed before the login shell reported the user's own CLAUDE_CONFIG_DIR, so the fallback compared against ~/.claude.json instead. Until that env arrives a pane gets only the pointer, and the pointer is rewritten once it does, so claude typed there reads the right folder. The recent claude --version answer moves beside the version probe to keep the router under the line limit. * Drop the chat-only Anthropic auth stripping and override refusal Chats no longer drop the shell's Anthropic auth on any account, so the chat launch's override refusal and the policy's stripAuthEnv could only be reached from test fixtures. The structured auth policy is now just which login a failed sign-in names. Terminals keep their refusal, which still guards WSL launches; the failure reason stays in the shared vocabulary for older peers. * Publish a new account state file whole The first .claude.json write went straight to the target, so a crash mid-write could leave Claude a truncated state file. It is now written to a staged file and linked into place without replacing one Claude created meanwhile. * Read an unselected WSL account's usage where the WSL router would run it Usage for an unselected WSL account read its saved folder directly, so an account the guest's ~/.claude covers showed no usage, and the read bypassed the router. It now asks the WSL router, after the same check that the distro is already running. * Keep the shell's Anthropic auth when the claude function runs an account The claude shell function (POSIX, fish and PowerShell) unset ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, AWS_BEARER_TOKEN_BEDROCK and auth-like ANTHROPIC_CUSTOM_HEADERS before running Claude in an account folder, so a proxy set in the shell lost its key while keeping its address. It now only sets CLAUDE_CONFIG_DIR and Orca's marker, as on System default. Protocol 44 is unreleased, so no new bump; the shell-wrapper snapshots are regenerated. * Never drop the user's Anthropic auth from a Claude launch Orca's launches stripped ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN, AWS_BEARER_TOKEN_BEDROCK and auth-like ANTHROPIC_CUSTOM_HEADERS for WSL terminals, terminal splits and through the preparation's stripAuthEnv flag, and refused a launch whose agent env set them. If the user's shell overrides the login, that is their setup: every launch now keeps it, on accounts, System default and WSL alike. The flag, the strip paths and the override refusal are gone; the refusal's reason stays in the shared vocabulary so older peers still decode it. Orca's own process env and the claude --version probe still drop these variables: they are Orca's, not the user's launch. * Leave out of an account's state everything Claude resets when it signs out The .claude.json copy left out the login and keys matching cache patterns, but still carried account state such as additionalModelOptionsAnsweredAt, artifactRosterDenied, lastSeenOrgDefaultUpdatedAt and the subscription notices. The copy now leaves out the exact keys Claude resets on logout, beside the install ids, Console API key and first-token date; the cache patterns stay for account caches logout does not reset. Onboarding is still copied. * Judge an old terminal's Claude banner by the pane's own runtime The banner compared every old pane with the host selection and showed whenever only a WSL account was selected, so old host panes showed it with nothing to say and old WSL panes were judged by the host's account. The pane now names its runtime: a host pane is compared with the host selection, a WSL pane with its distro's selection through the WSL router, and a pane whose runtime is unknown, or with no account selected for it, stays hidden. * Leave an account's settings file alone when only Orca's hooks differ from the default home's * Reread a WSL account's Claude state only when the file changes * Move tests merged from main onto the account-only Claude auth policy (cherry picked from commit 8b2a5e4)
|
Feedback after living with this change since v1.4.225 (macOS 26.5, zsh 5.9). Repro and details are in #19900 (comment). In short: this PR changed user-visible behaviour without telling users, and two of its claims did not hold for me.
I understand the reason (STA-3698, stale copied tokens). But the fix moved the cost onto multi-account users without telling them. Please:
|
ELI5
This brings back Claude per-account folders (#24434, #26405), which were reverted in #26638 because they signed people out after updating and broke proxy setups. The fixes for those problems are in #26769, which merges into this branch. This PR is what lands on main once #26769 is in.
What Changed
claudeaccount function, so new terminals must not reuse them. v42 and v43 stay attachable.~/.claudewhen that's the same email and org.~/.claudeexcept the login and Claude's runtime state.Why
Saved Claude accounts used to work by copying login tokens into
~/.claude. Claude rotates those tokens, so the copies went stale and forced people to sign in again (STA-3698). Giving each account its own Claude folder lets Claude keep its own login fresh. The first landing missed the upgrade path and proxy setups; #26769 fixes both.Linked Issue
STA-3698. Re-lands #24434 and #26405 after #26638.
Visual Proof
See #26769. The UI here only removes or narrows existing UI; no new wording.
Testing
See #26769. In a sandboxed macOS build with an isolated keychain and a proxy stub, both reported cases now work after updating with no sign-in: an account saved in the old build, and a proxy plus key in
~/.claude/settings.json. The proxy only ever saw its own key, and nothing touched a real~/.claudeor Keychain.Review
Merge #26769 into this branch first. Two independent review rounds were done on #26769.
Agent skill upstream boundary
Notes
src/main/ipc/app.tsmax-lines failure comes from main (Warn on slow profile saves instead of failing them #26447) and isn't touched here.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)