Skip to content

fix(omp): show exit 0 for a command that finished normally - #26494

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/omp-exit-zero
Oct 8, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/omp-exit-zero

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​114 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28

ELI5

In an OMP chat, a shell command that succeeded showed its output but no exit code, while a failed one showed exit 3. Now a foreground command that finished normally shows exit 0 too; starting a still-running service does not.

What Changed

The problem. OMP reports an exit code only when a shell command fails. Orca's OMP chat (#26401) showed what OMP sent, so successful commands had no exit code on their row. Review of this patch also found that an OMP 18.4.0 named-service start could be marked exit 0 while the service was still running: its tool call had completed, but its process had not exited.

What is different for you. A command that ran in the foreground and finished normally now shows exit 0. Failed commands retain the code OMP reported, such as exit 3. Orca does not infer a code for a running, timed-out, signalled, background, or named-service result, or when foreground completion timing is missing.

How. src/main/acp/acp-dialects/omp-dialect.ts keeps OMP's reported code. Otherwise it infers zero only when the tool call is completed, details.wallTimeMs is present, and no timeout, signal, async, or service marker is present. Existing generic command results are left intact. Only an exit code OMP actually sent trims the "Command exited with code N" line; inferred zero cannot remove user output.

Why

The foreground timing gate, timeout/signal checks, async exclusion, and generic-result short circuit follow the common pattern. OMP's foreground result builder supplies elapsed time after a finite run; service-start completion supplies service state instead. Reusing the existing normalizer keeps that distinction at the provider boundary without adding process tracking or stored background state.

Intended differences: Orca retains its existing command-echo recognizer and normalizes each current update before earlier input is restored. It still extracts output when execution metadata is absent, while leaving the exit code unknown. It also excludes every service result from inference, even if one includes timing, because a completed service-start call does not prove process exit. No temporary deviation is introduced.

Known limit

Zero is inferred from OMP's foreground completion contract, not from tool completion alone: wall time must be present and service/async results are excluded. OMP completion updates omit the original input, so the current result's timing and lifecycle markers provide the evidence. If OMP omits both a reported exit and foreground timing, the row retains output with no exit code; it does not guess success. The verified built-in foreground/service/background shapes support these rules; arbitrary custom producers or future contradictory metadata are unverified. Existing historical rows are not retrofitted.

Linked Issue

Follow-up to #26401 (OMP over ACP); no separate issue.

Visual Proof

Live on final head 7273a31657d, using real OMP 17.0.5 and the existing login on macOS in an isolated native-chat rig with a plain folder workspace. The command details were expanded through the rendered controls. The full screenshots show the command, output, and code; the own session journal independently records the same results.

Successful foreground command: printf 'ok\n' → output ok, exit 0.

laptop-exit-zero-expanded.png

Failed foreground command: printf 'hi\n'; exit 3 → output hi, exit 3.

laptop-exit-three.png

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Final head 7273a31657d: 13 focused tests across two explicit files, queued node typecheck, and all 22 static checks passed. All 35 CI checks completed: 20 succeeded and 15 were skipped; skips are not test passes.

  • omp-dialect.test.ts covers foreground elapsed time (including zero milliseconds), reported failures, timeout/signal/background/service exclusions, missing timing, generic results, and preservation of output. The running named-service regression uses the verified OMP 18.4 producer shape; a separate defensive case includes service metadata with timing.

  • Live macOS OMP 17.0.5: both requested foreground commands ran once, and their expanded rows showed exit 0 and exit 3. Full screenshots are embedded above; actual session-journal records agree. Native-chat flags and disabled hooks were read back before input. The rig and its own laptop child worktree were removed after verification.

  • The full stable-file hash set was captured before launch, after activation, and after teardown with no read errors. Codex configuration (project trust rows stripped), hooks, and the other checked agent configurations were unchanged. OMP wrote its runtime databases, sidecars, and one session file while using its existing agent directory in place.

  • M4Air did not pass the shared RAM/load gate. Windows command rows were not exercised: OMP chat startup hit a separate pre-existing session-store failure, assigned to a separate investigation. The stopped Windows profile/database is preserved; its inactive QA checkout is also retained because Git still reports a lockfile modification despite verified identical file/index/commit bytes. The official removal command refused that modification; no force removal was used.

  • Live OMP 18.4 named-service execution, Linux/SSH/mobile behavior, and arbitrary custom producer metadata remain unverified. Existing historical rows are not retrofitted.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c4de4e7-e524-4ab1-b0d3-0e1072bbfc37
