Repository navigation
Conversation
dbf09c1 to
52731f6
Compare
|
Rebased onto current |
|
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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between adf2f2c4b1cafe95a3fd70909d781acbdf7077c7 and 6f2170b6f621493c6775219fb70b57ff96920145. 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe change adds account-scoped Codex launches for managed and system accounts across CLI, renderer, preload, runtime, and PTY flows. It validates provider account references, runtime lanes, WSL distributions, capabilities, and account availability. It preserves account-specific Codex homes without changing global selection. It also adds PTY-scoped Codex model discovery, dynamic model catalogs, account-selection UI, localization, and comprehensive tests. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts (1)
63-71: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftScope persisted Codex model defaults by account.
The cache now has separate Codex catalogs per PTY. Lines 63-71 accept a persisted model if any PTY supports it. Lines 225-236 can retire that same global model from one PTY result. Accounts with different model access can therefore retain an unsupported model or erase a valid model based on probe order.
src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts#L63-L71: Validate persisted Codex models against the selected account or PTY scope.src/renderer/src/components/native-chat/use-native-chat-session-options.ts#L225-L236: Do not retire an agent-global persisted model from one account-scoped catalog. Persist defaults by account scope, or keep scoped discovery from mutating global defaults.src/renderer/src/runtime/runtime-git-client.ts (1)
697-713: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winReject a PTY from a different runtime environment.
Line 713 forwards
remotePty.handlewithout checkingremotePty.environmentIdagainst the activetarget.environmentId. If the active environment changes, a stale PTY ID such asremote:env-a@@pty-1can scope discovery inenv-b. This can resolve models from the wrong account context.Only forward the handle when the selector is absent or matches the active environment. Add a mismatched-environment test.
Proposed fix
if (target.kind === 'local' || !context.worktreeId) { return window.api.git.discoverCommitMessageModels({ agentId, worktreePath: resolveLocalWorktreePath(context), connectionId: context.connectionId, ...(!remotePty && ptyId ? { ptyId } : {}) }) as Promise<RuntimeDiscoverCommitMessageModelsResult> } + const ptyIdForTarget = + remotePty?.environmentId && remotePty.environmentId !== target.environmentId + ? undefined + : remotePty?.handle ?? ptyId return callRuntimeRpc<RuntimeDiscoverCommitMessageModelsResult>( target, 'git.discoverCommitMessageModels', { worktree: toRuntimeWorktreeSelector(context.worktreeId), agentId, - ...(ptyId ? { ptyId: remotePty?.handle ?? ptyId } : {}), + ...(ptyIdForTarget ? { ptyId: ptyIdForTarget } : {}),The supplied
parseRemoteRuntimePtyIdcontext defines the environment selector and handle.src/main/runtime/orca-runtime.ts (1)
26006-26024: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPreserve
providerAccountRefthrough renderer-backed terminal creation.When
createAgentSessionuses the focused renderer-IPC path,providerAccountRefis omitted from the payload type, event handler, andqueueTabStartupCommandcall. The selected Codex account is therefore lost before PTY creation. Add and forward the field through each layer.
🧹 Nitpick comments (5)
src/cli/specs/core.ts (1)
237-240: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winList the allowed flags as explicit string literals.
Every other spec in this file lists flags as quoted literals. The
.split(' ')form hides the flag names from a plain text search for'account-runtime'or'wsl-distro', and it widens the array element type tostring.♻️ Proposed refactor
- allowedFlags: [ - ...GLOBAL_FLAGS, - ...'worktree command title agent account account-runtime wsl-distro focus'.split(' ') - ], + allowedFlags: [ + ...GLOBAL_FLAGS, + 'worktree', + 'command', + 'title', + 'agent', + 'account', + 'account-runtime', + 'wsl-distro', + 'focus' + ],src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx (1)
152-185: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueHoist the repeated
Current defaultitem.The loading branch and the error branch render the same
DropdownMenuItemwith the same translate key. Extract it into one local element and reuse it in both branches.src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx (1)
213-216: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the capability with the exported constant.
This test hardcodes
'agent-session.account-ref.v1'. The component passesAGENT_SESSION_ACCOUNT_REF_RUNTIME_CAPABILITYfromsrc/shared/protocol-version.src/cli/handlers/terminal.test.tsimports that constant for the same assertion. Import it here as well so a value change fails in one obvious place.src/main/codex-accounts/runtime-home-service.ts (1)
346-417: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider one error vocabulary for account resolution.
prepareForCodexAccountLaunchthrows stable codes such asagent_session_account_unavailable. This method throws prose messages such asCodex pane account is no longer available.Callers that map failures to capability error codes must then match on message text. Emit the same code vocabulary here, and keep the prose as detail.src/main/codex-accounts/runtime-home-service.test.ts (1)
409-437: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd cases for provider mismatch and durable credential absence.
This suite covers removed accounts and wrong-lane refs. Two fail-closed branches of
prepareForCodexAccountLaunchremain untested: a non-Codexprovider, which throwsagent_session_account_agent_mismatch, andoptions.unavailableManagedHomePathmatching a trusted home whoseauth.jsonabsence is durable, which throwsagent_session_account_unavailable. Both branches decide whether a launch proceeds with the wrong credentials.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 88b507dc-1081-4e6d-91ff-b66578d689d6
📥 Commits
Reviewing files that changed from the base of the PR and between 9a81874 and 52731f631f53ae4ab9e916a7e2316d70ef66021e.
📒 Files selected for processing (64)
src/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/terminal.test.tssrc/cli/handlers/terminal.tssrc/cli/help.tssrc/cli/specs/core.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/index.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsxsrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.test.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/remote-agent-session-launch.test.tssrc/renderer/src/runtime/remote-agent-session-launch.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/store/slices/terminals.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/codex-model-list-probe.test.tssrc/shared/codex-model-list-probe.tssrc/shared/commit-message-agent-spec.tssrc/shared/protocol-version.tssrc/shared/provider-account-ref.test.tssrc/shared/provider-account-ref.tssrc/shared/types.ts
52731f6 to
8b4e374
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/cli/handlers/account.ts (1)
41-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for both workspace-label fallback cases.
The current visible test covers only a non-empty
workspaceLabel. Add cases fornulland whitespace-only labels. Assert that both cases fall back toAlso applies to: 60-61
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cb4926f4-5096-48cb-b108-ebc1877115ba
📥 Commits
Reviewing files that changed from the base of the PR and between 400321e and 8b4e37487717388a30522e79d4315158c7b2f436.
📒 Files selected for processing (64)
src/cli/handlers/account.test.tssrc/cli/handlers/account.tssrc/cli/handlers/terminal.test.tssrc/cli/handlers/terminal.tssrc/cli/help.tssrc/cli/specs/core.tssrc/main/codex-accounts/runtime-home-service.test.tssrc/main/codex-accounts/runtime-home-service.tssrc/main/index.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/main/runtime/orca-runtime-agent-session-operation.test.tssrc/main/runtime/orca-runtime-git.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/main/runtime/rpc/methods/agent-session.tssrc/main/runtime/rpc/methods/git-params.tssrc/main/runtime/rpc/methods/git.test.tssrc/main/runtime/rpc/methods/git.tssrc/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/native-chat/native-chat-session-option-discovery.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/renderer/src/components/native-chat/use-native-chat-session-options.tssrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsxsrc/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.test.tssrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/components/tab-bar/codex-launch-account-options.test.tssrc/renderer/src/components/tab-bar/codex-launch-account-options.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/runtime-agent-background-create.tssrc/renderer/src/runtime/remote-agent-session-launch.test.tssrc/renderer/src/runtime/remote-agent-session-launch.tssrc/renderer/src/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/store/slices/terminals.tssrc/shared/agent-session-host-authority.tssrc/shared/agent-session-option-catalog-claude-codex.tssrc/shared/agent-session-option-catalog.test.tssrc/shared/agent-session-option-catalog.tssrc/shared/codex-model-list-probe.test.tssrc/shared/codex-model-list-probe.tssrc/shared/commit-message-agent-spec.tssrc/shared/protocol-version.tssrc/shared/provider-account-ref.test.tssrc/shared/provider-account-ref.tssrc/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (63)
- src/renderer/src/components/tab-bar/codex-launch-account-options.test.ts
- src/main/runtime/rpc/methods/agent-session.test.ts
- src/shared/codex-model-list-probe.test.ts
- src/cli/handlers/account.test.ts
- src/renderer/src/components/terminal-pane/pty-transport-types.ts
- src/main/runtime/rpc/methods/git.test.ts
- src/main/ipc/filesystem.test.ts
- src/main/ipc/filesystem.ts
- src/shared/provider-account-ref.test.ts
- src/main/runtime/rpc/methods/git.ts
- src/main/text-generation/commit-message-agent-environment.test.ts
- src/renderer/src/components/terminal-pane/pty-transport.test.ts
- src/renderer/src/lib/launch-agent-in-new-tab.test.ts
- src/main/runtime/orca-runtime-agent-session-operation.test.ts
- src/renderer/src/runtime/remote-agent-session-launch.test.ts
- src/renderer/src/lib/launch-agent-in-new-tab.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/lib/runtime-agent-background-create.ts
- src/cli/handlers/terminal.test.ts
- src/preload/api-types.ts
- src/main/runtime/orca-runtime-git.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
- src/shared/provider-account-ref.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/shared/agent-session-host-authority.ts
- src/renderer/src/runtime/runtime-git-client.test.ts
- src/renderer/src/runtime/runtime-git-client.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.tsx
- src/renderer/src/components/terminal-pane/pty-connection-types.ts
- src/cli/help.ts
- src/preload/index.ts
- src/renderer/src/components/terminal-pane/pty-transport.ts
- src/renderer/src/components/native-chat/use-native-chat-session-options.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
- src/cli/handlers/terminal.ts
- src/shared/types.ts
- src/shared/agent-session-option-catalog.test.ts
- src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
- src/renderer/src/store/slices/terminals.ts
- src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
- src/shared/agent-session-option-catalog.ts
- src/main/index.ts
- src/renderer/src/components/tab-bar/codex-launch-account-options.ts
- src/shared/agent-session-option-catalog-claude-codex.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
- src/renderer/src/components/tab-bar/QuickLaunchButton.test.ts
- src/shared/protocol-version.ts
- src/shared/codex-model-list-probe.ts
- src/main/ipc/pty.test.ts
- src/main/runtime/rpc/methods/agent-session.ts
- src/renderer/src/runtime/web-runtime-session.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.test.tsx
- src/main/text-generation/commit-message-agent-environment.ts
- src/renderer/src/components/terminal-pane/pty-connection.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/renderer/src/runtime/remote-agent-session-launch.ts
- src/renderer/src/lib/launch-agent-web-host-tab.ts
- src/main/codex-accounts/runtime-home-service.ts
- src/shared/commit-message-agent-spec.ts
- src/cli/specs/core.ts
- src/main/ipc/pty.ts
- src/renderer/src/components/tab-bar/CodexLaunchAccountMenu.tsx
- src/main/runtime/orca-runtime.ts
597aad0 to
cbbbfb1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7067e911-411c-4686-88ab-153cb0d8e5fb
📥 Commits
Reviewing files that changed from the base of the PR and between 8b4e37487717388a30522e79d4315158c7b2f436 and 597aad03697686d0d6e433cc2ddab23744723120.
📒 Files selected for processing (3)
src/main/runtime/orca-runtime.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/worktree-launch-types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/i18n/locales/en.json
- src/main/runtime/orca-runtime.ts
d79f37a to
adf2f2c
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
ff7770d to
e4ad209
Compare
|
Restacked onto current The stack was also restructured so each PR is green on its own head — previously every follow-up fix landed on the tip (#13276), which meant ancestor heads failed This head was verified standalone: Added here: |
launch-agent-in-new-tab.test.ts grew past the 800-line budget once the account-scoped cases landed; move those cases to their own file. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
main dropped the shared/types barrel, so the CLI terminal handler and the launch account options resolved neither import. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KvdKNvkWoiVSxqbw7DKmgm
e4ad209 to
4a8301b
Compare
|
Restacked onto
Head re-verified standalone: |
Summary
Codex launches now expose account selection in both the quick-launch menu and the Orca CLI. The UI keeps
Current defaultavailable during loading and failures, shows friendly account labels, and sends the canonical managed-account UUID through the launch contract added by the preceding PR.The CLI accepts an explicit account selector for Codex terminal creation, resolves UUIDs through the provider-account snapshot, and rejects email aliases, deleted accounts, unsupported runtimes, valueless flags, and mismatched WSL lanes before launch.
This PR is stacked on #13271, #13270, and #13183. Please review it after those PRs land; their changes will disappear from this diff as the stack advances.
Screenshots
Not attached yet because this is a dependency-gated draft. Before marking it ready, I will capture the Codex quick-launch account submenu against the rebased branch.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation:
pnpm run build:desktop— passed.git diff --check— passed.Local environment note: the repository requests Node 24, while this workstation currently exposes Node 25.8.1. The desktop build completed; its development CLI install step reported the expected permission warning for
/usr/local/bin/orca-devwithout failing the build.AI Review Report
The review checked canonical UUID selection, current-default and system-default behavior, host/WSL lane filtering, remote capability gating, SSH fallback, loading/error/retry states, and the existing Radix dropdown keyboard behavior.
Regression tests cover loading fallback, friendly labels with UUID launch values, load errors and retry, SSH and older-runtime fallback, UUID-only CLI selection, WSL system selection, deleted/alias selectors, missing flag values, and managed WSL accounts without a distro.
Cross-platform review:
Current defaultuntil they advertise account-reference support.Security Audit
ProviderAccountRef.Notes
origin/mainalso changedsrc/renderer/src/i18n/locales/en.json; the draft therefore reports one localization-catalog conflict. It will be resolved by rebasing after the dependency stack advances, avoiding a force-rewrite of the reviewed PR 1 branch.@rp0927