Repository navigation
Conversation
22b9625 to
20e2e8f
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:
📝 WalkthroughWalkthroughCodex model discovery now resolves PTY-specific homes and prepares the matching environment. PTY identifiers flow through preload, IPC, runtime RPC, and local or remote discovery paths. Codex model-list output is parsed with shared validation and normalized metadata. Native chat enrichment stores and publishes discovered Codex models by agent, host, and PTY scope, including model-specific reasoning options and defaults. 🚥 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/runtime/runtime-git-client.ts (1)
694-713: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRequire the remote PTY owner to match the selected runtime.
Line 713 forwards only
remotePty.handle. It discardsremotePty.environmentId. If the selected runtime changes while a PTY ID from another runtime remains available, the other runtime receives that handle. This can resolve an unrelated PTY and managed account.Only forward a parsed handle when its owner is absent or equals
target.environmentId. Otherwise omitptyId. Add a mismatch test for a PTY owned byenv-1withenv-2selected.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 ptyIdForRuntime = + remotePty === null + ? ptyId + : remotePty.environmentId === null || remotePty.environmentId === target.environmentId + ? remotePty.handle + : undefined return callRuntimeRpc<RuntimeDiscoverCommitMessageModelsResult>( target, 'git.discoverCommitMessageModels', { worktree: toRuntimeWorktreeSelector(context.worktreeId), agentId, - ...(ptyId ? { ptyId: remotePty?.handle ?? ptyId } : {}), + ...(ptyIdForRuntime ? { ptyId: ptyIdForRuntime } : {}),
🧹 Nitpick comments (4)
src/shared/agent-session-option-catalog-claude-codex.ts (1)
223-228: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winOne effort-label mapping is duplicated across two Codex model surfaces. Both files label the same
parseCodexModelListreasoning levels, and they disagree on thexhighcasing, so one discovered level renders two ways.
src/shared/agent-session-option-catalog-claude-codex.ts#L223-L228: replacelabelCodexEffortwith a shared helper exported fromsrc/shared/codex-model-list-probe.ts.src/shared/commit-message-agent-spec.ts#L176-L186: import that shared helper instead of the inlineeffort === 'xhigh' ? 'Extra High' : labelFromModelId(effort)expression.src/main/codex-accounts/runtime-home-service.test.ts (1)
420-437: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a lane-mismatch case next to the removed-account case.
The added tests cover
account-home,real-home,wsl-home, and a removed account. The lane check at the top ofresolveCodexHomeForPaneModelDiscoveryhas no test. A pane recorded aswsl:Ubuntuthat is probed with{ runtime: 'host' }must throw. That case pins the fail-closed contract for theshared-homeandcustom-homeroutes as well.💚 Proposed test
it('fails closed when the recorded PTY lane differs from the discovery runtime', async () => { writePaneRegistry({ 'pty-wsl-lane': { selectionKey: 'wsl:Ubuntu', accountId: null, homeRoute: 'wsl-home' } }) const store = createStore(createSettings()) const { CodexRuntimeHomeService } = await import('./runtime-home-service') const service = new CodexRuntimeHomeService(store as never) expect(() => service.resolveCodexHomeForPaneModelDiscovery('pty-wsl-lane', { runtime: 'host' }) ).toThrow('no longer matches') })src/main/text-generation/commit-message-agent-environment.test.ts (1)
146-161: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the
nullresult ofprepareForCodexPtyLaunch.The added cases cover a scoped path and
undefined. The contract also treatsnullas an authoritative real-home route. In that case the env must strip the Orca-ownedCODEX_HOMEoverride andprepareForCodexLaunchmust not run. Add that case so thenullversusundefineddistinction cannot regress silently.src/main/index.ts (1)
1432-1433: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThe PTY discovery resolver is registered twice as an identical inline arrow. Both copies assert
codexRuntimeHome!, and only the first site has a proven initialization guard.
src/main/index.ts#L1432-L1433: define one module-level function, for exampleresolveCodexPtyModelDiscoveryHome, and pass it here.src/main/index.ts#L2668-L2669: pass the same function and confirm the guard, or make the helper returnundefinedwhencodexRuntimeHomeis unset so discovery falls back to legacy resolution instead of throwing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d817242c-1575-452e-a7b9-3381941cc4b3
📥 Commits
Reviewing files that changed from the base of the PR and between 9a81874 and 20e2e8f5eddcc294b5751ed4d3ee6f6d50ca60fe.
📒 Files selected for processing (25)
src/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/runtime/orca-runtime-git.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/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.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.ts
20e2e8f to
49f6381
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. |
90d9142 to
b6e8961
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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ff2d70d-cd36-471c-94da-221244255850
📥 Commits
Reviewing files that changed from the base of the PR and between cb42b60 and b6e8961013a0a769cf51013db6110e30828499a5.
📒 Files selected for processing (25)
src/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/runtime/orca-runtime-git.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/git-inspection-api.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/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.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.ts
🚧 Files skipped from review as they are similar to previous changes (24)
- src/main/index.ts
- src/main/codex-accounts/runtime-home-service.test.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/main/ipc/filesystem.ts
- src/main/runtime/rpc/methods/git.ts
- src/shared/codex-model-list-probe.test.ts
- src/main/runtime/orca-runtime-git.ts
- src/main/runtime/rpc/methods/git.test.ts
- src/shared/commit-message-agent-spec.ts
- src/main/text-generation/commit-message-agent-environment.test.ts
- src/shared/agent-session-option-catalog-claude-codex.ts
- src/preload/index.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
- src/shared/agent-session-option-catalog.test.ts
- src/shared/agent-session-option-catalog.ts
- src/renderer/src/components/native-chat/use-native-chat-session-options.ts
- src/main/ipc/filesystem.test.ts
- src/renderer/src/runtime/runtime-git-client.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
- src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
- src/renderer/src/runtime/runtime-git-client.test.ts
- src/shared/codex-model-list-probe.ts
- src/main/codex-accounts/runtime-home-service.ts
- src/main/text-generation/commit-message-agent-environment.ts
2a5d556 to
0b45daa
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. |
0b45daa to
d2750b3
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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cd274369-e912-41de-bece-4306b5065bf4
📥 Commits
Reviewing files that changed from the base of the PR and between 5b7f442 and d2750b3afbad2ee2ed97a017096a0dca93dbadae.
📒 Files selected for processing (23)
src/main/codex-accounts/runtime-home-service.tssrc/main/index.tssrc/main/ipc/filesystem.tssrc/main/runtime/orca-runtime-git.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/git-inspection-api.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/runtime/runtime-git-client.test.tssrc/renderer/src/runtime/runtime-git-client.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.ts
🚧 Files skipped from review as they are similar to previous changes (22)
- src/main/runtime/rpc/methods/git.ts
- src/renderer/src/runtime/runtime-git-client.ts
- src/preload/index.ts
- src/main/runtime/rpc/methods/git.test.ts
- src/main/runtime/orca-runtime-git.ts
- src/main/index.ts
- src/main/ipc/filesystem.ts
- src/main/runtime/rpc/methods/git-params.ts
- src/shared/codex-model-list-probe.ts
- src/renderer/src/components/native-chat/use-native-chat-session-options.ts
- src/renderer/src/runtime/runtime-git-client.test.ts
- src/main/codex-accounts/runtime-home-service.ts
- src/preload/api/git-inspection-api.ts
- src/shared/codex-model-list-probe.test.ts
- src/main/text-generation/commit-message-agent-environment.ts
- src/shared/agent-session-option-catalog.test.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
- src/shared/agent-session-option-catalog.ts
- src/shared/commit-message-agent-spec.ts
- src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
- src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
- src/shared/agent-session-option-catalog-claude-codex.ts
d6446b6 to
89177cd
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: |
89177cd to
afee415
Compare
Summary
Codex model discovery can now resolve the managed account pinned to a PTY and run the existing model probe with that account's effective
CODEX_HOME. Native-chat enrichment scopes its cache by host and pinned account so switching accounts does not reuse another account's discovered model catalog.The new
ptyIdfield is optional throughout the renderer, preload, main-process, and runtime Git path. Older callers and runtimes continue to use the existing global Codex environment.This PR is stacked on #13183. Please review it after that PR lands; the shared runtime model-discovery changes will disappear from this diff once the base is merged.
Screenshots
No visual layout change. The existing native Codex model and reasoning controls receive account-scoped choices when a PTY has a managed Codex account pinned.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation:
pnpm run build:desktop— passed.git diff --check— passed.origin/main— no conflicts found.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 covered optional-field compatibility, PTY-to-account resolution, account-scoped cache identity, main-process ownership of managed account paths, commit-message discovery, and fallback behavior when no account is pinned.
Regression tests cover account-specific environment selection, unknown PTYs, IPC forwarding, runtime Git forwarding, and cache separation without changing the existing unscoped path.
Cross-platform review:
Security Audit
CODEX_HOME, auth files, tokens, or managed-home paths.Notes
@rp0927