📥 Commits

Reviewing files that changed from the base of the PR and between 93b27c4 and 7273a31.

📒 Files selected for processing (2)
  • src/main/acp/acp-dialects/omp-dialect.test.ts
  • src/main/acp/acp-dialects/omp-dialect.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The OMP dialect now recognizes timeout, signal, async, and service details when normalizing tool results. If a completed foreground command has no reported exit code and meets the new conditions, normalization sets its exit code to 0. Otherwise, it leaves an omitted exit code undefined and retains any reported exit code. Tests cover these cases and update the successful-command recording expectation.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 7273a

Successful foreground OMP commands now show exit 0, and failed commands keep the code OMP reported. A background command may rarely show exit 0 if neither async indicator is present. This is a disclosed limitation with low impact, so the change looks safe to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the primary change: showing exit code 0 for normally completed OMP commands.
Description check ✅ Passed The description is detailed and covers the user impact, implementation, rationale, testing, visual proof, limitations, and platform coverage. It references issue #26401, although it does not use the t…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

OMP normally omits an exit code when a shell command succeeds, so Orca showed its output without exit 0. This change shows exit 0 for a finished foreground command and preserves reported failures such as exit 3.

Review found and fixed one PR-caused P2: OMP 18.4 can finish a service-start tool call while its named service is still running. Inferring zero from tool completion alone incorrectly claimed process exit. The final change requires foreground elapsed time and excludes service/background results; explicit reported codes remain authoritative. The regression uses the verified 18.4 producer shape, with a separate defensive service-with-timing case. A fresh narrow reviewer confirmed the fix at 7273a31657d4cbec7a9582c48c0655119d1c52f2; no new proven code issue remains.

The foreground timing gate, asynchronous-result exclusion, and preservation of generic results follow those parts of the common pattern. Intended differences: Orca retains its command-echo recognizer and normalization of each current update, preserves output when execution metadata is absent without inventing an exit, and excludes service results explicitly. No new process registry or persisted state was added.

Final-head validation: 13 focused tests across two files, queued node typecheck, and all 22 static checks passed. All 35 CI checks completed: 20 succeeded and 15 were skipped; skips are not test passes. Proportional final-diff readiness review completed without counsel.

Live macOS QA used real OMP 17.0.5 with the existing login in place, an isolated hidden rig, and a plain folder workspace. Both commands ran once: printf 'ok\n' showed output ok with exit 0; printf 'hi\n'; exit 3 showed hi with exit 3. The coordinator viewed both full original screenshots and read the actual session-journal records. Uploaded screenshots are embedded in the PR body. An initial missing-exit candidate was refuted by opening the normal collapsed turn/tool details; no product change or command retry was needed.

The rig's saved and rendered native-chat settings and disabled hooks were verified before input. All recorded rig/provider/driver processes exited, and the own laptop child qa-26494-omp-laptop was removed. Stable hashes had full coverage before launch, after activation, and after teardown with no read errors. Codex configuration with project trust rows stripped, hooks, and other checked configurations were unchanged; only OMP runtime database/sidecar/session files changed.

Remote QA required the authorized --no-parent exception after cross-host child creation was refused with LINEAGE_PARENT_NOT_FOUND. The initial unused M4Air checkout /Users/m4air/orca/workspaces/orca/qa-26494-omp-exit was removed; the later granted M4Air attempt created no rig or checkout because eight resource probes failed during the two-hour allowance. Windows selecting OMP hit a separate pre-existing startup failure; relevant files match the checked main snapshot, but main was not run. A separate investigator owns that finding. The stopped Windows profile/database at C:/Users/neil/orca-qa/pr-26494/qa/rig/user-data remains in place for that investigation. Its inactive checkout at C:/Users/neil/orca/workspaces/orca/qa-26494-omp-exit remains retained: Git reports a lockfile modification despite identical file/index/commit bytes after restoration and one metadata refresh. A final official removal attempt, after verifying ownership and no active terminals, refused the reported lockfile modification. No force removal was used.

Out-of-scope observation only: the Windows session-history page showed “Preparing the WSL SQLite reader” and “0 of 45 sessions,” suggesting history outside the isolated home. No diagnosis or product change was made for it. Live OMP 18.4 named-service execution, Linux/SSH/mobile behavior, and arbitrary custom producers were not exercised. Generic mixed result shapes remain unverified, with no supported producer example established. Historical rows are not retrofitted.

No merge or auto-merge was performed.

@brennanb2025
brennanb2025 merged commit b6b4d68 into main Oct 8, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant