Skip to content

fix(omp): stop finished subagents holding the pane on working and name child rows - #29263

Merged
AmoabaKelvin merged 18 commits into
stablyai:mainfrom
kiendle:kiendle/omp-subagent-status
Oct 26, 2026
Merged

AmoabaKelvin merged 18 commits into
stablyai:mainfrom
kiendle:kiendle/omp-subagent-status

Conversation

@kiendle

@kiendle kiendle commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​72 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36

ELI5

Orca can miss live OMP workers or keep showing workers that have finished. This checks OMP's own worker list so the existing sidebar shows named live children and clears finished or cancelled ones.

What Changed

Why

Lifecycle events alone cannot recover missed starts or verify quiet workers. Reading the native registry provides that evidence without building a second status system.

Linked Issue

Fixes #30357
Part of #28522.

Visual Proof

Captured from hidden Electron renderers through Playwright/CDP with real installed OMP 18.12.1; no test windows were revealed. Same scenario on both sides: two OMP root sessions, each running three named children (IndexAudit, QuietWorker, ArtifactCheck) of the status-smoke agent.

Before (main 50c06d572a11) After (this PR)
Before: every child row shows only the generic agent name status-smoke, so the three workers are indistinguishable After: each child row shows its native OMP name (IndexAudit, QuietWorker, ArtifactCheck) beside status-smoke
Scale run: 8 sessions × 6 children (48 concurrent)

After, 8 sessions × 6 children: each root lists its six named children (DocScan, EdgeAudit, ArtifactCheck, QuietWorker, BuildCheck, IndexAudit)

The viewport shows the first six roots; the run asserted all eight.

Testing

  • Fail-before/pass-after on main: missed native children, generic names, and old session clocks; resolved approval text and stale native snapshots also have regression coverage.
  • Real installed OMP 18.12.1 on macOS arm64, hidden Electron: 2 sessions × 3 children and 8 × 6 passed quiet freshness, completion/cancel clearing, session replacement, and isolation; deterministic local provider responses.
  • 578 targeted tests across 41 files, full pnpm tc, and changed-code quality passed; no CI pass claimed.
    Not run: Linux, Windows, mixed-version SSH, full test suite, full lint, release build, or performance benchmark.

AI Disclosure

AI-assisted investigation, implementation, review, verification, and drafting with OpenAI GPT-6.1.

Review

Static scope review found no outstanding findings; this is not maintainer approval.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation copied or mechanically translated.

Notes

  • fix: correct managed OMP status and readiness detection #24196 overlaps on background completion, ownership, and session clocks; this PR owns native-roster recovery, while general readiness, dialogs, and foreground exit remain there or in core.
  • Optional fields preserve older peers and lifecycle fallback; the execution host owns SSH status, and folder workspaces use the same path.

Checklist

  • Small, focused native OMP change; user-facing behavior, mechanism, and alternatives explained.
  • Before/after captures attached.
  • Self-reviewed for correctness, security, and performance; cross-platform, SSH, and path impact considered.
  • Full lint/test/release-build gates or CI; targeted tests, full typechecking, and the E2E build passed locally.

Maintainer changes

I replaced the native registry observer with a smaller fix in the place that decides when the pane is done. The contributor's commits are still on the branch, and my own commits revert their code.

Why the observer was replaced

  • It added about 1,500 lines across 16 files: a 375-line observer with a 5-second refresh timer, session-scope fences, and changes to the post queue.
  • It sent a second root status (omp_status) that the host parsed alongside the normal hook events. That gave OMP two status sources that could disagree.
  • It conflicted with current main in 9 files.

Root cause. OMP's task:subagent:lifecycle frames don't always pair up. A wake turn can send started before the previous run's terminal frame, and a wake turn whose finalize step throws never sends a terminal frame. Orca kept every id it saw start until a matching terminal frame arrived, so one leftover id blocked agent_end for good.

What the fix does

  • When OMP's root turn really ends (its agent_end without willContinue), the extension drops any child that OMP no longer runs, then settles as before.
  • A child counts as running if ctx.getAsyncJobSnapshot() still lists its task job, or if its AgentRegistry session is streaming or still has pending background work. AgentRegistry is the one OMP gives extensions as pi.pi.
  • If an OMP build lacks these APIs, or its job snapshot has no agentId (builds before about 18.3), nothing is pruned and behaviour is the same as before.
  • OMP child rows now use the child's name (its id) when the frame has no description. Before, same-agent siblings all showed the same agent name.
  • No change to the host, the wire format or the renderer, so mixed client/server versions and SSH hosts are unaffected.

