Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughChangesThis PR adds OMP fresh-session directory environment handling and threads it through PTY spawning, runtime env assembly, WSL env passthrough, shell wrapper scripts, shared startup planning, and renderer launch behavior. It introduces shared env constants and a helper that derives a stable session directory from worktree scope. The OMP shell wrappers now avoid injecting a fresh session dir when session selectors already exist. Startup planning now uses shared helpers, and promptless OMP launches send concrete startup payloads. Tests were added and updated across these paths. Sequence Diagram(s)Diagrams are included in the hidden review stack artifact above for the env derivation, PTY/WSL wiring, wrapper injection, startup planning, and renderer launch flow. Related PRs: None specified. Suggested labels: review_needed_junior_swe, review_depth_standard Suggested reviewers: None specified. Poem Fresh sessions bloom in paths anew, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/main/pty/omp-shell-wrapper.ts (1)
72-93: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve
launchbefore prepending--session-dirIn both wrappers, the fresh-session prepend changes$1/$orcaArgs[0], soomp launchfalls into the generic branch and is forwarded asomp --extension ... --session-dir ... launch ...instead ofomp launch --extension ... --session-dir .... Capture the original subcommand before mutating the args, then branch on that saved value.src/main/ipc/pty.ts (1)
2163-2180: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winAdd
applyOmpFreshSessionDirEnvto the daemon-host PTY spawn path.
This path still skips the fresh-session env wiring, so launches that carryORCA_OMP_FORCE_NEW_SESSION_ENV=1can fall back to the wrapper’s default sessions dir and reuse stale OMP state.
🧹 Nitpick comments (2)
src/main/pty/omp-shell-wrapper.node-pty.test.ts (1)
183-297: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd test coverage for
omp launchwith forced new session.None of the new tests exercise
omp launch ...underORCA_OMP_FORCE_NEW_SESSION_ENV=1. Given the wrapper'slaunchdispatch check happens after--session-dirinjection (see companion comment inomp-shell-wrapper.ts), a test case withcommand: 'omp launch <agent>'would surface that ordering bug.src/main/pty/omp-fresh-session-dir.ts (1)
20-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winFunction is correct and well-tested; consider one more edge-case test.
The conditional-apply logic itself (skip when not forcing new session, preserve explicit override) is correct and matches the accompanying unit tests. Consider adding a test asserting the
'unknown-worktree'fallback behavior when bothworktreeIdandcwdare omitted, since that path is where the cross-worktree collision risk above materializes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 814cc609-a04a-4bbc-80ca-6e02d51c769c
📥 Commits
Reviewing files that changed from the base of the PR and between cf7fb4f and 21038cf78f8945806e97de65393e5d863a3b237a.
📒 Files selected for processing (16)
src/main/ipc/pty.tssrc/main/providers/local-pty-provider.tssrc/main/pty/omp-fresh-session-dir.test.tssrc/main/pty/omp-fresh-session-dir.tssrc/main/pty/omp-shell-wrapper.node-pty.test.tssrc/main/pty/omp-shell-wrapper.tssrc/main/pty/wsl-orca-env.test.tssrc/main/pty/wsl-orca-env.tssrc/main/runtime/orca-runtime.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-in-new-tab.web-runtime.test.tssrc/shared/omp-fresh-session-env.tssrc/shared/tui-agent-draft-startup.tssrc/shared/tui-agent-startup-building.tssrc/shared/tui-agent-startup.test.tssrc/shared/tui-agent-startup.ts
|
Rebased onto current Kept the OMP fresh-session isolation behavior on the current spawn/startup paths:
Force-pushed |
201318f to
6dcbf0f
Compare
|
Superseded by #20622 (fresh OMP session isolation), which contains the current implementation and verification on . Closing this stale duplicate so review stays on the maintained PR. |
|
Superseded by #20622. |
Fixes #7710
Summary
omp --session-dir "$ORCA_OMP_FRESH_SESSION_DIR"command instead of host-sideagent: "omp"shorthand.ORCA_OMP_FRESH_SESSION_DIRin local, IPC, daemon-host, and paired/runtime PTY spawn paths with a stable per-worktree session directory.omp launch ...dispatch when the wrapper injects--session-dir, and leave explicit user session selectors (--resume,--continue,--session-dir,--no-session,--fork) untouched./ppath conversion.Screenshots
Before/after screen recording will be attached to this PR. No UI chrome change; behavior change is terminal launch/session state.
Testing
pnpm lintpnpm typecheckviapnpm exec tsgo --noEmit -p config/tsconfig.node.jsonpnpm testfocused coverage:pnpm exec vitest run --config config/vitest.config.ts src/shared/tui-agent-startup.test.ts src/main/pty/omp-shell-wrapper.node-pty.test.ts src/main/pty/omp-fresh-session-dir.test.ts src/renderer/src/lib/launch-agent-in-new-tab.web-runtime.test.ts src/main/pty/wsl-orca-env.test.tspassed in the source worktree.pnpm exec vitest run --config config/vitest.config.ts src/main/pty/omp-fresh-session-dir.test.ts src/main/ipc/pty.test.ts src/main/providers/local-pty-provider.test.tspassed in the clean PR worktree.omp launch codexbecomesomp launch --extension <status> --session-dir <fresh> codex.pnpm buildomp launchwrapper dispatch, renderer promptless OMP launches, WSL env propagation.Additional checks:
pnpm exec oxlint src/main/pty/omp-shell-wrapper.ts src/main/providers/local-pty-provider.ts src/main/ipc/pty.ts src/main/pty/omp-fresh-session-dir.test.ts src/main/pty/omp-shell-wrapper.node-pty.test.ts src/main/ipc/pty.test.ts src/main/providers/local-pty-provider.test.tsNote: the clean PR worktree's
omp-shell-wrapper.node-pty.test.tsrun fails locally because the temporary worktree's freshly installednode-ptycannotposix_spawnpbash. The same focused node-pty test file passed in the source worktree where the native runtime is valid; a non-PTY POSIX wrapper smoke also verified the CodeRabbitomp launchcase in the clean worktree.AI Review Report
AI review checked CodeRabbit feedback and the changed launch paths. Findings addressed:
--session-dirbefore preservinglaunch, which would routeomp launchthrough the genericomp --extension ...path. Fixed by capturing the original subcommand before mutation and keepinglaunchfirst in both POSIX and PowerShell wrappers.pty:spawnpath skippedapplyOmpFreshSessionDirEnv. Fixed by applying it afterbuildPtyHostEnvand before daemon spawn options are created.args.cwd, so omitted cwd could hash intounknown-worktree. Fixed to pass resolvedcwd.WSLENV /p, daemon/local/IPC PTY paths, and path construction through Nodepath.join.Security Audit
Reviewed command construction, env propagation, path scoping, and IPC/daemon spawn surfaces.
worktreeIdor resolvedcwd; no user-provided shell interpolation is introduced.ORCA_OMP_FORCE_NEW_SESSION=1and an explicit session selector is absent, preserving user intent and avoiding overriding resume/session commands./ppath conversion.Notes
ELI5
Fresh OMP launches could reuse an old session instead of starting clean. Orca forces a stable per-worktree session directory so “new chat” is really new.