Skip to content

fix(pi): settle OMP status from the agent-end contract - #15658

Closed
brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/sta-4521-omp-status-stuck
Closed

brennanb2025 wants to merge 5 commits into
mainfrom
brennanb2025/sta-4521-omp-status-stuck

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1039 $\color{#cf222e}{\Huge{\mathbf{−}}}$​205 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​834
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​489 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​476

ELI5

When an OMP agent finishes a turn, the Orca sidebar could keep showing it as running. Orca was waiting for OMP to say "I'm idle now" — a signal OMP never sends. OMP instead tells you on every agent_end whether it is about to keep going. This PR listens to that: still going → stay working; done → settle immediately. It also stops a nested bash tool's "command finished" marker from making Orca think the OMP process itself has exited.

What Changed

  • The generated Pi/OMP status extension's agent_end handler branches for OMP runtimes (configured and runtime-routed from a Pi-kind pane): willContinue === true keeps the pane working and arms no idle-recheck timer; anything else posts the terminal agent_end immediately without consulting ctx.isIdle().
  • Pi and Prime keep their existing agent_settled / idle-recheck path.
  • OSC 133;D no longer retires launched-agent hook authority until the execution host confirms a shell is in the foreground. A recognized agent (including OMP) stays live; a missing/failed process read is unverifiable, not exited.
  • Tests cover configured OMP, title-routed OMP, argv-routed OMP, continuation-then-terminal, Pi/Prime isolation, and nested-133;D authority retention.

Why

OMP's agent_end payload documents willContinue?: boolean: true means an automatic continuation is scheduled; any other value is terminal. OMP does not expose agent_settled, and ctx.isIdle() can stay false after a finished turn, so the idle-recheck loop never posted done.

That contract alone is necessary but not sufficient. Full-screen agents leak nested-shell OSC 133;D onto the main PTY. Orca treated every 133;D as "the launched agent command exited" and retired hook authority, so a later real agent_end returned HTTP 204 and was silently suppressed. The renderer already confirms foreground before trusting 133;D; main now does the same, and an unverifiable read cannot retire a live pane.

Linked Issue

Fixes #14879
Fixes STA-4521

Also covers the stuck-at-working completion path of #14278 / STA-4130 (same willContinue root).

Supersedes #14884. Thanks to @bbingz — the willContinue handler and configured/runtime-routed split are carried forward (Co-authored-by). This PR differs from #14884 in:

  1. Tests cover argv-based runtime re-route (process.argv pointing at omp), not only process.title.
  2. The high-value test is a completed turn (agent_start then terminal agent_end) driving the posted status sequence to done, not an isolated agent_end post.
  3. Pins continuation-then-later-terminal settlement on the same pane.
  4. Extracts the extension VM harness so the OMP lifecycle spec stays under the test max-lines budget instead of growing the existing 700-line file.
  5. Nested-shell OSC 133;D no longer retires hook authority while the execution host still shows OMP in the foreground — the path that made a willContinue-only change insufficient in live testing.
  6. A failed/null foreground read is unverifiable, not agent exit, so SSH blips cannot retire a live OMP pane.

Visual Proof

N/A — generated extension + main-process launch-authority logic. The only user-visible effect is the existing sidebar/tab running indicator settling to idle after a completed OMP turn; that transition is asserted at the hook and runtime seams. A live OMP turn was not driven in Electron in this pass (OMP 17.0.5 is installed locally; the reporter's stuck state is on 1.4.185 with a completed TUI at π > …).

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

TDD on the OMP contract (src/main/pi/agent-status-extension-omp-lifecycle.test.ts):

Stage Result
Pre-fix 7/8 failed (continuations posted done because isIdle() was true; final events with non-idle context never posted done)
Post-fix 8/8 passed
Neutered handler (isOmpRuntime branch removed, tests kept) 7/8 failed again

Also:

  • pnpm vitest run --config config/vitest.config.ts src/main/pi — 4 files, 70/70 passed
  • pnpm vitest run --config config/vitest.config.ts src/main/runtime/command-finished-launch-authority.test.ts src/shared/agent-hook-listener-pi-compatible.test.ts — passed
  • Focused orca-runtime.test.ts cases for shell-foreground retire, OMP-foreground keep, unverifiable keep, and restored-receipt retire — passed
  • pnpm typecheck — passed
  • oxlint --deny-warnings on changed files — clean
  • oxfmt on changed files only — clean

Full pnpm lint / pnpm test / pnpm build left to CI.

Review

  • Security: no new trust boundary. willContinue is a strict === true check on an in-process extension event. Foreground confirmation uses the existing execution-host PTY APIs.
  • Cross-platform: generated extension is plain JS. Process-name matching uses existing recognizeAgentProcess / isShellProcess (Windows .exe covered).
  • Remote SSH: foreground reads go through ptyController on the execution host. A failed/null read does not retire authority (unverifiable, not exited). PTY exit still retires immediately when the host confirms the process is gone.
  • Mobile: no client change; mobile consumes the same hook status. Settling agent_end is what it already understands as done.
  • Backwards compatibility: OMP builds without willContinue settle as terminal (fail-open to done). Pi and Prime paths are unchanged. No wire/RPC/stream opcode changes.
  • Performance: OMP no longer arms the exponential idle-recheck timer. Command-finished confirmation waits 350ms then one process read, matching the renderer nested-shell settle window.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Author

  • X / Twitter: @BrennanKB5

Out of scope (file separately)

@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add a shared agent-status test harness and OMP lifecycle handling. OMP continuation events post agent_start, while terminal events post agent_end without idle detection. Command-finished launch-authority retirement now waits 350 ms, confirms the PTY foreground process, validates pane authority receipts, and retires authority only for recognized shells. Daemon protocol version 37 adds gated foreground-process confirmation. Tests cover lifecycle, authority, protocol compatibility, cleanup, and shell detection.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR directly addresses [#14879] by settling OMP status after terminal agent_end events.
Out of Scope Changes check ✅ Passed The command-finished authority and foreground-confirmation changes support the linked OMP status fix and its race-condition requirements.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Title check ✅ Passed The title clearly identifies the primary fix: settling OMP status from the agent-end contract.
Description check ✅ Passed The description covers all template sections with clear scope, rationale, linked issues, testing, compatibility considerations, and checklist status.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a0de56b-a047-4047-8afd-22fa669b5a38

📥 Commits

Reviewing files that changed from the base of the PR and between 012e9f4 and 96d2674.

📒 Files selected for processing (9)
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-source.test.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/runtime/command-finished-launch-authority.test.ts
  • src/main/runtime/command-finished-launch-authority.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment thread src/main/runtime/orca-runtime.ts Resolved
Comment thread src/main/runtime/orca-runtime.ts Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Rebased onto current main and reviewed until clean. Ready to merge from this pass. Did not rewrite the original settle/authority design — it already matches the OMP agent_end contract and the execution-host live / unverifiable / exited vocabulary.

Follow-up pushed as 2a593b6c45 (fix(runtime): drop command-finished generation on prune):

  • dropDisconnectedPtyRecord now deletes the command-finished settle-generation entry. Prune can drop a PTY without onPtyExit, so that map leaked one scalar per disconnected record.
  • Pinned overlapping nested 133;D: a stale shell-foreground settle must not retire after a later nested sequence.

No other product changes. CodeRabbit’s fire-and-forget unhandled-rejection note is not a proven crash (retirePaneAuthority already swallows listener throws; main unhandledRejection logging stays alive).

Landing order vs #15713

This PR should land first. #15713 is the other half of the OMP work (identity + ask/approval forwarding), is CI-red, and explicitly does not own willContinue / agent_end settlement.

SHELL_NAMES widening is identical to #15711 (complementary, not contradictory). No semantic collision with the other orca-runtime.ts cluster PRs; #15666 is a cousin on unverifiable SSH exit, already generation-fenced here.

Tests

pnpm vitest run --config config/vitest.config.ts src/main/pi src/main/runtime/command-finished-launch-authority.test.ts src/shared/agent-hook-listener-pi-compatible.test.ts
pnpm vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts -t "retires inherited launch authority|keeps launched-agent authority|stale command-finished|unverifiable command-finished|receipted restored PTY|disconnected PTY records are pruned"

Focused orca-runtime cases: 6 passed. OMP lifecycle + command-finished predicate: 20 passed. Readiness start and end: PASS, zero P0/P1/P2.

Electron

Isolated-profile CDP launch of this branch (Orca: brennanb2025/review-15658-head). App boots; workspace row / Terminal 1 / Agents pane render idle. Live OMP willContinue settle was not driven (would need a real OMP turn). Nested 133;D authority is main-process and is covered by unit tests, not these screenshots.

Empty isolated profile:

electron-app.png

Workspace open (idle sidebar + Terminal 1 + Agents history):

electron-sidebar.png

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/runtime/orca-runtime.ts (1)

35592-35656: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Scope acquisition.timedOut to timed callers.

When the idle probe uses the direct provider-tail fallback, a slow capture can set the shared acquisition’s timedOut flag after 750 ms. A concurrent caller without wait.timeoutMs then returns null instead of awaiting the same provider promise. Check typeof wait.timeoutMs !== 'number' before checking acquisition.timedOut. The visible-state fallback does not propagate retireOnTimeout, so this affects the direct provider-tail path.

src/main/runtime/orca-runtime.test.ts (1)

20817-20823: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Retire timed-out provider acquisitions

serializeProviderTerminalBuffer keeps timed-out acquisitions cached until the original promise settles. If serializeProviderBuffer never settles, later readTerminal calls return empty fallback data and never start a new serialization. Remove the acquisition on timeout or allow a replacement, then assert that a resolved follow-up snapshot restores tail.

🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.test.ts (1)

13216-13250: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated runtime setup for these authority tests.

The three new tests repeat the same OrcaRuntimeService construction, the 12-method notifier mock, and the terminal creation. Only the pty id, the tab id, and the foreground-process value change. Extract a local factory such as createLaunchAuthorityRuntime({ ptyId, tabId, foregroundProcess }) in this file. Do not name it helpers or utils, per the naming guideline.

As per coding guidelines: "Do not use vague names such as helpers, utils, common, misc, or shared-stuff for files, folders, or modules; use concrete domain-oriented names instead."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f9578c8-740e-4141-a7b3-cf90a9012714

📥 Commits

Reviewing files that changed from the base of the PR and between a89160c and 2a593b6.

📒 Files selected for processing (2)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread src/main/runtime/orca-runtime.test.ts Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Codex revision complete.

What changed:

  • Reworked command-finished cleanup around bounded pane-authority receipts and opaque per-attempt PTY identities. Retirement now requires the same PTY record, lifecycle, launch/restored authority, and an atomically matching hook receipt before clearing both authority layers.
  • Added fresh execution-host foreground confirmation for SSH through the existing relay request, with no wire change. Unavailable or null evidence remains unverifiable and preserves authority.
  • Expanded race, alias, hydration, teardown, and shell-classification coverage.

What I kept:

  • Kept the OMP lifecycle design and hook-driven running-to-idle transitions; the underlying fault was stale command-finished retirement, not OMP-specific status handling.
  • Kept the settle window and execution-host shell confirmation shape, while fencing every async boundary that could otherwise retire a newer launch.

Verification:

  • pnpm typecheck
  • node config/scripts/check-changed-code-quality.mjs
  • node config/scripts/check-react-doctor-changed.mjs
  • Affected Vitest suites: runtime (1,199 passed, 1 skipped), agent hooks (669 passed, 6 skipped; one unrelated WSL installer timeout passed on isolated retry), SSH/PTy controller (42 passed), shell/command-finished (21 passed), and Pi/renderer status coverage (47 passed).
  • Non-vacuity: disabling the OMP lifecycle made 7 of 8 unchanged acceptance tests fail; disabling pre-confirmation/conditional authority fencing made both first-hook race tests fail. Restoring the sources made both targeted reruns pass.
  • Electron CDP attached to the intended revise-15658 @ 2a593b6c45 dev instance and visibly launched OMP to idle. A real running-to-idle turn could not be completed because local OMP v17.0.5 had no model selected and returned Error: No model selected. Use /login, set an API key environment variable, or create /Users/brennanbenson/.omp/agent/agent.db Then use /model to select a model.

brennanb2025 and others added 5 commits August 23, 2026 17:51
OMP never idles in ctx.isIdle() and has no agent_settled hook, so Orca's
idle-recheck left the sidebar running after a finished turn. Honor
willContinue for configured and runtime-routed OMP, and keep leaked
nested-shell OSC 133;D from retiring hook authority while the execution
host still shows the agent in the foreground.

Fixes #14879
STA-4521

Co-authored-by: Bing.Z <[email protected]>
…neration entry

The command-finished guard required a shell in SHELL_NAMES, so a user on
ksh/dash/tcsh/csh/ash/elvish/xonsh could never settle launched-agent hook
authority until the pty itself exited. Those are bare shells for every
consumer of the predicate, so widening the set is the correct scope.

The settle-generation Map also kept one entry per abnormally-exited SSH pty:
that branch preserves launch authority by design (unverifiable, not exited),
but the counter is bookkeeping for a check that can no longer land.
Pruning can remove a PTY without onPtyExit, so the settle-generation
Map leaked one entry per disconnected record. Pin overlapping 133;D
so a stale shell-foreground read cannot retire a later nested settle.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/sta-4521-omp-status-stuck branch from 299da64 to eb278f7 Compare August 24, 2026 01:38
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (1)
src/main/runtime/orca-runtime.ts (1)

14001-14135: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Retire every pane-key authority before setting hookAuthorityAlreadyRetired.

AgentHookServer stores authority independently per pane key. A PTY can be rebound while the deferred attempt waits, but the attempt captures and retires only its initial pane key. Since the current-state check does not fence paneKey, the rebind can leave authority active while the full paneKeys retirement loop is skipped. Capture and retire every current pane-key receipt, or set hookAuthorityAlreadyRetired only after all keys are retired.

🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.test.ts (1)

13626-13635: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace the fixed microtask flush with a deterministic flush.

await Promise.resolve() twice assumes an exact number of microtask ticks between foreground.resolve(...) and the continuation after await this.ptyController?.confirmForegroundProcess?.(ptyId) in maybeRetireLaunchAuthorityAfterCommandFinished. The assertions that follow check that authority is unchanged. If the continuation has not resumed yet, the assertion passes for the wrong reason, so the fence under test is never exercised.

The same pattern appears at Lines 13445-13448, 13487-13490, 13538-13541, 13581-13583, and 13667-13669.

Use await vi.advanceTimersByTimeAsync(0) inside the fake-timer block, which drains pending microtasks and timers, instead of counting ticks.

♻️ Proposed change for the ABA test
       firstForeground.resolve('zsh')
-      await Promise.resolve()
-      await Promise.resolve()
+      await vi.advanceTimersByTimeAsync(0)
       expect(
         harness.runtime.getOrchestrationDispatchAuthority(replacement.handle)?.launchTokenHash
       ).toBe(replacementAuthority.launchTokenHash)
 
       secondForeground.resolve('omp')
-      await Promise.resolve()
-      await Promise.resolve()
+      await vi.advanceTimersByTimeAsync(0)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 14c61652-88a3-4945-b7f5-bf4c80cdbd97

📥 Commits

Reviewing files that changed from the base of the PR and between 41ddcbd and eb278f7.

📒 Files selected for processing (26)
  • src/main/agent-hooks/server-authority-evidence.test.ts
  • src/main/agent-hooks/server-pane-authority.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/daemon/daemon-foreground-confirmation-protocol.test.ts
  • src/main/daemon/daemon-protocol-version.test.ts
  • src/main/daemon/daemon-protocol-version.ts
  • src/main/daemon/daemon-pty-adapter-protocol-compatibility.test.ts
  • src/main/daemon/daemon-pty-adapter.ts
  • src/main/daemon/session.test.ts
  • src/main/daemon/session.ts
  • src/main/daemon/types.ts
  • src/main/index.ts
  • src/main/ipc/pty-runtime-kill-and-exit.test.ts
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-source.test.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/providers/ssh-pty-provider.test.ts
  • src/main/providers/ssh-pty-provider.ts
  • src/main/runtime/command-finished-launch-authority.test.ts
  • src/main/runtime/command-finished-launch-authority.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts
  • src/shared/shell-process-detection.test.ts
  • src/shared/shell-process-detection.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/shared/shell-process-detection.ts
  • src/main/pi/agent-status-extension-source.test.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/runtime/command-finished-launch-authority.ts
  • src/main/runtime/command-finished-launch-authority.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +2089 to +2091
if (restored || fence) {
this.markPaneAuthorityAbsent(ownerPaneKey)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Invalidate the stable-pane receipt after alias restoration.

When restorePaneAuthority(SOURCE) restores a retired SOURCE -> TARGET alias, ownerPaneKey still equals SOURCE. Line 2090 records a new receipt for SOURCE, but later captures resolve SOURCE to TARGET and retain the old retirement receipt for TARGET.

A delayed overlapping 133;D callback can then match that old receipt and retire the reattached pane. Re-resolve the pane key after restoreRetiredPaneFence, then record the absent receipt for the restored owner. Add an alias restoration race test.

Proposed fix
     if (restored || fence) {
-      this.markPaneAuthorityAbsent(ownerPaneKey)
+      this.markPaneAuthorityAbsent(this.resolvePaneKeyAlias(paneKey))
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (restored || fence) {
this.markPaneAuthorityAbsent(ownerPaneKey)
}
if (restored || fence) {
this.markPaneAuthorityAbsent(this.resolvePaneKeyAlias(paneKey))
}

brennanb2025 added a commit that referenced this pull request Aug 30, 2026
OMP exposes no agent_settled hook and ctx.isIdle() can stay false after a
finished turn, so Orca's idle-recheck loop backed off and spun forever and
the pane stayed "working" indefinitely. OMP instead marks non-terminal
agent_end events with willContinue; honor that for configured and
runtime-routed OMP and treat an absent flag as terminal.

Extracted from #15658, which bundles this with a launch-authority change
that conflicts with in-flight #17077. Only the settle half lands here.

STA-4130

Co-authored-by: Bing.Z <[email protected]>
brennanb2025 added a commit that referenced this pull request Aug 30, 2026
OMP exposes no agent_settled hook and ctx.isIdle() can stay false after a
finished turn, so Orca's idle-recheck loop backed off and spun forever and
the pane stayed "working" indefinitely. OMP instead marks non-terminal
agent_end events with willContinue; honor that for configured and
runtime-routed OMP and treat an absent flag as terminal.

Extracted from #15658, which bundles this with a launch-authority change
that conflicts with in-flight #17077. Only the settle half lands here.

STA-4130

Co-authored-by: Bing.Z <[email protected]>
brennanb2025 added a commit that referenced this pull request Aug 30, 2026
* fix(pi): settle OMP status from the agent_end contract

OMP exposes no agent_settled hook and ctx.isIdle() can stay false after a
finished turn, so Orca's idle-recheck loop backed off and spun forever and
the pane stayed "working" indefinitely. OMP instead marks non-terminal
agent_end events with willContinue; honor that for configured and
runtime-routed OMP and treat an absent flag as terminal.

Extracted from #15658, which bundles this with a launch-authority change
that conflicts with in-flight #17077. Only the settle half lands here.

STA-4130

Co-authored-by: Bing.Z <[email protected]>

* fix(pi): preserve non-terminal continuation guards

Keep the base Pi and Prime willContinue guard while settling terminal OMP events directly. Add regression coverage so sibling runtimes cannot publish a false completion after conflict resolution.

---------

Co-authored-by: Bing.Z <[email protected]>
Co-authored-by: Merge Sim <sim@local>
@nwparker

Copy link
Copy Markdown
Contributor

Closing as orphaned: linked issue #14879 was closed as a duplicate of canonical issue #14278; its OMP status fix is tracked there.

@nwparker nwparker closed this Aug 31, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(pi): settle OMP status from the agent_end contract

OMP exposes no agent_settled hook and ctx.isIdle() can stay false after a
finished turn, so Orca's idle-recheck loop backed off and spun forever and
the pane stayed "working" indefinitely. OMP instead marks non-terminal
agent_end events with willContinue; honor that for configured and
runtime-routed OMP and treat an absent flag as terminal.

Extracted from stablyai#15658, which bundles this with a launch-authority change
that conflicts with in-flight stablyai#17077. Only the settle half lands here.

STA-4130

Co-authored-by: Bing.Z <[email protected]>

* fix(pi): preserve non-terminal continuation guards

Keep the base Pi and Prime willContinue guard while settling terminal OMP events directly. Add regression coverage so sibling runtimes cannot publish a false completion after conflict resolution.

---------

Co-authored-by: Bing.Z <[email protected]>
Co-authored-by: Merge Sim <sim@local>
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.

[Bug]: omp agnet active indicator

2 participants