Evidence

  • Real OMP 18.12.2, interactive, with a scripted local model spawning two background children, and one child's completed frame dropped on purpose:
    • Main: never posted agent_end and kept the ghost row.
    • This branch: posted agent_end with an empty roster at the root's final turn end.
  • Without a drop, both trees end on agent_end, and no live child was pruned early.
  • Each new test fails without the fix it covers.
  • The visual proof above was taken on the replaced implementation. The row labels match what this change shows.

Fixes #30357. Related: #30230 reported the same stuck spinner. This fixes it for OMP. Plain Pi (pi-subagents) leftovers come from a separate cause and are still open.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

OMP completion handling now reconciles subagent membership with async-job snapshots and active child sessions. When the snapshot identifies finished children, the handler removes them before posting completion. If completion is withheld and pruning changes the visible roster, the handler posts a subagent update. OMP child labels fall back to the child ID when the event description and workflow key are unavailable. Tests cover snapshot reconciliation and label fallback.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Moderate · up to 1e99d

OMP can report a parent complete while a child still has work. Preserve child tracking when registry evidence is unavailable or a submission has been admitted before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning The implementation does not meet the core requirements in [#30357]. forgetFinishedOmpSubagents checks getAsyncJobSnapshot() and AgentRegistry only for IDs already in lifecycleState.active; it … Implement native OMP roster reconciliation through the existing managed extension and hook store. Add verified native children that have no lifecycle row, remove stale children from the verified roster, and refresh quiet children without ch…
Docstring Coverage Warning Docstring coverage is 28.21% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 35 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main changes: preventing finished OMP subagents from keeping the pane active and naming child rows.
Out of Scope Changes check Passed The reviewed changes remain connected to [#30357]. The harness API, OMP settlement handling, child-label fallback, pruning logic, and related tests support native OMP child lifecycle reporting. The ch…
Description check Passed The pull request description includes all required sections, explains the user-facing change and rationale, links issue #30357, provides visual proof, testing details, AI disclosure, scope notes, and …
Full details: Out of Scope Changes check

Explanation

The reviewed changes remain connected to [#30357]. The harness API, OMP settlement handling, child-label fallback, pruning logic, and related tests support native OMP child lifecycle reporting. The changes add no separate service or UI and do not demonstrate an unrelated Pi-family migration.

Full details: Description check

Explanation

The pull request description includes all required sections, explains the user-facing change and rationale, links issue #30357, provides visual proof, testing details, AI disclosure, scope notes, and checklist status. It clearly documents unrun platforms and incomplete full gates.

Full details: Linked Issues check

Explanation

The implementation does not meet the core requirements in [#30357]. forgetFinishedOmpSubagents checks getAsyncJobSnapshot() and AgentRegistry only for IDs already in lifecycleState.active; it cannot recover missed starts or an absent receiver baseline. The code performs this check only during the root agent_end path. It does not reconcile a complete native roster or refresh quiet live children. The added tests cover pruning and fallback behavior, but they do not establish the missing-roster and quiet-refresh requirements.

Resolution

Implement native OMP roster reconciliation through the existing managed extension and hook store. Add verified native children that have no lifecycle row, remove stale children from the verified roster, and refresh quiet children without changing activity clocks or opening a root turn. Preserve lifecycle-only fallback for unavailable or incomplete reads. Add regression tests for missed starts, absent baselines, quiet refresh, exact session and parent fencing, session replacement, delayed snapshots, and resolved approval text.

  • Autofix · 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.

@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: Advanced
  • Run ID: b531be8b-46e4-4e5f-9799-b47019625609
📥 Commits

Reviewing files that changed from the base of the PR and between e2f2277 and 16b06b8.

📒 Files selected for processing: 32
  • docs/site/content/docs/agents/supported.mdx
  • src/main/agent-hooks/server-pi-normalization.test.ts
  • src/main/agent-hooks/server/server-status-application.ts
  • src/main/pi/agent-status-completion-delivery.test.ts
  • src/main/pi/agent-status-extension-omp-model.test.ts
  • src/main/pi/agent-status-extension-omp-registry-fixture.ts
  • src/main/pi/agent-status-extension-omp-registry.test.ts
  • src/main/pi/agent-status-extension-session-change.test.ts
  • src/main/pi/agent-status-extension-source.test.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-omp-consumer-delivery.test.ts
  • src/main/pi/agent-status-omp-registry-observer-source.ts
  • src/main/pi/agent-status-omp-registry-source.ts
  • src/main/pi/agent-status-omp-root-status-source.ts
  • src/main/pi/agent-status-post-queue-source.ts
  • src/main/pi/agent-status-session-boundary-source.ts
  • src/main/pi/agent-status-subagent-roster-source.ts
  • src/main/pi/omp-session-status-owner-source.ts
  • src/main/pi/omp-session-status-owner.test.ts
  • src/main/pi/omp-transcript-metadata.test.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts
  • src/main/runtime/terminal/output/terminal-title-tracker.ts
  • src/main/runtime/terminal/output/terminal-transient-facts.ts
  • src/renderer/src/store/slices/agent-status-live-entry-builder.ts
  • src/renderer/src/store/slices/agent-status-omp-native-session-boundary.test.ts
  • src/shared/agent-hook-listener/providers/pi-family-events.ts
  • tests/e2e/helpers/omp-deterministic-provider.ts
  • tests/e2e/helpers/omp-native-observation.ts
  • tests/e2e/helpers/omp-subagent-status-runtime.ts
  • tests/e2e/omp-subagent-status.spec.ts
💤 Files with no reviewable changes: 2
  • src/main/pi/agent-status-extension-session-change.test.ts
  • src/main/pi/agent-status-completion-delivery.test.ts

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

@kiendle

kiendle commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

CodeRabbit follow-up, edba859: both functional findings are fixed with focused regressions. Fresh verification: 3,611 affected tests passed (56 skipped), full pnpm tc passed, changed-code quality gates passed, and the installed-OMP hidden-Electron E2E passed.

Docstring coverage warning: not adding blanket docstrings merely to reach 80%. AGENTS.md explicitly requires concise, non-obvious comments only. The event-driven retry has a targeted explanatory comment, and both edge behaviors are documented in the existing supported-agent docs. No coverage threshold or lint rule was weakened.

@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: Advanced
  • Run ID: 9f8d9a16-f171-4260-b703-4165d4a83d53
📥 Commits

Reviewing files that changed from the base of the PR and between 16b06b8 and edba859.

📒 Files selected for processing: 6
  • docs/site/content/docs/agents/supported.mdx
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-omp-consumer-delivery.test.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts
  • src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts
  • src/main/runtime/terminal/output/terminal-transient-facts.ts
🚧 Files skipped from review as they are similar to previous changes: 2
  • docs/site/content/docs/agents/supported.mdx
  • src/main/pi/agent-status-extension-source.ts

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

@kiendle

kiendle commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Latest-head review loop completed for 72180bd: CodeRabbit coverage is reviewed for that exact commit and all review conversations are resolved, confirmed in two observations 45 seconds apart. The PR testing section now contains the fresh evidence: 3,616 tests passed (56 skipped), full pnpm tc and changed-code quality passed, and installed-OMP hidden-Electron scenarios passed at 2 sessions x 3 children and 16 sessions x 8 children. The tokenless overlapping-marker regressions fail before the fix with [1, 7] and pass afterward with [7].

Remaining external gate: GitHub Actions runs for this head report action_required with no jobs started (for example https://github.com/stablyai/orca/actions/runs/38826770132). This account has READ permission on stablyai/orca and cannot unblock those runs; maintainer action is needed. No CI pass is claimed, and the PR has not been merged. The non-blocking docstring coverage advisory remains addressed by the repository-policy explanation above.

@kiendle

kiendle commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Reshaped onto main with #30273/#30285, dropping foreground/prompt-marker machinery and retaining native OMP roster recovery with its necessary session fences. The reduced diff passes 578 targeted tests, full typechecking, changed-code quality, and installed OMP 18.12.1 hidden-Electron runs at 2×3 and 8×6 sessions/children; no CI pass is claimed.

@AmoabaKelvin AmoabaKelvin changed the title fix(omp): track live subagents from the native registry fix(omp): stop finished subagents holding the pane on working and name child rows Oct 25, 2026

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a0010679-80c6-46c2-8e1a-aa9596f7925b
Commits

Reviewing files that changed from the base of the PR and between 5cc2c22 and 1e99d02.

Files selected for processing: 5
  • src/main/pi/agent-status-extension-async-subagents.test.ts
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-subagent-roster-source.ts

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

@AmoabaKelvin
AmoabaKelvin merged commit d2f9617 into stablyai:main Oct 26, 2026
42 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.

OMP: Orca's child roster goes stale or misses children; read OMP's native agent registry

2 participants