Skip to content

feat(pi): show Pi and OMP background children as rows - #23201

Merged
nwparker merged 13 commits into
stablyai:mainfrom
AmoabaKelvin:pi-family-panes-show-child-rows
Oct 6, 2026
Merged

nwparker merged 13 commits into
stablyai:mainfrom
AmoabaKelvin:pi-family-panes-show-child-rows

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1174 $\color{#cf222e}{\Huge{\mathbf{−}}}$​59 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1115
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​513 $\color{#cf222e}{\Huge{\mathbf{−}}}$​110 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​403

ELI5

When a Pi or OMP agent starts helpers that run in the background, Orca's sidebar only showed the main agent as "working", with nothing under it. Now each running helper shows up as its own row under the agent, the same way Claude and Codex helpers already do, and disappears when it finishes.

What Changed

Before: a Pi or OMP pane with background children (pi-subagents runs, OMP task children) showed one "working" row and no hint of what was running.

After: each live child appears as a row under the agent, showing the pi-subagents agent name (e.g. scout) or OMP's short task description, and how long it has been running. A row goes away as soon as that child ends, even if the main agent is idle at the time.

How it works:

  • Orca's status extension, which runs inside Pi and OMP, already tracked which children were running so it could keep the pane on "working" until they finished (fix(pi): stop pi-subagents workflows from pinning a pane on working #22533). It now also remembers each child's label and start time, and attaches the full list of live children to every status update it sends to Orca.
  • Ordinary updates read the child list when sent, so queued updates and retries carry the current children. A final update for a closed session keeps its original session identity and cannot inherit the next session’s children.
  • When a child ends and nothing else is being sent, the extension sends a new subagents_update event. If an update is already queued or waiting to retry, it sends nothing extra, because that update will carry the new list.
  • On the Orca side (pi-family-events.ts), the list becomes the row's subagents. subagents_update re-publishes the pane's last row with the new list, the same way model_select already re-publishes it with a new model; the two now share one code path. It never creates a row, never reveals a hidden resume placeholder, and never changes another agent's row.
  • Pi restarts the extension on a fresh event channel for /new, resume, fork and /reload. The children, turn counters and runner-exit grace check survive a same-session restart, so an exited child can settle the pane after /reload or same-file resume without another turn. Real session end or quit clears the check.
  • When Pi ends a session (/new, fork, resume into another session), the old copy of the extension ends the run under the old session, before the new session's first update. Unacknowledged completions, including those retrying or already in flight, have their own queue slots ahead of the next session. Successful in-flight delivery removes its slot without a duplicate. A completion created by closing the session is marked as a session boundary so Orca records it without an "agent finished" notification. pi-subagents never reports the old session's children to the new one; if the old session is resumed it does, so its children are set aside and restored then.
  • Pi’s delivery queue also survives /reload, so an earlier HTTP request and the new registration send in order. Starting another turn retires an unacknowledged ordinary completion for that same session; real session-boundary completions remain queued.
  • OMP keeps one copy of the extension for the whole process. /new and branch cancel OMP's own background jobs, so the run ends there; fork and resume leave them running, so the children are kept.
  • A child that starts after the run has finished re-opens the run, so the pane goes back to done when that child ends (the first half of [Bug]: OMP tab spinner stays on after OMP is idle; /exit then fires an 'agent finished' notification #22854).
  • Closing a Pi dialog while children are still running now reports the pane as busy rather than idle. Pi reports idle once its own turn settles, but the children still hold the run open.

One knock-on worth calling out: Orca already refuses to synthesise a "stopped" row for a pane whose live children could be the only thing keeping it busy — pressing Ctrl+C at a lead's idle prompt cancels nothing, so claiming a cancellation there would be wrong. Claude gets around that by reporting its main agent's state separately from the pane's combined state, so Orca can keep the children working and still record the cancellation. The Pi extension does not report a separate main-agent state, so from now on Ctrl+C on a Pi pane that has a live child row records nothing at all: the row stays "working" until the children finish. Without children it still settles as stopped, exactly as before. Both halves are pinned by tests. Teaching the extension to report its own main-agent state would recover the cancel marker and is the natural follow-up.

Why

The issue explains why publishing children over OSC isn't enough: an OSC update replaces the hook row entirely, which drops the resume information. Sending the children through the hook lane keeps the prompt, tools and resume details on the same row.

The extension's row limit is interpolated from Orca's own AGENT_STATUS_MAX_SUBAGENTS rather than re-typed, so the two cannot drift apart and leave the extension sending rows the receiver quietly drops.

The extension sends the whole list every time instead of "started" and "ended" messages. Its send queue only keeps the newest update, so a single "ended" message could be lost; a full list fixes itself on the next update, and a missing list simply means no children.

Only the agent name or OMP's short description is shown. pi-subagents redacts task prompts, so the task text is never sent.

Linked Issue

Fixes #22868

This covers what Pi and OMP can report today: each running child, by agent name or task description. The issue also proposes a "monitoring" state for watcher children and a per-child model. Orca already shows both for Claude and Codex, but neither pi-subagents nor OMP sends either piece of information, so there is nothing for Orca to show yet. Once a Pi-family agent sends them, they can go through the same path this PR adds.

Visual Proof

Before helpers:
1-before-pi-two-helpers-no-rows

Claude code reference:
2-reference-claude-gets-a-row

After the helpers:
3-after-pi-two-helper-rows

Testing

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

Session changes were recorded on real Pi 0.87.1 with pi-subagents 0.71.0 against a scripted local model: /new, fork, resume, /reload (idle and mid-turn), a workflow, quit, and a failed delivery, each with a live child. The test harness now restarts the extension the way Pi does (fresh event channel, every handler called); before, it reused one channel, which hid that the roster did not survive a restart.

Not covered:

Review

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 (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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)

@coderabbitai

coderabbitai Bot commented Sep 26, 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

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: 353440b5-a5c8-436b-95a5-04db92b67312
📥 Commits

Reviewing files that changed from the base of the PR and between a8e499de7ee0b025af4ed55bb22f882521fdfaf3 and 2987942.

📒 Files selected for processing (12)
  • src/main/pi/agent-status-completion-delivery.test.ts
  • 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-session-change.test.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-post-queue-source.ts
  • src/main/pi/agent-status-reload-delivery.test.ts
  • src/main/pi/agent-status-session-boundary-source.ts
  • src/main/pi/agent-status-subagent-roster-source.ts
  • src/shared/agent-hook-listener/providers/pi-family-events.ts
  • tests/tools/omp-completion-runtime-smoke.mjs

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


📝 Walkthrough

Walkthrough

Pi and OMP hooks now publish active subagent snapshots with status payloads. Subagent lifecycle handling records child details, updates rosters as children start or exit, and resets roster state at session boundaries. The Pi-family event normalizer applies roster updates to eligible existing status rows. Tests cover roster contents, updates, clearing, queued posts, retries, and session changes.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 29879

Pi and OMP panes now show live background children as rows and keep final status updates correct when the session changes. The earlier concern that an unsent completion was lost on a session change is fixed, and tests cover it. No open issues remain that should block merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 29879

The change retains authenticated status delivery and bounded child-row data. No introduced security vulnerability was established, but delayed-update attribution and recovery after interruption remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated new mutation surface is status data on an existing row selected by pane key and matching provider type. Child labels and identifiers become additional status fields; the inspected code does not grant them execution authority. Complete downstream exposure and the generic high-fanout scope were not established.

Trust Boundaries and Controls

  • observed — Roster/model updates preserve the previous row's status and require matching provider type, but the normalizer does not compare provider-session identity. The outer listener separately carries session identity on the event. Pane/provider eligibility and endpoint authentication are demonstrated controls; rejection of a delayed same-provider update from a previous session remains unverified.

Resilience and Maintainability Implications

  • observed — OMP fork/resume deliberately retains running children and refreshes the current session metadata. The inspected cross-session tests assert eventual completion but not its session identity. This leaves an ownership-contract verification gap, not a demonstrated security violation.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #22868 requests optional child kind and model details, with watch-only children producing workingMode: 'monitoring'. The PR carries child IDs, state, start time, agent type, and descriptio… Add optional child kind and model data to the roster and hook payload. Map watch-only children to workingMode: 'monitoring'. Add tests for watcher and per-child model behavior.
Docstring Coverage ⚠️ Warning Docstring coverage is 36.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding sidebar rows for Pi and OMP background children.
Description check ✅ Passed The description covers the required sections, including the user-facing change, rationale, linked issue, visual proof, testing, and checklist. The blank Review section is non-critical.
Out of Scope Changes check ✅ Passed The roster, delivery queue, session-boundary, restart, and completion changes support reliable reporting of Pi-family child rows under issue #22868. The associated tests exercise those behaviors. No u…
Full details: Linked Issues check

Explanation

Issue #22868 requests optional child kind and model details, with watch-only children producing workingMode: 'monitoring'. The PR carries child IDs, state, start time, agent type, and description through subagents_update, and updates the existing pane row. However, agent-status-subagent-roster-source.ts does not retain or send kind or model, and pi-family-events.ts does not map watcher children to monitoring. The change therefore does not implement those issue requirements or test them.

  • Fix all pre-merge checks with AI

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.

@pullfrog pullfrog 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.

ℹ️ No critical issues — one rough edge inline.

Reviewed changes

  • Child rows over the hook lane — the generated Pi status extension now remembers each live child's agentType/description/startedAt and attaches the whole roster to every hook post; a new subagents_update event restates the pane's last row when a child ends between lead events, so prompt, tools, and resume stay on the same row.
  • Host normalization — normalizePiCompatibleEvent carries subagents onto every payload and folds subagents_update into the existing model_select restatement path, refusing to invent a row, unhide a providerSessionOnly placeholder, or restate another agent's row.
  • Roster boundaries — a Pi /new session resets the roster and settles a run the children held open; OMP session_shutdown/session_switch reset through the same resetSubagentRoster() helper.
  • Tests — server-level normalization tests plus generated-extension tests covering queue coalescing, runner exits, session boundaries, and in-process reload. Both changed files and the related listener/status suites pass.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Workflow runs excluded from child rows — the extension now records mode: 'workflow' on started and a shared isVisibleSubagent() keeps pi-subagents workflow orchestration runs in active (so they still hold the pane) while dropping them from the published subagents snapshot; onRunnerExit switched from newlyExited to wasVisible, so a workflow's runner exit no longer posts a row update. This closes the prior review's unnamed-workflow-row finding.
  • Test coverage — pins that a workflow run never appears in subagents while it still holds the pane, and that its completion settles the run via agent_end.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Ignore roster updates after the lead row is complete. · pi-family-events.ts:36-55

src/shared/agent-hook-listener/providers/pi-family-events.ts:36-55
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Ignore roster updates after the lead row is complete.

agent_end retains a done row. A later subagents_update can replace its roster and change the visible completed row.

Suggested fix
     if (
       !previous ||
       previous.providerSessionOnly === true ||
       previous.payload.agentType !== agentType ||
+      (eventName === 'subagents_update' && previous.payload.state === 'done') ||
       (eventName === 'model_select' && !model)
     ) {

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: eaf745e1-ee5c-406c-bbd5-3aa2a7eb0774

📥 Commits

Reviewing files that changed from the base of the PR and between 263f13167a56bb073766ed2c54b0eabde4e13ee1 and 371a2e31fe23cd9e2b7758ce392f53008690d829.

📒 Files selected for processing (2)
  • src/main/pi/agent-status-extension-async-subagents.test.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; 8 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the pi-family-panes-show-child-rows branch from 371a2e3 to 911a0db Compare September 27, 2026 07:02

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Reject subagents_update from a different OMP session. · pi-family-events.ts:36-55

src/shared/agent-hook-listener/providers/pi-family-events.ts:36-55
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject subagents_update from a different OMP session.

The hook server handles requests concurrently. If session A’s request finishes body parsing after session B’s request, the server accepts both events for the same pane. The current branch checks only agentType, then copies session A’s subagents into session B’s latest payload. The current roster can therefore be replaced by the previous session’s roster.

Compare the incoming OMP session identifier with the latest row before merging the roster. Same-session updates remain valid.

Suggested fix
     const previous = state.lastStatusByPaneKey.get(paneKey)
+    const eventSessionId = readString(hookPayload, 'session_id')
     if (
       !previous ||
       previous.providerSessionOnly === true ||
       previous.payload.agentType !== agentType ||
+      (agentType === 'omp' &&
+        (eventSessionId === undefined || previous.providerSession?.id !== eventSessionId)) ||
       (eventName === 'model_select' && !model)
     ) {
       return null
     }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b0b23e2c-4877-4d8e-8c8a-f25a5102841c

📥 Commits

Reviewing files that changed from the base of the PR and between 371a2e31fe23cd9e2b7758ce392f53008690d829 and 911a0db324388b71fde57f982320b9060dee44b6.

📒 Files selected for processing (4)
  • src/main/pi/agent-status-extension-async-subagents.test.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-ui-prompt-source.ts

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

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review (371a2e31fe → 911a0db324, net +61/−2 over 4 files; the branch was rebased, so the scope was isolated by comparing the two trees for the PR's files):

  • Kept a completion ahead of a new Pi session — post() now computes keepsCompletion: when session_start finds a queued agent_end in the latest-only slot, it preserves that completion instead of overwriting it, so a /new can no longer drop the completion and leave the pane on working.
  • Settled a children-held OMP run on session_switch — captures heldByChildren before resetting the roster and posts agent_end, matching Pi's session_start behavior.
  • ui_prompt_end no longer reports idle while children hold the run — forces is_idle: false when lifecycleState.waiting.
  • Tests — new cases for each path (in-flight completion behind a new session, OMP session switch, dialog close with live children). The two changed test files pass locally (45 tests).

ℹ️ Coalesced session_start skips the host's session boundary

When keepsCompletion folds a Pi session_start into the queued agent_end, the session_start event never reaches the host, so clearPaneTurnCacheState does not run and no hidden providerSessionOnly resume row is minted. The surviving agent_end is a visible done row that carries the previous session's cached prompt/tool until the new session's first before_agent_start. This is the intended trade (better than a stuck working row) and self-corrects on the next turn, but worth confirming it is acceptable if the stale prompt is visible on an otherwise-empty new session.

Technical details
# Coalesced `session_start` drops the host turn-cache clear

## Affected sites
- `src/main/pi/agent-status-extension-source.ts:211-219` — `keepsCompletion` rewrites the pending post to `agent_end` when `session_start` is posted with a queued completion, so no `session_start` payload is sent.
- `src/shared/agent-hook-listener/providers/pi-family-events.ts:23-30` — only Pi/Prime `session_start` calls `clearPaneTurnCacheState`.
- `src/shared/agent-hook-listener/listener-state.ts:293-300` — clears `lastPromptByPaneKey` / `lastToolByPaneKey`.
- `src/shared/agent-hook-listener.ts:151-160` — only `pi`/`prime-agent` `session_start` (with a non-null `providerSession`) mints the hidden `providerSessionOnly` row.

## Required outcome
The queued completion must survive (the fix). Decide whether the new session's first `done` row showing the previous session's prompt/tool is acceptable; it clears on the next `before_agent_start`.

## Suggested approach (optional)
If the stale prompt matters, have the host treat a normalized row whose `session_id` differs from the pane's previous row as a boundary and clear the turn cache / mint the placeholder — the extension cannot clear host caches itself.

## Open questions for the human
Is a `done` row inheriting the prior session's prompt/tool until the next turn acceptable, or should the boundary signal be re-emitted after the completion drains?

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 self-requested a review September 28, 2026 18:03
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Refactors how Pi and OMP display background child agents.

The PR is not ready to merge while a reload can leave a Pi pane permanently marked working after its last child exits.

Findings

  1. P1 Reload cancels child settlement ▶
  2. P1 Completion gets wrong session ▶

Summary

The PR adds live Pi and OMP background-child rows to agent status updates and reworks session boundaries, roster retention, and delivery ordering. The same-session reload path still cancels a pending runner-exit settlement check, which can leave a pane working after its last child exits.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Child runner exits] --> B[Grace check scheduled]
  B --> C[Pi reload shuts down registration]
  C --> D[Grace check canceled; roster retained]
  D --> E[No later event]
  E --> F[Pane remains working]
Loading

Reviews (2) · Last reviewed commit: "fix(pi): end a run with its session and ..."

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review (911a0db324 → 4ca3e28179, 3 files, +96/−3):

  • Roster cap derived from the host constant — the generated extension's MAX_SUBAGENT_SNAPSHOT is now interpolated from the imported AGENT_STATUS_MAX_SUBAGENTS instead of a re-typed 32, so the extension cap and the host's normalization truncation cannot drift. The emitted value is unchanged (32), so there is no runtime behavior change.
  • Cap pinned in the generated-extension suite — a new test starts AGENT_STATUS_MAX_SUBAGENTS + 4 children and asserts the posted roster is capped at the host limit with the oldest ids retained.
  • model_select placeholder guard pinned — the normalization suite now also asserts a model_select cannot unhide a providerSessionOnly resume row, covering the guard that subagents_update shares.
  • Pi cancel beside a live child row pinned — a new server-level suite asserts Ctrl+C still settles a stopped row when the pane has no children, but leaves the working row and its child rows untouched (recording no cancellation) while a child runs, matching the trade documented in the PR body.

All 48 tests in the two changed suites pass, and pnpm tc:node is clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@AmoabaKelvin
AmoabaKelvin force-pushed the pi-family-panes-show-child-rows branch from 4ca3e28 to a8e499d Compare October 1, 2026 18:43
@AmoabaKelvin

Copy link
Copy Markdown
Collaborator Author

@coderabbitai on the two outside-diff comments, as of a8e499de7e:

  • Ignore roster updates after the row is done: the done-with-live-children state came from a dialog closing while children still held the run. ui_prompt_end now asks the same "do children hold this pane" check the turn end uses, so a done row no longer has live children under it. Not taking the suggested guard: it would freeze stale rows on a done row.
  • Reject subagents_update from another OMP session: not adding the check. The extension sends one update at a time and waits for the reply, and the hook server applies an update before replying, so an older session's update cannot land after a newer one. The suggested check would also drop every update for an OMP session with no session file, since those carry no session_id.

@pullfrog on the coalesced session_start note: resolved in a8e499de7e. The relabel is gone, so the host gets the old session's completion and then session_start, and clears its turn cache as before.

@pullfrog

pullfrog Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Verified all three points against a8e499de7e. Each holds, so no changes are needed.

  • Roster update on a done row — correct. postAgentEndOnce() returns without posting whenever isHeldByChildren() (agent-status-handler-source.ts:233-238), and ui_prompt_end now forces is_idle false while children hold (agent-status-ui-prompt-source.ts:33), which the host maps to working (pi-family-events.ts:93). So a done row can no longer carry live children; a subagents_update landing on one would only clear an already-empty roster, and the suggested guard would suppress exactly that. Agree it is unnecessary.
  • Cross-session subagents_update — correct, the race cannot occur from a single extension. Only one post is in flight at a time (activePost gate in agent-status-post-queue-source.ts:33-39) and the sender awaits each response; the server applies the payload before replying (applyNormalizedStatus at server-lifecycle.ts:140 precedes res.end() at 147). The suggested check would also drop every update from a fileless OMP session, since OMP metadata only carries session_id when both the id and session file exist (agent-status-extension-source.ts:48,78). Agree it should not be added.
  • Coalesced session_start — resolved as described. The keepsCompletion relabel is gone; session_shutdown now ends the old run through closeOutRun() → postAgentEndOnce(true), which uses its own finalPosts slot and is delivered before the new session's session_start, so the host still clears its turn cache and mints the resume placeholder.

No code changed; nothing to push. git status is clean.

Pullfrog  | View workflow run | via Pullfrog | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5c8e0902-28c4-4bad-b84c-690fb4aadc09

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca3e281793ed427a1dacd7f5eb5742ed4abd5df and a8e499de7ee0b025af4ed55bb22f882521fdfaf3.

📒 Files selected for processing (13)
  • src/main/agent-hooks/server-pi-normalization.test.ts
  • 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-session-change.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-post-queue-source.ts
  • src/main/pi/agent-status-session-boundary-source.ts
  • src/main/pi/agent-status-subagent-event-fixtures.ts
  • src/main/pi/agent-status-subagent-roster-source.ts
  • src/main/pi/agent-status-ui-prompt-source.ts
  • src/shared/agent-hook-listener/providers/pi-family-events.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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review (4ca3e28179 → a8e499de7e; the branch was rebased into a 4-commit history, so the scope was isolated by comparing the two trees for the PR's files — 13 files, net +1233/−337 over those paths):

  • Run state moved where it survives a registration — children, the hold, the turn counters, and the parked map now live on globalThis for Pi (which re-evaluates the module on /reload) and on pi.events for OMP, with ownsPaneRoster keeping an in-process task child off the lead's roster.
  • New session-boundary module — Pi session_shutdown and OMP session_switch/session_branch now park and restore a resumed session's children, end a run whose session was replaced, and separate /reload, same-file resume, and quit from a true boundary. An ended run is recorded as agent_end { session_boundary: true }.
  • New finalPosts delivery queue — a closing session's last word sits outside the latest-only slot, always drains before newer posts, and retries on its own timer, so it cannot be overwritten by the next session.
  • Turn counters unified into the shared roster — runGeneration/endedRunGeneration/completionPostedGeneration moved onto the roster and postAgentEndOnce() now returns whether it settled the pane, giving isHeldByChildren()/isTurnInFlight() one home across registrations.
  • Host normalization — a Pi-family agent_end carrying session_boundary is stamped sessionBoundary, so a run ended by its session is recorded without an "agent finished" notification.
  • Tests — a new session-change suite with a reload/session-switch harness, plus fixtures extracted into a shared module; 96 tests across the four changed suites pass and pnpm tc:node is clean.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
git rev-parse --short HEAD
ast-grep outline src/main/pi/agent-status-ui-prompt-source.ts
ast-grep outline src/main/pi/agent-status-post-queue-source.ts
ast-grep outline src/main/pi/agent-status-extension-source.ts
ast-grep outline src/shared/agent-hook-listener/providers/pi-family-events.ts
fd -i '^server.*\.ts$' src/main/agent-hooks
rg -n -C3 'ui_prompt_end|isHeldByChildren|await|drainPosts|session_id' src/main/pi/agent-status-ui-prompt-source.ts src/main/pi/agent-status-post-queue-source.ts

Length of output: 10392


🏁 Script executed:

#!/bin/bash
sed -n '1,100p' src/main/pi/agent-status-post-queue-source.ts
rg -n -C6 'session_id|function postOnce|function post\(|response|res\.|fetch\(' src/main/pi/agent-status-extension-source.ts
sed -n '1,125p' src/shared/agent-hook-listener/providers/pi-family-events.ts
ast-grep outline src/main/agent-hooks/server/server-lifecycle.ts
rg -n -C6 'res\.end|response\.end|ingest|handleHook|writeHead' src/main/agent-hooks/server/server-lifecycle.ts
rg -n -C4 'isHeldByChildren|ui_prompt_end' src/main/pi/agent-status-handler-source.ts

Length of output: 19557


@AmoabaKelvin, thanks for the clarification. I withdraw both outside-diff findings.

  • Done-row guard: ui_prompt_end now checks isHeldByChildren(), as turn-end handling does. Rejecting roster updates on done rows would prevent stale child rows from being cleared.
  • OMP session guard: The extension serializes posts and waits for each reply. The server handles the update before replying. The proposed guard is unnecessary for that delivery path and would reject valid updates from OMP sessions without a session file.

The session_start relabel is also gone at a8e499de7e, consistent with the completion-then-session_start order you described.


✏️ Learnings added
Learnt from: AmoabaKelvin
URL: https://github.com/stablyai/orca/pull/23201

Timestamp: 2026-10-01T18:58:28.774Z
Learning: In Orca's generated Pi status extension, src/main/pi/agent-status-ui-prompt-source.ts checks isHeldByChildren() before reporting ui_prompt_end as idle. Turn-end handling in src/main/pi/agent-status-handler-source.ts uses the same child-held check. Do not recommend rejecting subagents_update solely because the existing row is done; roster updates must still be able to clear stale child rows.

Learnt from: AmoabaKelvin
URL: https://github.com/stablyai/orca/pull/23201

Timestamp: 2026-10-01T18:58:28.774Z
Learning: In Orca's Pi-family hook delivery path, src/main/pi/agent-status-post-queue-source.ts serializes posts and waits for the response before sending the next post. The hook server handles updates before replying. OMP session metadata in src/main/pi/agent-status-extension-source.ts omits session_id when no session file exists. Do not require session_id matching for subagents_update without accounting for these valid session-file-less OMP sessions and the serialized delivery contract.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@nwparker nwparker 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.

Found and fixed fast Pi child consuming pending lead completion and OMP child bus publishing without pane ownership. Retained all settlement regressions plus session/reload boundaries; 356 tests pass, node typecheck and quality gate pass. Also repaired native-lint context type caught by fresh CI. Overlaps #23662: merge it first, then reconcile this branch while retaining generated-roster invariants and settlement tests.

Required PR Checks verify passed on this exact commit: a0174a36bb40a4358b1003b98bc52d258ac1ef8a.

@nwparker
nwparker force-pushed the pi-family-panes-show-child-rows branch from a0174a3 to 63c6f32 Compare October 6, 2026 00:18
AmoabaKelvin and others added 8 commits October 5, 2026 17:21
The generated extension re-typed the 32-row limit as its own literal, so
a change to AGENT_STATUS_MAX_SUBAGENTS would leave the extension posting
rosters the host silently truncates on arrival. Interpolate the host
constant instead, and cover the cap with a test that posts past it.
Publishing a subagent roster for Pi puts its panes behind the same
child-work guard Claude and Codex sit behind, so Ctrl+C beside a live
child no longer settles a stopped row. The extension reports no
main-agent state, so Orca cannot tell a cancelled turn from Ctrl+C at
the idle prompt of a lead children alone hold open, and keeps the live
row. Both halves of that are now pinned, as is the resume-placeholder
guard on the model_select arm of the same code path.
Pi re-runs the extension on a fresh event bus for /new, resume, fork and
/reload, so the roster kept on that bus was lost and nothing ended the
run the old session's children held open.
@nwparker
nwparker force-pushed the pi-family-panes-show-child-rows branch from 63c6f32 to 8ca1e75 Compare October 6, 2026 00:23

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review. The branch is a rebased stack on main, so the scope was isolated by comparing the two trees for the PR paths; the material changes are 1c395cb (fix) and 8ca1e75 (test), with two later test-only integration commits on top.

  • Retained an undelivered completion across a session boundary — resetPostQueue now scans activePost/pendingPost/latestPost and moves any undelivered agent_end into finalPosts as the same object (rather than only a queued pendingPost, and rather than a copy), so an in-flight acknowledgment retires its own queue entry and the completion is retried instead of dropped.
  • Kept the runner-exit grace timer across a same-session restart — runnerExitCheck moved from a registration-local variable onto the shared roster, so a /reload (module re-evaluation) or same-file resume retains a timer armed for an exited runner; its settle callback is rebound per registration. A true session end (/new, fork, quit, OMP new/branch) still clears it.
  • Added tests — completion delivery is pinned across an OMP session boundary for scheduled-retry, in-flight-failure, and in-flight-success cases (asserting the old session's completions drain before the new session's agent_start), and the runner-exit grace is pinned to clear on /new/quit. The four Pi status suites (106 tests) and pnpm tc:node pass.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review (8ca1e75 → c61143d):

  • Serialized status delivery across a Pi /reload — the hook-post queue now lives in a HookPostQueue object on globalThis.__orcaPiStatusPostQueue for Pi (OMP/Prime keep a per-registration queue), so a delivery continuation started by the pre-reload registration and the reloaded one share one queue. A preserved final completion is delivered exactly once and ahead of the next turn.
  • Retired a same-session completion when the next turn starts — post() drops same-session, non-boundary agent_end entries from the final queue on before_agent_start/agent_start, so a completion preserved by /reload cannot be retried over the next turn's row; session_boundary completions and other sessions' completions are left intact, and an in-flight one still drains before the new turn.
  • Added reload-delivery tests — pins that an old completion is not retried over the next turn, that the next turn serializes behind an in-flight completion (success and failure), and that a failed completion still recovers on reload without another turn.
  • Dependency/checkout bookkeeping — pins @streamparser/json as a devDependency and bumps the cross-version checkout format so released sources that import it still extract.

All five Pi status suites (110 tests) pass, and pnpm tc:node is clean.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker

nwparker commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

Please review final head 2987942. Named main a47e0f5 was integrated; the sole conflict retained upstream’s stronger Windows prompt test contract. Reviewed Pi/OMP production sources are unchanged. Fresh 426 tests across 25 suites, node typecheck, changed-code gates and the real native OMP HTTP503 smoke test pass. Existing resolved findings retain their regression coverage.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nwparker nwparker 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.

Low merge risk after the final repairs. Status delivery now survives reload without allowing an old same-session completion to overwrite the next turn. True session-boundary completions retain their original metadata and ordering. 426 focused integration tests and the native HTTP retry smoke test pass, along with typecheck and quality gates. The full PR Checks workflow and all runnable CI on this exact head have passed, and review findings are addressed. Pullfrog was manually disabled repository-wide and its integration-review run cancelled; the stale pending bot check is documented. The feature code is unchanged from its completed bot-reviewed state, and this integration was reviewed manually.

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.

Pi-family panes: show child rows (subagents, watchers) through the hook lane

2 participants