Repository navigation
fix(omp): start new tasks without auto-resuming old sessions - #20622
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
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: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAdds fresh OMP launches with a generated Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Embedded OMP text in a non-OMP command is no longer treated as an OMP launch, so no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f259444a-157d-412f-b37b-a7c626106d51
📒 Files selected for processing (21)
docs/reference/omp-fresh-launch.mdsrc/main/ipc/pty-ipc-mock-registry.tssrc/main/ipc/pty-spawn-env-agent-overlays.test.tssrc/main/ipc/pty-spawn-env-terminal-basics.test.tssrc/main/ipc/pty/host-env/assembly.tssrc/main/pi/titlebar-extension-service.test.tssrc/main/pi/titlebar-extension-service.tssrc/main/pty/wsl-orca-env.test.tssrc/main/pty/wsl-orca-env.tssrc/relay/omp-fresh-launch-environment.test.tssrc/relay/plugin-overlay.tssrc/relay/relay-agent-hook-runtime.tssrc/shared/omp-fresh-config.tssrc/shared/omp-fresh-launch-shell.test.tssrc/shared/omp-fresh-launch.test.tssrc/shared/omp-fresh-launch.tssrc/shared/pi-agent-kind.tssrc/shared/tui-agent-startup.test.tssrc/shared/tui-agent-startup.tstests/tools/omp-fresh-launch-windows-smoke.tstests/tools/omp-fresh-session-runtime-smoke.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
Important
The fresh-launch guard prefixes the launch command with printenv ... && test -f ... (POSIX) or if ... (cmd/PowerShell), so recognizeAgentProcessFromCommandLine returns null for every guarded OMP launch. That silently disables the root-like-cwd guard (assertSafeAgentStartupCwd) on both the local and daemon paths, and drops the daemon's startup foreground hint.
Reviewed changes — new OMP launches now apply a one-time autoResume: false overlay across local, WSL and SSH hosts, with the overlay kept out of the saved resume configuration.
- Guard construction (
omp-fresh-launch.ts) — a per-shell command that verifiesORCA_OMP_FRESH_CONFIGis a regular file, emits a diagnostic and exits nonzero otherwise, and invokesomp --configexactly once when valid. - Launch-plan wiring (
tui-agent-startup.ts) — new-session, draft, and empty-prompt OMP plans wrap the command whilelaunchConfigkeeps the unwrappedcommandWithoutSessionOptionsfor resume. - Host materialization (
titlebar-extension-service.ts,assembly.ts,plugin-overlay.ts,relay-agent-hook-runtime.ts) — local/WSL and relay hosts write and export the overlay independently of status hooks; WSL addsWSLENVpassthrough. - Recognition (
pi-agent-kind.ts) — the guarded command resolves to kindomp. - Tests/docs — shell, relay, WSL and host-env tests plus out-of-CI Windows and real-OMP smokes, and
docs/reference/omp-fresh-launch.md.
ℹ️ Nitpicks
- The cmd guard's file-vs-directory and errorlevel behavior is exercised only by the out-of-CI
tests/tools/omp-fresh-launch-windows-smoke.ts; the CI-runnablesrc/shared/omp-fresh-launch.test.tsasserts substrings only, so a regression inif not exist "<path>\*"would pass CI.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Risk-reduction review at Actual production draft plans in bash/zsh: missing config and agent exit 17 both become exit 0; common agent recognizer returns null. Remaining user-facing consequence: Failed launches report success; safe-cwd and initial-agent hint paths can be bypassed. Needs exit preservation and narrow generated-command recognition across supported shells. |
There was a problem hiding this comment.
🟡 Minor · Recognize wrapped OMP draft commands in the shared classifier.
src/shared/pi-agent-kind.ts:50-63
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRecognize wrapped OMP draft commands in the shared classifier. In the POSIX
draftPromptEnvVarbranch,buildAgentDraftLaunchPlanprefixes the fresh OMP command with( ... ). This preventsisFreshOmpLaunchCommandfrom matching its guard prefix. WhenlaunchAgentis omitted, host and relay inference can returnnull, fall back topi, and skip OMP overlay preparation. Recognize this wrapper before the existing prefix check; the shared classifier covers both paths.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 6a2e2d6c-6080-49eb-89f9-31227a8ec9fd
📒 Files selected for processing (2)
src/shared/tui-agent-startup.test.tssrc/shared/tui-agent-startup.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/shared/tui-agent-startup.test.ts
- src/shared/tui-agent-startup.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
Caution
These commits make the OMP draft launch a hard error in fish: the new wrapper uses ( … ) (fish command substitution) and $? (fish uses $status), so fish aborts with command substitutions not allowed here and the agent never starts. The same subshell also stops clearEnvCommand from clearing ORCA_OMP_PREFILL in the parent shell on bash/zsh/sh.
Reviewed changes — re-review of the two commits pushed since the prior pullfrog review (c5986d5), which add status preservation to the OMP draft launch.
- OMP draft status preservation (
src/shared/tui-agent-startup.ts:255) — thedraftPromptEnvVarbranch now wraps the guarded OMP command in a subshell that captures the launch status, runs the prefill-env clear, and re-exits with the captured status. - Draft assertion update (
src/shared/tui-agent-startup.test.ts:651) — the OMP draft test now asserts the status-preserving wrapper by substring.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new recognition regex covers only the plain POSIX guard body. omp launch --config "$ORCA_OMP_FRESH_CONFIG" and both Windows spellings (cmd "%ORCA_OMP_FRESH_CONFIG%", PowerShell "$env:ORCA_OMP_FRESH_CONFIG") still make recognizeAgentProcessFromCommandLine return null, so the cwd guard and the daemon startup foreground hint stay bypassed for those launches.
Reviewed changes — delta since the prior pullfrog review (cd0636f): a follow-up commit adds command-line recognition for the OMP fresh-launch guard.
- Guard recognition (
src/shared/agent-process-recognition.ts:291) —recognizeAgentProcessFromCommandLinenow returns{ agent: 'omp', processName: 'omp' }when the line contains the POSIXomp --config "$ORCA_OMP_FRESH_CONFIG"body. - Coverage test (
src/shared/agent-process-recognition.test.ts:19) — a unit case asserts the subshell-wrapped draft command is recognized.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1824d9d5-a5b2-4bbe-8386-581737ad37e9
📒 Files selected for processing (2)
src/shared/agent-process-recognition.test.tssrc/shared/agent-process-recognition.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| } | ||
| // Fresh OMP launches are wrapped in a shell subshell so cleanup cannot | ||
| // overwrite the agent exit status; recognize the preserved command body. | ||
| if (/\bomp\s+--config\s+["']?\$ORCA_OMP_FRESH_CONFIG\b/.test(commandLine)) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Restrict fresh OMP recognition to the command position.
recognizeAgentProcessFromCommandLine scans the raw command before tokenization, so echo 'omp --config "$ORCA_OMP_FRESH_CONFIG"' is recognized as OMP even though echo is the executable. The daemon and local launch plans then apply agent-only handling. With a root-like working directory, they can reject the valid command through assertSafeAgentStartupCwd; local termination can also use the agent descendant sweep for this non-agent session. Match only the generated wrapper or require omp to be the executable token, and add a negative test for embedded text.
There was a problem hiding this comment.
Important
The recognition fix in this delta is correct and resolves both earlier recognition threads. The prior fish draft-launch concern at src/shared/tui-agent-startup.ts:255 is still open — the ( … ) / $? wrapper is emitted for every 'posix' shell, fish included, and fish aborts the OMP draft — so this is not an approval yet.
Reviewed changes — delta since the prior pullfrog review (5904fbb), commit 95a6ca8:
- Unified guard recognition (
src/shared/agent-process-recognition.ts:290) —recognizeAgentProcessFromCommandLinedelegates toisFreshOmpLaunchCommandinstead of the POSIX-only regex, soassertSafeAgentStartupCwdand the daemon startup foreground hint apply to every guarded launch form. - Draft-wrapper stripping (
src/shared/omp-fresh-launch.ts:70) —isFreshOmpLaunchCommanddrops a leading(so the subshell-wrapped draft command resolves toomp. - Cross-shell coverage (
src/shared/agent-process-recognition.test.ts:22) — a table test asserts recognition anddetectExplicitPiAgentKindFromCommandfor posix/cmd/PowerShell guards,omp launch, flags and the draft plan, plus a negative case for guard text embedded in a quoted argument.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
One regression in this delta: the new draft cleanup puts the $fish_pid dialect probe ahead of the agent, so a sh-family shell with set -u aborts the launch line and the OMP draft never starts. Details inline. The fish fix itself is otherwise correct, and the two prior recognition threads are resolved.
Reviewed changes — delta since the prior pullfrog review (95a6ca8), commits 6bcbf5f and c7fd8c8:
- Fish-aware draft cleanup (
src/shared/omp-draft-launch.ts) —withOmpDraftCleanupreplaces the( … )subshell with a$fish_pid-selected function that clearsORCA_OMP_PREFILLin the calling shell and returns the captured agent status. - Draft wiring (
src/shared/tui-agent-startup.ts:256) — the OMP draft path now callswithOmpDraftCleanupwhen the launch command is a generated guard; cmd wraps the guard in( … )so the cleanup follows either guard branch. - Recognition (
src/shared/omp-fresh-launch.ts:71) —isFreshOmpLaunchCommandalso recognizes the new draft prefix. - Live-shell coverage (
src/shared/omp-draft-launch-shell.test.ts,src/shared/omp-draft-launch-windows.test.ts) — per-shell tests assert the prefill is cleared in the calling shell, the status is preserved, and the agent runs once.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The prior set -u draft blocker is fixed, but the new dialect-selection eval makes fish print a parser error to the terminal on every fresh OMP draft launch. Details inline.
Reviewed changes — delta since the prior pullfrog review (c7fd8c8), commit c02defc:
- Nounset-safe draft cleanup (
src/shared/omp-draft-launch.ts) —withOmpDraftCleanupdrops the$fish_pidprobe and selects the dialect by trying the sh definition first, falling back to the fish one, so a sh-family shell underset -ustarts the agent. - Draft recognition prefix (
src/shared/omp-draft-launch.ts:9) —OMP_DRAFT_LAUNCH_PREFIXnow tracks theeval '__orca_omp_draft() {shape. - Live-shell coverage (
src/shared/omp-draft-launch-shell.test.ts) — each non-fish shell runs with and withoutset -u, and the agent's stderr is asserted to pass through.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — delta since the prior pullfrog review (c02defc), commit 5e8107c:
- Silent draft-shell dialect selection (
src/shared/omp-draft-launch.ts:21) —withOmpDraftCleanupnow gates the fish definition behindbuiltin --query set, a runtime probe that succeeds only in fish and is a suppressiblenot found/usage error elsewhere, replacing the sh-firsteval … 2>/dev/null || …whose fish-side parse error reached the terminal. - Recognition prefix (
src/shared/omp-draft-launch.ts:9) —OMP_DRAFT_LAUNCH_PREFIXtracks the new probe-led shape so generated draft commands still resolve toomp. - Regression coverage (
src/shared/omp-draft-launch-shell.test.ts) — the present case now asserts exact stderr (agent-stderr) and the absence of the fish parse-error text.
I checked the generated selection directly under real fish 3.7.0, zsh 5.9, ksh 93u+m, bash, dash and sh: exactly one dialect runs and nothing is written to stderr, and the focused shell and recognition suites pass with all six shells on PATH. The prior parse-error thread is resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
8cbc371 to
2edf2cc
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — the rebase delta is clean apart from one dropped comment.
Reviewed changes — delta since the prior pullfrog review (5e8107c): the branch was force-pushed and rebased onto current main (a37282bb). Every PR-authored file is byte-identical to the previously approved revision; the only net differences are newer main content folded into the PR diff, plus one rebase artifact.
- Rebased onto current
main— the 13 PR commits were linearized, pulling inmain'sORCA_IMAGE_PROTOCOLWSLENV passthrough and its tests and atui-agent-startuptest. No PR-authored source or test file changed. - Dropped
maincomment — the conflict resolution inwsl-orca-env.tskeptmain'sORCA_IMAGE_PROTOCOL_ENV/uentry but deleted the comment explaining why it is/urather than/p. Details inline.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| `${ORCA_IMAGE_PROTOCOL_ENV}/u`, | ||
| 'ORCA_OMP_FRESH_CONFIG/p', |
There was a problem hiding this comment.
The rebase kept main's ORCA_IMAGE_PROTOCOL_ENV/u entry but deleted the comment above it (// A protocol name, never a path; in-guest agents read it to pick an image encoder.). Relative to main this PR now removes that line, so the /u-not-/p rationale is lost — please restore it.
2edf2cc to
89a0ab8
Compare

Fixes #7710. Follows up #7712 by @mmarabel.
Starting a new OMP task now applies a one-time
autoResume: falsesettings overlay, so it opens a fresh conversation. Existing conversations stay in OMP's normal storage and remain resumable. Authentication, user configuration, explicit resume/session selectors and custom shell expressions retain their existing behavior; the overlay is omitted from saved resume configuration.The execution host creates the overlay for local, WSL and SSH launches, independently of status-hook preferences. A shell guard verifies the settings file before invoking OMP once. Missing settings produce an error instead of reopening an old conversation. New clients using an older host without overlay support require a host update and terminal restart.
Generated guards remain recognizable for startup attribution and working-directory validation. Draft launches clear the parent shell's prefill after either a successful invocation or a missing-config error and preserve the exit status. Unix cleanup supports sh, bash, zsh, dash, ksh and fish, including sh-family
set -u; cmd cleanup applies after either IF/ELSE branch. The Unix helper function remains in the shell and is redefined on the next draft.Validation
5e8107c1494, including 11 real-shell cases covering normal and strict-shell modes, prefill cleanup, exit status and exact agent stderr. Fish dialect selection uses a builtin query before evaluating the matching function definition; no wrong-dialect parse errors leak. Node typecheck and changed-code quality passed.c7fd8c8. Actual cmd and PowerShell exercised existing, missing, unset and directory config paths, including spaces, percent signs, ampersands and parentheses. Subsequent commits change only Unix cleanup and its tests; Windows command generation is unchanged.c02defc22ec, including Docker SSH and changed E2E. The final review then identified fish parser diagnostics, reproduced and repaired in5e8107c1494. CI for that new commit is pending.No full rendered OMP New Tab proof is claimed. Runtime scripts and mixed-version behavior are documented in
docs/reference/omp-fresh-launch.md.