Skip to content

feat(native-chat): the chat strip and the sidebar read the host's child records - #22614

Merged
brennanb2025 merged 41 commits into
mainfrom
brennanb2025/c5-read-child-records
Oct 1, 2026
Merged

brennanb2025 merged 41 commits into
mainfrom
brennanb2025/c5-read-child-records

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 51 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3346 $\color{#cf222e}{\Huge{\mathbf{−}}}$​529 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2817
Prod 91 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1540 $\color{#cf222e}{\Huge{\mathbf{−}}}$​442 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1098

The problem

In a chat (structured) session, a subagent or background command shows up in two places: as an indented row under the session in the worktree sidebar, and as a row in the chat's background-task strip above the composer. The two did not agree about what was running.

Scope. Chat sessions with Claude or Codex, on every host the app talks to (local, WSL, SSH, remote). Terminal (CLI) agents are not affected: their finished subagents already leave the sidebar the moment they stop. This PR changes what the strip and the sidebar list for chat sessions (running children only, on both), what blocks /clear, /compact and rewind, what a background Stop reaches, when the idle sweep may stop a chat's provider, and what the resume offer after a quit lists.

What this changes for you

Before (main) After (this PR)
A subagent or background command finishes The strip kept it only while another child still ran, then dropped every finished row at once; the sidebar dropped it at once It leaves the strip and the sidebar at once, on both. How it ended is in the chat's transcript ("Ran N subagents · completed")
Nothing is running The strip hid once its last live task ended The strip hides, the same moment the sidebar has no child rows
This app paired with a host that predates this PR The strip showed that host's finished rows beside running ones The strip shows that host's running tasks only, and hides when none are left
Which rows the strip and the sidebar show Strip: running tasks, plus finished ones beside a running one. Sidebar: running subagents, with facts lost in conversion (monitoring read as working, no current tool) The same rows on both, from one rule: every running child, in the order they started, with its current tool. A finished child whose own shell still runs counts as running and reads "Monitoring background tasks"
Stop on a background task Reached the tasks in the provider adapter's own list Reaches exactly the rows the strip offers a Stop, and the row leaves once the task ends
/clear, /compact, rewind while background work runs Refused while the adapter's list held tasks Refused only while the strip shows live work, with "Stop background tasks" only when the strip shows a Stop, else "Wait for background tasks to finish"
The app stops an idle chat's provider to save resources Skipped while the adapter's list held tasks Skipped while the records show a live child
"Resume chats that were working" after a quit Listed tasks from the adapter's list Lists the live children from the records
Orca loses contact with the host Sidebar and strip described the child differently Both stop vouching for the child and say "No update in Nm". The sidebar's minute can read one higher than the strip's, because the session list is only republished when a child's clock moves by a minute and the sidebar redraws every 30 s
Terminal (CLI) agents No change
An older app version paired with this host Read the adapter's list Reads a flat task list derived from the records, running work only; the strip hides when none runs. For Codex it again hides a running child agent's shells and names a finished agent's still-running shell "reviewer — npm test". New: that finished Codex agent also shows as a "done" row beside its shell

ELI5

A chat's helpers (subagents and background commands) used to be tracked in three notebooks that did not agree, and the one the chat used threw finished helpers away as soon as nothing else was running. Now the host keeps one notebook with one page per helper: what it is doing, how it ended, and when. The sidebar and the chat both read that notebook, and both list only the helpers still running. A finished helper leaves both at once (its result is in the conversation), and the chat's list hides when nothing runs. The Stop button, and the check that stops you clearing a chat while work is still running, read the same notebook, so they can never disagree with what you see.

What Changed

This PR is the switch step of the child-work records plan. #22521 added the record, #22536 and #22553 made Claude and Codex write their children into the host's store, and #22565 built one row model for both surfaces; all four are merged. This PR makes both surfaces read the records and removes the old task feed. #22634 (a Claude subagent waiting on a permission prompt reads as waiting) is stacked on this PR, and #22619 (Codex default-mode helpers as subagents) merges independently in either order.

Delivery: the host publishes its child records (new optional fields only)

  • Session list summary (agentSession.subscribeStatus, read by every session list, including remote ones): gains children?, the session's running children read from the host's canonical store (live records, plus a finished one whose own shell still runs, which reads as monitoring). It is read through the status sink the session's row landed in (readChildWork → AgentHookServer.getStructuredChildWorkViews), wired at both host entry points, the desktop main process and orcad.
  • Chat strip channel (agentSession.subscribe / history, backgroundTasks): gains children?, the same running children as the session list. When none runs it sends no roster (null), and the strip hides. The channel reads the records and republishes when a child changed; an unchanged roster sends nothing.
  • Parent row: the session row's working state now folds child liveness from the store's records, not from the summary's task list. After every child change the host re-reads the records and republishes, which re-folds the row.
  • One listing rule for both surfaces (src/shared/agent-child-work-listing.ts, agentChildWorkIsRunning / structuredRunningChildWork): a child is listed while it runs, where a finished child whose own work still runs counts (it reads monitoring). The session list, the strip channel and the sidebar's row builder all use it, in store (start) order, with no row cap. "A finished child still owns live work" is one function at any depth of ownership, shared with the record retention below.

Finished records: kept in the host's store until the user's next message (not shown)

  • No surface lists a finished child any more, but its record stays in the host's in-memory store until the provider accepts the user's next send (a message, a steer, /compact, or a queued draft once handed over), keyed on the newest accepted submission in the journal plus the journal epoch. A rewind clears them; a turn the provider starts on its own (Claude waking the agent when a background task ends) and a subagent's turn do not.
  • Why it is kept rather than dropped at once: while the record exists, a late frame from that run cannot bring the child back as live (admission refuses a live update of a settled run); an acknowledged Stop's provisional ending can still be replaced by the task's own ending; and a finished child that owns live work keeps its row as that work's owner. The next accepted send bounds how many finished records a session holds.
  • The other way a record dies is the host letting go of the session: close, release, or any other drop of its row takes every child record with it. No timer.

Stop, admission, idle sweep, quit snapshot: one reader

  • Stop. The host resolves the provider ids a background Stop sends from the records: the row's own id for a per-row Stop, or every row the strip offers a Stop for "stop all". This is the same rule that draws the Stop button (src/shared/agent-child-work-stop-targets.ts). The adapter stops exactly those ids. It no longer checks its own task list, which had made a Stop do nothing once that list dropped a task the records still showed.
  • When a Stop is acknowledged. The Claude CLI answers a stop request with success in two cases. For a running task it first sends the task's own "stopped" frame. For a task it no longer knows, or one that already ended, it sends no frame at all (read from the CLI's own stop handler). So an acknowledged stop settles a task that is still live as cancelled, provisionally.
  • The task's own ending wins. The SDK hands Orca a control answer as soon as it reads it, ahead of frames the CLI wrote before it. If the task's own completed or failed frame arrives after the acknowledgement, it replaces the provisional ending, so the record keeps the task's own result and summary. Nothing replaces an ending the task reported itself. A refused stop leaves the record live.
  • Stop all keeps stopping the remaining tasks when one request fails, then reports the failure. If a request times out (the CLI is not answering), it stops asking at once, so the chat waits one deadline, not one per task.
  • Admission. /clear, /compact and rewind are refused on the records, with the same liveness rule as the strip's monitoring indicator; a finished child blocks nothing. They ask for a stop only when the strip shows one. This covers all four places that decide it: the command RPC, rewind, and main's newer queued /compact path, both where the command is accepted and where it is handed to the provider.
  • Idle sweep and quit snapshot. They read the records, so a chat with a live child keeps its provider, and the resume offer lists the live children.
  • Adapter contract. backgroundTaskState and onBackgroundTasksChanged are gone, and host.publishBackgroundTaskState with them. No production code reads the provider tracker's task list any more. The Claude tracker is still fed, only for tests that compare it with the records; deleting it is a follow-up. New adapter method backgroundTaskStops(sessionId) supplies which stops the provider supports (Claude: targeted; Codex: none).

Renderer

  • The status bridge copies summary.children onto the session's status row. The renderer's own conversion of the old task list remains only for an older host that publishes no children.
  • The chat reducer decodes children once, where the frame arrives. A row shaped by a newer host is dropped instead of throwing, and an unchanged roster keeps its identity, so the strip does not regroup its rows on every streamed frame.
  • The strip view shows running work only from any host: an older host's finished rows (settledTasks) are dropped, and a roster of only finished rows shows no strip.
  • The strip's rows read the parent's verdict from the same status row the sidebar reads (childRowContext), so a lost or stale parent reads the same on both surfaces.

Wire and older readers

  • decodeAgentChildWorkViews is the permissive client reader. Unknown keys are ignored. An unknown kind, state, outcome or basis degrades to a safe value. A Stop is offered only when stoppable is exactly true. Only a row with no id, clocks or fence is dropped. The strict record codec stays on the host.
  • New capability agent-session.background-task-child-views.v1, advertised by the desktop, remote and web clients. A reader that does not advertise it never receives children. Every roster the host sends lists running work, so an older reader's reading of any roster as live work holds.
  • Older readers get the flat tasks / settledTasks / backgroundTasks / subagents shapes, derived from the same records, so they cannot disagree with them. A Codex agent keeps its old codex-agent:<thread> id. A running Codex agent's shells are hidden behind its row, and once it finishes they read " — ", as before. New for them: a finished Codex agent whose shell still runs appears as a "done" row in settledTasks beside it. settledTasks now only ever holds such owners of running work.
  • When the old shapes are deleted, as written in the header of structured-agent-session-child-work-legacy.ts: once the minimum compatible client protocol goes above the version in force when this capability shipped (3), every accepted client reads children. At that point the derivation, the id remap and the gate's old-reader branch go together.

Session-list churn (measured at an earlier head of this PR, c01de9752d; the equality rule has not changed since)

The session-list summary goes to every session list, remote ones included. So it compares children with token usage removed, and it tolerates a child's evidence clock moving by less than 60 s, which is the precision of the "No update in Nm" reading. The strip channel still carries every tick. Measured with a throwaway harness (the real Claude adapter over agentSession.*, the real hook server as the sink), with 5 background children and 20 rounds of task_progress each (100 frames):

phase summary broadcasts, base (3422ccaf4c) summary broadcasts, this PR strip frames, both
spawn 5 children 10 10 5
100 progress ticks, tool name unchanged 0 5 100
100 progress ticks, tool name changes every 5 ticks per child 0 24 100
100 progress ticks, tool name changes on most ticks 0 53 100
5 completions 5 5 5

A tick that changes only usage, or a clock inside 60 s, republishes nothing; the 5 heartbeat-only republishes are one per child when its clock crossed 60 s. What does republish is a child's current tool changing, which is the fact the sidebar row now shows.

Why

One record per child, read by every surface, removes the class of bug where two copies of a child follow different rules. Each earlier copy dropped facts: monitoring collapsed to working, failed became blocked, and the running tool was discarded. One listing rule for the sidebar and the strip means the two can no longer list different children. This PR does the switch and the removal of the old writer at once, so there is never a window where the two surfaces read different sources.

Alternatives considered:

  • Lift the main-window filters and let the hook server's row reach the renderer directly, deleting the bridge. Not done here: a remote runtime's rows do not reach the local hook server, so the bridge (which subscribes to whichever host owns the worktree) is still the only renderer path for remote sessions. The host authors the child content; the bridge copies it.
  • A separate sibling field on the subscribe frames instead of children inside the roster. Rejected: more frame surface for the same effect, and the RPC-boundary projection already hands older readers their old roster.
  • Republish the session-list summary on every tick. Rejected: per-tick freshness belongs to the channel that only an open chat subscribes to (measured above).
  • Keep finished children in the strip until the user's next message. Built in an earlier revision of this PR and reversed by product decision: the strip is for work that is running, and a finished subagent's result is already in the transcript ("Ran N subagents · completed"). Listing it twice made the strip read as busy when nothing ran.
  • Drop a finished child's record as soon as it settles. Rejected: the record is what refuses a late frame of that run, lets a task's own ending replace an acknowledged Stop's, and keeps a running shell's owner. Its lifetime is bounded by the user's next accepted message instead, with no timer.
  • Order the ack and the task's frames with a yield after the stop request. Rejected: it depends on the SDK's internal queue. A provisional ending that the task's own frame replaces is deterministic.
  • Keep the Stop on the provider's own task list. Rejected: the strip, admission and idle sweep read the records, and the records keep a background task the provider's list has dropped until the task's own ending. A Stop on the other list could do nothing while the strip showed a Stop and admission asked for one.

Linked Issue

None. Part of the structured chat status and orchestration program.

Visual Proof

Earlier strip rule. These fixture screenshots and the earlier live run below were captured before the strip changed to list running children only, so they show finished rows in the strip. They stay for the sidebar rows, the monitoring row and lost-contact wording, which are unchanged. Captured with the $electron skill: a dev instance of this branch at an earlier head (c01de9752d), launched with ORCA_BACKGROUND_LAUNCH=1 on a throwaway profile, driven by Playwright over CDP, with CDP screenshots of the hidden window. No window was shown and no OS input was used. This is a renderer-seeded fixture, not a live provider session. The session's status row was written through the real setAgentStatus path with the payload the bridge writes, and the real NativeChatStructuredSessionStatus was mounted over a roster built by the real strip view. Children: one working with Bash: npm test -- parser; one finished while its npm run dev shell runs; one finished; one failed.

Fixture screenshots (sidebar card and strip, before and after losing contact with the host):

  • 02-live-sidebar-card.png, 03-live-strip.png: sidebar and strip agree row for row:
    • Summarize the grammar - Grammar has 42 productions (finished, green);
    • Monitoring background tasks - Start the dev server (yellow monitoring icon; the strip nests npm run dev under it);
    • Fuzz the tokenizer - Exit code 1: fuzz target crashed (failed);
    • Run the parser tests - Bash: npm test -- parser (working);
    • strip header "4 agents — 1 working, 1 monitoring, 1 blocked, 1 done".
  • 05/06-lost-transport-*.png: the same session after the status feed reports the host unverifiable. Both surfaces show Start the dev server - No update in 3m and Run the parser tests - No update in 0m, with settled outcomes unchanged. In this fixture both surfaces read the same clock; in a live session the sidebar's minute can read one higher.
Sidebar card Chat strip
Live 02-live-sidebar-card 03-live-strip
Lost transport 05-lost-transport-sidebar-card 06-lost-transport-strip

Live run with real providers (earlier head c01de9752d)

A design-check pass ran an earlier head against real provider CLIs: $electron with Playwright over CDP, a hidden dev instance (ORCA_BACKGROUND_LAUNCH=1, throwaway profile, no OS input), three sessions. It predates the retention, Stop and decoding fixes above; the live QA for this head is below.

  • Claude (Opus), one Task subagent. While it ran, the strip read 1 agent — working with the child's own current tool: Run sleep and echo · Bash: sleep 40; echo CHILD_DONE. The subagent moved its sleep to the background, and that shell appeared as a command owned by the agent. When the subagent returned, the agent settled succeeded and its killed background shell settled cancelled (shown with the interrupted dot, by design). The sidebar showed an indented Run sleep and echo - general-purpose child row with the same name and state. Both stayed listed with their outcomes after the turn ended, and on the next user message both surfaces cleared.
  • Codex multi-agent v2 (GPT-5.6-Terra). sleep_child read working · Agent, with its shell nested under it on its own clock, then settled as 1 agent — done / sleep_child · CHILD_REPLY … ended 0s ago. The sidebar showed the same child row.
  • Codex default mode (GPT-5.5). No agent row on either surface; feat(native-chat): register Codex default-mode helpers as subagents #22619 adds it. The helper's shell appeared as an unowned command row, 1 shell command — 18s, then — done, retained.
Arm While running After
Claude, strip claude1-03 claude1-05
Claude, sidebar, then next turn claude1-sidebar-expanded claude1-next-turn-01
Codex v2 c5-v2try1-08 c5-v2try1-18
Codex default mode c5-deftry1-05 c5-deftry1-11

Live QA (strip rule at b9e1ef8eb09)

Run with $electron on a separate Mac (not the development machine): a hidden dev build of b9e1ef8eb09 (ORCA_BACKGROUND_LAUNCH=1, throwaway profile and home, status hooks off, Playwright over CDP, no OS input), a structured Claude chat on Claude Code 2.1.286. A 250 ms in-page sampler timed every change of the strip and the sidebar. The commits after b9e1ef8eb09 add a test, apply the same rule to an older host's roster, and merge main; they do not touch these flows.

  • Running subagent: PASS. The strip reads "1 agent — working"; the sidebar shows an indented child row.
  • Finished subagent: PASS. The strip and the sidebar child row left in the same 250 ms sample, about 1 s after the child's command ended; the transcript reads "Ran 1 subagent completed · 48s". Nothing came back in the next 25 s.
  • Background shell after the turn: PASS. While it runs the strip shows "1 shell command" with Stop. It left 130 ms after the CLI reported the task finished, before Claude's own wake reply, and never came back.
  • Next message: PASS. Nothing lingers anywhere.
  • Stop on a long background shell: PASS. The strip left under 1 s after the click, the process was gone, the transcript reads "stopped · 21s", no "The provider had already finished this turn." note appeared, and /compact was then accepted.
  • Two subagents in parallel: PASS. "2 agents — 2 working", then "1 agent — working", then no strip; the sidebar matched every step.
  • Renderer console: 0 errors.
  • Not covered live: terminal (CLI) Claude (status hooks off in the rig; a probe shows its sidebar rows identical to main), the monitoring state (this Claude version kills a finished subagent's shell), Codex chat, paired/remote clients and mixed versions.
  • As on main: while the parent's own background shell runs, the session row reads "Monitoring background tasks"; the sidebar lists child agents only.
Scenario Screenshot
1. Subagent running: strip "1 agent — working" plus an indented sidebar child row Subagent running: the strip above the composer shows 1 agent working with its Bash tool and a nested shell; the sidebar shows the session row with an indented child row
2. Subagent finished: the strip is gone, and the transcript reads "Ran 1 subagent · completed" Subagent finished: no strip above the composer; the transcript shows Ran 1 subagent completed 48s and the PARENT ONE reply; the sidebar shows only the session row
3. Background shell running after the turn, with Stop Background shell running: the strip shows 1 shell command with a Stop button and no finished subagent row; the sidebar session row reads Monitoring
3. After the shell finished and Claude woke on its own: strip gone After the wake turn: no strip; the transcript shows the shell done 30s and Claude's own reply that the background command finished successfully
4. Next message: nothing lingers After the next message NEXT: no strip, and the sidebar shows only the session row
5. Long background shell before Stop Before Stop: the strip shows 1 shell command, Sleep for 300 seconds, with a Stop button
5. After Stop: strip gone, no provider-finished note After Stop: no strip; the transcript card reads Sleep for 300 seconds stopped 21s; no provider-finished note
5. /compact accepted after Stop After /compact: the transcript shows Worked for 12s and Context compacted, with no refusal and no strip
6. Two subagents running Two subagents running: the strip shows 2 agents, 2 working, with rows A and B; the sidebar shows two indented child rows
6. One finished, one still running One subagent left: the strip shows 1 agent working with only B; the transcript shows A completed and B working; the sidebar shows one child row
6. Both finished: strip gone, transcript "Ran 2 subagents · completed" Both subagents finished: no strip; the transcript shows Ran 2 subagents completed 43s and the PARENT TWO reply; the sidebar shows only the session row
Earlier live run at bacc1babb3a, under the earlier strip rule (finished rows kept until the next message); superseded

Earlier run (bacc1babb3a, earlier strip rule). Run with $electron on a separate Mac (not the development machine): a hidden dev build of bacc1babb3a (ORCA_BACKGROUND_LAUNCH=1, throwaway profile and home, status hooks off, Playwright over CDP, no OS input), a structured Claude chat on Claude Code 2.1.285. The last commits after bacc1babb3a (a stop-all timeout, a file rename, "no children" sent once, two test fixes) do not touch these flows.

  • Running subagent: PASS. The strip reads "1 agent — working" with the child's current tool and its nested shell; the sidebar shows an indented child row.
  • Finished subagent: PASS. The strip keeps "1 agent — done" with the subagent's summary; the sidebar child row is gone.
  • Background shell and background subagent finishing after the turn, Claude waking on its own: PASS. The finished row stays through Claude's wake turn. For the subagent, 20 reads every 3–4 s from about 1 s after the wake all showed "1 agent — done".
  • Next message retires finished rows: PASS.
  • Stop on a long background shell: PASS. The row settles "stopped" with the red dot, the process is gone, no "The provider had already finished this turn." note appears, and /compact is then accepted.
  • Monitoring (a finished subagent whose own shell still runs): not reachable live. Claude Code 2.1.285 kills a subagent's background shell when the subagent ends; the strip shows that shell as interrupted, which is what happened. Covered by tests.
  • Terminal (CLI) Claude agent: not run live (the isolated rig keeps status hooks off). A probe running main's sidebar row builders beside this PR's gives identical rows for working, waiting, idle teammate, stale parent, mixed and stopped children.
  • Noted, not changed here: the sidebar lists child agents only, as on main; a parent's own background shell shows as "Monitoring background tasks" on the session row, not as a child row. A nested shell row can repeat its title as its summary (cosmetic).
Scenario Screenshot
1. Subagent running: strip "1 agent — working" plus indented sidebar child row Subagent running: strip shows 1 agent working with its Bash tool and nested shell; sidebar shows the session row with an indented child row
2. Subagent finished: strip keeps it with its summary; sidebar child gone Subagent finished: strip shows 1 agent done with the subagent's summary and green checks; sidebar shows only the session row
3. Background shell running after the turn ended (Stop offered) Background shell running: strip shows 1 shell command with a Stop button; sidebar session row reads Monitoring
3. After Claude's own wake turn: finished shell row stays After the wake turn: strip still shows 1 shell command done, completed exit code 0; Claude's wake reply is visible above
3b. Background subagent running, with its sidebar child row Background subagent running: strip shows 1 agent working with Stop; sidebar shows an indented child row Run sleep and echo in background
3b. After the wake turn: finished subagent rows stay After the background subagent's wake turn: strip shows 1 agent done with its summary and nested shell; sidebar shows only the session row
4. The next user message retires finished rows After the next message NEXT: the strip is gone and the sidebar shows only the session row
5. Long background shell before Stop Before Stop: strip shows Sleep for 5 minutes running with a Stop button
5. After Stop: row settles as stopped, no provider-finished note After Stop: strip shows 1 shell command stopped with a red dot and no Stop button; transcript card reads stopped 14s; no provider-finished note
5. /compact accepted after Stop After /compact: transcript shows Worked for 12s and Context compacted; the strip is gone
6. Subagent done; the CLI interrupted its background shell Subagent done with its background shell interrupted: strip shows 1 agent done, the subagent row started, and the nested shell with a red dot at 0s

Testing

All run on macOS with env -u ORCA_STRUCTURED_SESSION, explicit test files, and an isolated HOME.

  • Typecheck: tc:node and tc:web pass at 4430535e2dc (and tc:cli at b9e1ef8eb09; nothing CLI-facing changed since), merged with main 95e8725b40d (which brought in feat(native-chat): register Codex default-mode helpers as subagents #22619).
  • Targeted run at b9e1ef8eb09: 541 files and 6,792 tests; 6,759 passed, 29 skipped, 4 failed under machine load (load average 25–49). All 4 pass when rerun alone: two 30 s timeouts in the browser-process startup tests, the 90 s refusal-retry oracle, one chat-coordinator mail test, and the cross-version agent-session suite, which timed out extracting an old build and passed alone 17/17. The run covered every test file this PR adds or changes, every test file main changed in the merged areas, and every test that builds the status feed, the strip channel, the strip view or the host with fakes (grep-selected, including the tests/e2e unit tests that touch them), which is what CI caught on an earlier head.
  • CI at 9313ec25548 (final head; merges main 3ab3c9239fb): green, all 38 checks. The merge resolved 3 conflicts by keeping this PR's removal of the provider task-list read and taking main's additions. Two files stayed under the line limit by moving a type and the child-views capability constant into their own modules. tc:node, tc:web and tc:cli: 0; 367 files, 4,034 passed, 0 failed.
  • CI at b9e1ef8eb09 (the strip change): green (PR Checks, Mobile Checks, Computer-use e2e, Bun profile persistence all completed success). The follow-up 4430535e2dc changes the strip view and tests only: 32 renderer/shared/host test files touching the roster, 407 tests, all pass.
  • Lint: full oxlint, the anti-slop lint and check:code-quality:changed report 0 new findings. No new docs. pnpm-lock.yaml is identical to main.

New tests:

  • src/main/runtime/structured-child-records-switch.test.ts: end to end on a host with no renderer, using the production runtime, a Codex session, and a real AgentHookServer as the status sink. At each step the summary and the strip carry the same running children, with literal expectations (never compared with the tracker's list); once the child finishes the strip gets no roster and the summary no children, while the record stays in the store. The parent row reads working, then working/monitoring, then done. A turn Codex opens with no send keeps the finished record, and the user's real send, echoed by Codex, removes it. A child still live when the provider exits settles unknown. Closing the tab drops every record.
  • src/renderer/src/components/native-chat/structured-child-records-switch.test.tsx: wired renderer parity, using the real bridge, store, strip and sidebar rows. One child reads the same on both surfaces live, after the status stream drops, and when the parent row is stale. When nothing runs, the strip is gone and the sidebar has no child rows, on the new path and on an older host's task list.
  • src/main/claude/claude-background-wake-retention.test.ts: captured Claude frame orders through the real adapter, a real hook server and the production status feed.
    • A background agent and a background shell leave the running list the moment they finish; their records stay through the wake turn Claude opens by itself, and leave at the next accepted send.
    • A steer taken during the wake removes them.
  • src/main/claude/claude-background-stop-records.test.ts: a backgrounded agent the CLI's list dropped with no ending of its own.
    • Per-row Stop and Stop all reach the CLI with its id, settle the record, and unblock /clear.
    • The task's own completion, arriving after the acknowledgement, replaces the Stop.
    • The task's own failure is kept against a later Stop.
  • src/main/claude/claude-stop-ack-race.test.ts: the real SDK and Orca's stream-json connection against the scripted CLI. The completion is written just ahead of the stop answer, with 0, 1, 5 and 50 streamed frames in front of it. The task ends succeeded with its summary every time. With 5 or 50 frames, the SDK delivers the acknowledgement first.
  • src/main/runtime/claude-structured-session-integration.test.ts: now wired to a real hook server. A targeted Stop reaches and settles only its task; an unknown id sends nothing.
  • src/main/native-chat/agent-session-wire/structured-conversation-command-child-work.test.ts: admission follows the strip's records, not a tracker list that claims work throughout. That covers main's queued /compact, including a refusal at hand-off when work starts after acceptance.
  • structured-agent-session-child-work-selection.test.ts: one running selection for both surfaces; the host's strip history and session-list snapshot carry the same running children, and no strip once none runs.
  • agent-status-child-work-reconciliation.test.ts:
    • a finished owner kept above live work at any depth, and listed as running;
    • a provisional ending replaced only by the task's own.
  • structured-agent-session-child-work-legacy.test.ts: an older client's Codex rows (the child's shell hidden while its agent runs, labelled once it finishes).
  • structured-agent-session-reducer.test.ts: a malformed row is dropped without throwing, and an unchanged roster keeps its identity.
  • Also added or extended:
    • the background-task channel (a closed conversation's roster is forgotten, and "no children" is sent once, not on every change);
    • the strip view (stable empty lists and roster identity);
    • the Stop loop (named ids only, continuing after a failure, and stopping after a timeout: 5 tasks against a CLI that never answers cost one deadline);
    • the host cancel path, the status feed, the child-view wire decoder, the capability gate, the sidebar and the parity tests (both surfaces now list the same rows; a finished child is on neither).
  • Removed with the strip change: the 100-row cap and running-then-newest-finished tests, the cut-owner re-homing test, and the tests that dated retention by when the user wrote the send.

Ablations (one mechanism deleted or neutered at a time, confirmed red, restored). Earlier head (rows for mechanisms removed by the strip change are dropped):

Deleted Red
Strip channel re-pointed at the adapter's list 1 (end-to-end agreement)
Ingest liveness read from the summary's task list 4 (ingest suite + end-to-end parent row)
Retention call in the feed 2 (feed retention + end-to-end)
Summary lists every child, not only running ones 3 (feed, host, end to end)
A finished owner of a live shell dropped 4 (feed, selection, parity, end to end)
The sidebar row builder ignores the rule 11 (new sidebar test, parity scenarios, lifecycle words, strip-only timing)
The predicate ignores live owned work 9 (monitoring on every surface, summary, end to end)
The predicate lists everything 18
The row builder never counts owned work as live 6
turn-started reducer arm 2 (reducer + end-to-end)
Old-reader gate at the RPC boundary 2
Summary clock tolerance 1
Bridge copying views onto the row 4 (all wired renderer tests)
Strip's parent verdict (childRowContext) 2 (lost and stale parity)
Codex legacy id mapping 5
Retained summary not re-reading the store when the row leaves 3 (close, forget with no close, end to end)
Summary republish after child work 1
Settled rows leaking into the summary's task list (substitution) 2
Decoder rejecting an unknown arm 1
Strip channel republish on ingest 1
Admission reading the records removed 5

Added in review:

Deleted Red
Retention on any new root turn (Claude wake turns count) 4
Retention on any written send, not an accepted one 2
Stop resolving ids without the records 1
The adapter's old task-list guard on Stop 2
An acknowledged Stop not settling the record 4
An acknowledged Stop not provisional 3
The task's own ending not replacing a provisional one 4
Retention protecting only a direct owner 1
Codex hide-and-label for older clients 2
Decoding children once on arrival 1
Roster identity reuse 1
Stable empty lists in the strip view 1
Stop all continuing after a failed request 1
A closed conversation's roster forgotten 1
Stop all asking again after a timeout 1
"No children" re-sent on every change 1
Admission at the queued /compact hand-off 1

Added with the strip change:

Deleted Red
Strip channel sending every record instead of the running selection 3 (host selection, end to end, admission host test)
The one predicate listing finished children 12 (parity, sidebar, wired renderer)
An older host's finished rows passed to the strip 2 (strip view, sidebar/strip parity)
The channel's hide once no provider answers for the session 1 (channel)

Not run here:

  • Cross-version suites. Not run at this head: they timed out extracting old builds under machine load. At an earlier head they passed, but they never send a background-task roster, so they do not cover this PR's version skew. The capability-gate unit tests cover it. A real mixed-version test is a follow-up.

  • Mobile tests. Not run: Expo is not installed here. Mobile reads no child rows or task roster; it only advertises the capability through the shared remote list.

  • I manually tested these changes locally

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

Review

Not verified:

  • Live coverage comes from the earlier-head run above and the QA section for this head. No Linux, Windows or SSH run; SSH and remote correctness rests on the design: records live on the execution host, clients mirror them over the existing feeds, and contact loss is the client's "unverifiable", never a record write.
  • The Stop race against the real CLI binary. The acknowledgement-first order is shown with the real SDK and a scripted CLI. That the real CLI writes a task's completion in the same chunk as a stop answer is inferred from its stop handler, not observed.
  • Claude waiting or blocked children are not produced here. A Claude child waiting on approval reads working in both surfaces; the pane-level wait still shows on the parent. feat(native-chat): a Claude subagent waiting on a permission prompt reads as waiting #22634, stacked on this PR, produces the waiting state.
  • Codex default multi-agent mode shows the helper's shell but no agent row until feat(native-chat): register Codex default-mode helpers as subagents #22619.
  • A cancelled child reads "interrupted", by design (refactor(sidebar): one subagent row for CLI and structured children, shared with the chat strip #22565 maps a cancelled outcome to the interrupted dot, as a CLI row does).
  • Strip before the parent row lands: until the session's status row exists in the renderer, the strip shows the children as reported, as it did before this PR.

How this compares with the approaches this design was checked against (each difference labelled):

  • Liveness from each child's own start and end frames, ignoring provider rosters: matches.
  • The strip lists running children only and hides when none runs; finished work is in the transcript: matches.
  • Finished records kept in the host's store until the user's next message, not shown anywhere: intended. They refuse a late frame of a finished run, let a task's own ending replace an acknowledged Stop's, and keep a running shell's owner; the next message bounds them.
  • Settled children are not kept across an app restart (the store is in memory): temporary. The follow-up rebuilds agent records from fix(claude): a restarted provider continues the subagent roster earlier runs journaled #23758's journaled subagent roster.

Follow-ups (recorded, not in this PR):

  • Delete the Claude provider tracker. It is still fed and has no production reader.
  • Pre-existing, not this PR: a Codex child with no terminal evidence stays live. Codex offers no stop, so /clear, /compact and rewind say "Wait for background tasks to finish" until the tab closes. It needs its own way to re-derive the child.
  • Keep settled children across a restart, rebuilt from fix(claude): a restarted provider continues the subagent roster earlier runs journaled #23758's journaled roster.
  • A real mixed-version test that sends a background-task roster between an old and a new build.

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.

Notes

  • Mixed versions.
    • New host with an old client: the old client ignores children. It reads the derived backgroundTasks / tasks / settledTasks / subagents: running children only, in the session list and on the strip, and no strip once none runs. For Codex, a finished agent whose shell still runs appears as a "done" row beside it.
    • New client with an old host: there is no children anywhere, so the client converts the old task list as before, but the strip shows only its running tasks (the old host's finished rows are dropped) and hides when none are left.
    • Nothing new is persisted: structured rows are never saved, and the child store is in memory.
  • Folder workspaces, SSH, WSL. The records are keyed by the session's full execution scope. Nothing assumes a git worktree.
  • Performance. Each summary does one store read of the session's children. Summary republishes are measured above. The strip no longer regroups its rows on every streamed frame. A closed conversation's last roster is not kept for the host's lifetime, and a chat with no children sends "none" once instead of on every change.
  • One tracked reference doc sentence is updated (agent-status-store.md: the structured row folds the store's child records).

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)

@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

  • Host publishes its child records. The status summary gains optional children?: AgentChildWorkView[], with backgroundTasks now derived from the same views (live rows only); the chat strip channel reads readChildWork from the host's status sink instead of the adapter's task DTO, republishes only on a changed fingerprint, and sends an explicit null once a live provider has no rows. The parent row ingests canonicalStatusStore.getChildren(subject) rather than the summary's task list.
  • Retention without a timer. The status feed tracks the newest root turn id in the journal (subagent turns excluded) and, when it changes, admits a new turn-started evidence edge; the reducer removes settled children that no longer own live work, so a finished child stays listed with its outcome until the session's next turn.
  • Both readers draw from the records. The renderer bridge decodes summary.children permissively, copies them onto the row verbatim, derives the legacy subagents roster from them, and reuses the child array across repeated summaries; the strip consumes the same views plus a childRowContext built exactly as the sidebar builds it, so a lost or stale parent reads the same on both surfaces.
  • The old writer is gone. onBackgroundTasksChanged is deleted end to end (Claude/Codex adapters, close/teardown funnels, runtime wiring, host.publishBackgroundTaskState); a new adapter seam backgroundTaskStops supplies the provider's stop capability for provider-side decisions only.
  • Wire compatibility. New capability agent-session.background-task-child-views.v1 is advertised by the shared remote list and the desktop renderer; the RPC boundary withholds children and settled-only rosters from a reader that does not advertise it. decodeAgentChildWorkViews ignores unknown keys and degrades unknown enum arms rather than dropping rows, and Codex view ids map back to codex-agent:<thread> for legacy shapes.

I read the complete diff (all 66 files) and ran the new and rewritten suites touching this surface — shared view-wire/reconciliation, the status-feed and feed-children suites, the end-to-end structured-child-records-switch, the RPC capability suite, and the renderer switch/background-tasks-view tests — all green. The abstraction is coherent: one store read feeds one projection, and the legacy shapes are derived from it rather than maintained in parallel, which is the failure mode this PR exists to remove. No blocking or non-blocking findings.

Pullfrog  | 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

This run reviewed the delta since the previous Pullfrog review. The branch was rebased from base 3422ccaf4c onto 78e73c646a, which now carries the mainAgent lane; git range-diff shows the patch content is otherwise unchanged, so the re-review is the rebase integration plus the header-comment fix.

  • Rebased onto the mainAgent lane. structuredAgentSessionAgentStatus now takes childWork (records or views) instead of the summary's backgroundTasks, while returning the base's mainAgent. The only PR edit to that function is the input swap, so the host's parent row, the renderer bridge, and the CLI still fold one liveness source.
  • Held-open verdict preserved. The ingest and bridge date a child-held row with isAgentStatusHeldOpenByChildWork({ state, mainAgent }), which is exactly the removed fromChildWork (mainAgent.state === leadState && state !== 'done'); the parent row's freshness clock is unchanged.
  • Readers still draw from the views. The bridge copies summary.children onto the row and derives the legacy roster from them; the live-entry builder reuses the child array across repeated summaries; the strip counts only live views toward the monitoring indicator.
  • Wire and retention unchanged. The agent-session.background-task-child-views.v1 capability, the RPC-boundary withholding of children and settled-only rosters, the turn-started retention edge, and the header-comment reword all stand as previously reviewed.

I read the complete diff end to end, plus the base versions of the files the rebase touched, and traced the fromChildWork → isAgentStatusHeldOpenByChildWork equivalence. No new findings.

Pullfrog  | 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

This run reviewed the delta since the previous pullfrog review (8dac1b1 → bb15e1c): two commits that move conversation-command admission off the provider adapter's own task roster and onto the host's child records. One non-code note: the PR description's Review section still lists conversation-command admission among the adapter-tracker readers, which this delta no longer holds.

  • Admission reads the strip's records. conversationCommandBlocked now takes childWork and folds it through agentChildWorkLiveness, the same fold the strip's monitoring indicator uses, so a settled roster blocks nothing and only work the strip lists refuses a command.
  • One owner for the stop-offer rule. The new shared agentChildWorkViewOffersStop is used by both the row model's canStop and admission's stripOffersStop, and stripOffersStop mirrors the strip's own controls: a per-row stop where supportsTaskStop, otherwise the single untargeted stop where supportsStopAll.
  • readChildWork threaded to the decision. StructuredAgentSessionMutationContext gains readChildWork (wired from clientDelivery.readChildWork); both runStructuredConversationCommand and rewindStructuredAgentSession pass it.
  • Adapter interface trimmed. backgroundTaskState leaves StructuredAgentSessionAdapter and the router; the concrete Claude/Codex adapters keep it as a test-only accessor for holding the tracker roster beside the records.
  • Tests. A new end-to-end test proves a tracker roster that claims live work refuses nothing while the strip is empty, refuses Stop… for a live record, and admits once the record settles; the unit suite covers the targeted / untargeted / no-stop matrix with the tracker present throughout.
  • Comments only. The legacy death condition, the summary clock-tolerance invariant, and the retention lifecycles.

I read the full diff and the delta end to end, traced stripOffersStop against the strip's render gating (supportsStop / supportsStopAll and the per-row stopId), confirmed agentChildWorkViewOffersStop is exactly the old canStop predicate, and ran the admission unit suite (7/7) and the new integration suite (1/1) green, plus pnpm tc:node and oxlint on the changed files.

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

@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch from b4cf0d2 to 5406ab2 Compare September 24, 2026 21:38
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from bb15e1c to 254db2d Compare September 24, 2026 22:08
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch from 5406ab2 to 359483b Compare September 25, 2026 00:02
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from 254db2d to 20bff9f Compare September 25, 2026 01:06
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch from 359483b to f02c2e1 Compare September 25, 2026 05:13
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from 20bff9f to 02631b8 Compare September 25, 2026 05:24
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch from f02c2e1 to d30ea85 Compare September 25, 2026 05:56
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from 02631b8 to 04870e9 Compare September 25, 2026 06:00
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch from d30ea85 to a26d58b Compare September 25, 2026 10:58
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from 04870e9 to dbf9315 Compare September 25, 2026 11:17

@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

This run re-reviewed the two commits that landed since the prior pullfrog review, on a branch rebased onto the advanced base (the rest of the current commit stack is content-identical to the prior review; only these two are new).

  • The retained projection drops children when the store does. revokeLive no longer strips children/backgroundTasks (it drops only hostExecutionOwned), and forget now re-reads childWorkFields after ownership.forget and broadcasts the retained summary. A forget with no close (eviction) now removes a session's child rows from the retained projection too, so the session list and the chat strip agree at each step. forgetStructuredAgentSession and the eviction releaseLease step are the production forget-without-close callers this addresses; revokeLive has no production caller besides close.
  • Provider exit is settled, not erased, in the end-to-end test. structured-child-records-switch.test.ts now asserts that a provider exit settles a still-live child with an unreported outcome while both surfaces keep listing it, and that host.close then removes the row and every child record from both.
  • The Codex producer test no longer uses the tracker as an oracle. Each step writes its expected child liveness and parent fold out literally; the adapter.backgroundTaskState comparison is gone, so the test can fail independently of the tracker it shares executions with.
  • Comments realigned. The retention note in structured-agent-session-status-feed.ts and the session-ended docstring in agent-status-child-work-evidence.ts now match the base's "a session's end settles its live children" behavior.

Verification: feed, feed-children and admission suites (37), reentry / forget-status / Codex producer / Codex background-tasks / Claude close (18), the switch e2e (1/1), the renderer node-builtin boundary (2/2), and pnpm tc:node — all green.

ℹ️ PR description still describes session-ended as erasing every record

The description's Retention paragraph says the provider ending the session "(its session-ended evidence removes every record, e.g. a provider exit or the post-exit release)". With the base's "a session's end settles its live children" change plus this commit, session-ended settles a still-live child unknown and keeps settled children; only the next root turn, the settled-record cap, or the host letting go removes a record. Updating that sentence would keep reviewers from reading the old behavior as current.

Technical details
# Stale `session-ended` wording in the PR description

## Affected sites
- PR description → Retention paragraph: "when the provider ends the session (its `session-ended` evidence removes every record, e.g. a provider exit or the post-exit release)"

## Required outcome
- Say that `session-ended` settles a still-live child with an outcome nobody reported and keeps settled children, until the session's next root turn, the settled-record cap, or the host releasing the session.

## Suggested approach (optional)
- `src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts:241` carries the current wording.

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

@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch 2 times, most recently from 871c4b9 to 05308c3 Compare September 25, 2026 20:32
@brennanb2025
brennanb2025 force-pushed the brennanb2025/c5-read-child-records branch from dbf9315 to 7d02ed4 Compare September 25, 2026 20:38

@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

This run re-reviewed the single commit that landed since the prior pullfrog review, 7d02ed47ef (the prior head dbf9315d33 is content-identical to d917c014b5, its rewritten twin under the rebase).

  • The idle-release clock reads the host's child records. createStructuredAgentSessionHolds gains a required readChildWork argument, wired from clientDelivery.readChildWork; hasOwedWork now folds agentChildWorkLiveness(readChildWork(sessionId)) instead of the adapter's task roster, so the "keep an idle chat while its subagents run" clock consults the same records the sidebar and strip draw from.
  • The quit snapshot reads the same records. structuredAgentSessionWorkingAtStop and structuredAgentSessionShownStatus take childWork: AgentChildWorkView[] from surfaces.readChildWork rather than the tracker's backgroundTasks, and liveTasks filters the views with the shared liveness rule.
  • A latent fold mismatch is fixed. structuredAgentSessionShownStatus still handed the roster to structuredAgentSessionAgentStatus as backgroundTasks, which the fold no longer reads; a settled lead with a still-running subagent therefore folded done and offered nothing at teardown. Handing it childWork restores the offer, and the restart-teardown test now proves the tasks label comes from the records.
  • Tests move off the tracker oracle. The owed-work-release suite wires a real AgentHookServer as the status sink plus onChildWorkEvidence, asserting through host.history(...).backgroundTasks.children; a new serveHostTestChildWork harness helper and childRecord fixture feed the restart-teardown/interruption tests through the records read.

I read the delta end to end and traced both readers: readChildWork returns the records once the parent row has landed (StructuredAgentSessionStatusOwnership, which the attached session's initial publish guarantees), the fold filters settled rows identically on records and views, and no production code reads the adapter's tracker method any longer. Ran the four changed suites (56/56) and pnpm tc:node (exit 0), green.

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

@brennanb2025
brennanb2025 force-pushed the brennanb2025/c7-shared-subagent-row branch 2 times, most recently from 61fa991 to 57f622d Compare September 29, 2026 04:19

@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 minor suggestion inline, flagged as an unverified ordering assumption rather than a demonstrated bug.

Reviewed changes

This run re-reviewed the seven commits that landed since the prior pullfrog review (d7bb26a → 0788ed9), plus a re-integrated origin/main merge. They move the last provider-side reads onto the host's child records and settle two long-standing shape questions.

  • Retention now keys on the user's send, not a provider turn. newestRootTurnId became newestAcceptedSendKey (journal epoch + the newest accepted submission), so a turn Claude opens on its own — the wake a finishing background task triggers — no longer retires a finished child; only the user's next accepted send (or a rewind's epoch replacement) does.
  • A background Stop resolves from the child records. New shared agent-child-work-stop.ts; the adapter contract's stopBackgroundTasks now takes taskIds the host derives from the records (performCancel reads them through input.childWork), and Claude ends each acknowledged task via new ClaudeChildWorkDecoder.stopAcknowledged.
  • One nested-owner rule. settledOwnersOfLiveWork moved into agent-status-child-work-liveness.ts and is read by retention (removableSettled) as well as the listing module, so a finished owner of live work survives at any depth, not just one level.
  • The Codex legacy flat roster is derived faithfully. withCodexChildCommands hides a Codex child agent's command while its agent runs and names it <agent> — <command> once settled, through the shared codex-child-command-description.
  • The client decodes a roster's child rows once, as the frame arrives. New admitAgentSessionBackgroundTaskState decodes children in the reducer, so equality and every reader see decoded rows and structuredSessionBackgroundTasksView no longer decodes.
  • The strip channel forgets a closed conversation's roster. StructuredAgentSessionConversations.delete notifies a close observer the channel registers, so reopening a session re-sends its roster instead of staying silent on a stale fingerprint.

I read the incremental diff end to end and the affected production files. The retention key is safe against the per-commit projection cache — a dispatch write bumps the journal cursor().sequence, so acceptedSendKey cannot be served stale — and the stop predicate the host resolves is the same conjunction the strip renders by. Two independent passes over the Codex legacy shim and the Claude stop path returned the Codex derivation faithful for the command shell and the stop predicate consistent; the one open item is inline.

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

…finished after the user wrote stays

Two lifecycle gaps from the round-1 fixes.

A Stop acknowledged ahead of the task's own ending relabelled it. The SDK hands
Orca a control answer as soon as it reads it and queues other frames, so when a
task finished just as the user pressed Stop, the acknowledgement arrived before
the task's completion the CLI wrote first, and the task read "Stopped" with its
result lost. An acknowledged Stop now ends a record provisionally (outcome basis
`stop-acknowledged`); the task's own terminal frame replaces it, and nothing
replaces an ending the task reported itself.

A finished child still vanished with no new action from the user when the send
the provider took was written before the child finished: a steer Claude takes at
its next boundary, or a queued draft handed over at the end of the turn. The
user's next turn now carries when they acted (the send's written time, or the
draft's queued time, both on the host clock), and only children that finished at
or before it retire; a later one stays until the user's next send. A rewind
still retires every finished child.

Also: a Stop-all keeps stopping the remaining tasks after one request fails, then
reports the failure.
…its one

A roster with only running or only finished rows made a new empty array on every
render, so the strip regrouped its rows each time. One shared empty list keeps
its memo.
…ers under the main agent

The budget can keep a finished child and cut its finished owner. The child still
named that owner, so it rendered nowhere. The selection now clears an owner it
did not keep, as the view contract says for an owner outside the projection.

@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 comment nitpick inline.

Reviewed changes

This run re-reviewed the three PR-authored commits that landed since the prior pullfrog review (0788ed9 → bacc1ba), which sit atop a merge of origin/main whose incoming changes are unrelated to this PR's surface.

  • A task's own ending can replace a Stop's. The acknowledgement of a background Stop now settles the record provisionally with a new host-only outcomeBasis: 'stop-acknowledged'; the task's own terminal frame of the same run replaces it, while a reported ending is never replaced by a later acknowledgement. The two rules live in a new shared agent-status-child-work-ending.ts; ClaudeChildWorkDecoder.stopAcknowledged supplies the basis, and the codec validates the field (settled-only, host-only — it never reaches the view wire).
  • Retention keys on when the user acted, not on a provider turn. newestAcceptedSendKey became newestAcceptedSend ({ epoch, clientMessageId, actedAt }), dating a send handed over from a queued draft by when the draft was queued. The feed carries actedAt on the turn-started edge only within an epoch, and the reducer keeps a finished child whose settle time is after it — so a child that finished after the user wrote their message stays until their next send, while a rewind (new epoch) still retires every finished child.
  • A failed stop request no longer abandons the rest. stopClaudeBackgroundTasks continues past a refusal and rethrows the first non-control error after the loop; a control refusal still leaves that task live.
  • The strip's view reuses one empty list. A roster that omits tasks or settledTasks now returns a shared empty array, keeping the strip's memo identity stable across renders.
  • A budget-cut owner's child renders under the main agent. When the 100-row strip budget drops a child's owner, the child's view is re-parented to the main agent so it never renders under a row that is not there.

I read the incremental diff end to end and the affected production files, traced the new ending rules through each ordering (report-after-ack, ack-after-report, matching outcome, unknown), confirmed the retention clocks are both host wall-clock, and ran the changed suites — claude-background-stop-records (5), claude-stop-ack-race (4, real SDK), claude-background-wake-retention (3), reconciliation (21), status-child-work (3), feed-children (9), background-tasks-view (5), child-work-selection (6) — 56/56 green, plus pnpm tc:node (exit 0). The prior review's one open thread — the stop-acknowledgement ordering — is resolved by 2c8575935f, whose new tests pin the interleaving deterministically.

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

…ldren" is sent once

A stop-all kept asking after a request timed out, so a Claude CLI that stopped
answering control requests cost one full deadline per task, while the chat's
sends, Stop and /compact waited behind it. A timeout now ends the loop; other
request failures still let the remaining tasks be stopped.

The chat strip channel never remembered that it had sent "no children", so
every change in a chat with none re-sent that frame to each subscriber. It now
remembers it, and forgets only when the conversation closes.

Also renames agent-child-work-stop.ts to agent-child-work-stop-targets.ts, which
says what it answers: the provider ids a background Stop reaches.

@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: ec58a7a2-e2e4-40de-b1fe-f3730a83b450

📥 Commits

Reviewing files that changed from the base of the PR and between bacc1ba and dbd2439.

📒 Files selected for processing (9)
  • src/main/claude/claude-background-stop-records.test.ts
  • src/main/claude/claude-structured-control-actions.test.ts
  • src/main/claude/claude-structured-control-actions.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-background-task-channel.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-background-task-channel.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-turns-cancel.ts
  • src/main/native-chat/agent-session-wire/structured-conversation-command-admission.ts
  • src/shared/agent-child-row-model.ts
  • src/shared/agent-child-work-stop-targets.ts

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

Comment on lines +84 to 86
if (error instanceof ClaudeControlRequestTimeoutError) {
throw error
}

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C5 '\bstopClaudeBackgroundTasks\s*\(|stopBackgroundTasks\s*\(' src/main --type=ts -g '!*.test.ts'

Repository: stablyai/orca

Length of output: 2142


🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- control actions ---'
cat -n src/main/claude/claude-structured-control-actions.ts | sed -n '1,140p'
printf '%s\n' '--- session adapter ---'
cat -n src/main/claude/claude-structured-session-adapter.ts | sed -n '150,245p'
printf '%s\n' '--- stop result/error consumers ---'
rg -n -C4 'cancelled|ClaudeControlRequestTimeoutError|stopClaudeBackgroundTasks|stopBackgroundTasks' src/main/claude --type=ts -g '!*.test.ts'

Repository: stablyai/orca

Length of output: 41803


🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- repository-wide stop API references ---'
rg -n -C5 '\bstopBackgroundTasks\b|\bstopClaudeBackgroundTasks\b|onChildWorkEvidence|child-work evidence|ChildWorkEvidence' . -g '!node_modules' -g '!dist' -g '!build'
printf '%s\n' '--- adapter contract declarations ---'
rg -n -C8 'interface StructuredAgentSessionAdapter|stopBackgroundTasks:|stopBackgroundTasks\?' src

Repository: stablyai/orca

Length of output: 42054


🏁 Script executed:

#!/bin/bash
cat -n src/main/native-chat/agent-session-wire/structured-agent-session-turns-cancel.ts | sed -n '1,145p'
printf '%s\n' '--- cancellation entrypoints and result types ---'
rg -n -C6 'cancelStructured|cancelTurn|AgentSessionCancelOutcome|stoppedBefore|scope\?' src/main/native-chat/agent-session-wire src/shared -g '*.ts' -g '!*.test.ts'

Repository: stablyai/orca

Length of output: 41416


Preserve partial cancellation after a later timeout.

An earlier successful stop sets cancelled = true and records the stopped task. A later timeout throws before the result returns. performCancel catches that error, leaves cancelled as false, and returns a background-task result with cancelled: false. This can report that no task stopped even when an earlier task did stop.

Carry the partial cancellation state through the timeout path so callers can distinguish “some tasks stopped” from “no task stopped.”

@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 in this delta — one earlier doc typo is still open and is re-anchored inline.

Reviewed changes

This run re-reviewed the single PR-authored commit that landed since the prior pullfrog review (bacc1ba → dbd2439), which sits atop a clean merge of origin/main (a020c1ee4b, first parent bacc1ba, second d2dbe2c385) whose incoming commits are unrelated to this PR's surface (Windows CLI launcher, Linux keyring/secrets, antivirus scan, test retirements).

  • A stop-all that times out stops asking. stopClaudeBackgroundTasks now rethrows ClaudeControlRequestTimeoutError straight out of the per-task catch, ending the loop instead of letting a wedged CLI cost one full deadline per named id while the chat's sends, Stop and /compact queue behind it. A non-control failure still lets the remaining tasks be tried and is rethrown after the loop; a control refusal still leaves that task live.
  • The strip channel remembers "no children". StructuredAgentSessionBackgroundTaskChannel.publish now stores the null fingerprint too, so a chat with no children sends its "none" roster once rather than on every change. The entry is still dropped when the conversation closes, and a new subscriber still gets the opening null from subscribe's own state read.
  • The stop-target module is renamed. agent-child-work-stop.ts → agent-child-work-stop-targets.ts, saying what it answers; the four importers are updated and the old file is gone.

I read the commit end to end and the affected production files, confirmed ClaudeControlRequestTimeoutError extends Error rather than ClaudeControlRequestError (so the new catch is what distinguishes a wedged CLI from a per-task refusal), and ran the three changed suites (22/22) plus pnpm tc:node (exit 0), green. The new timeout test drives the real runClaudeControl deadline wrapper and fails on the pre-delta loop; the new channel test fails on the pre-delta delete-on-null.

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

…bmissions, and e2e tests use the child-work reader

CI on dbd2439 was red in three places:
- first-work-branch-rename and the agentSession.subscribeStatus RPC test feed the status feed a
  journal whose snapshot lists items only. The projection reads the user's newest accepted send
  from `snapshot.submissions`; it now tolerates their absence, as the status projection beside
  it already did.
- the cross-version downgrade test still passed `backgroundTasks` to the teardown's working
  marker, which now takes `childWork`.
- an e2e unit test still gave the status feed the removed `readBackgroundTasks` dependency
  (harmless at run time, a type error in the tests/ project).

@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 findings in this delta — a CI-green follow-up to the prior commit. Approval is withheld only because an earlier doc-comment typo thread on this PR is still open, not because of anything in these changes.

Reviewed changes

This run re-reviewed the single PR-authored commit that landed since the prior pullfrog review (dbd2439 → bc7bc6e): the follow-up that turned the red CI on dbd2439 green.

  • The status feed tolerates a journal snapshot with no submissions. StructuredAgentSessionJournalProjections.read passes snapshot?.submissions ?? [] to newestAcceptedSend, matching the snapshot?.items ?? [] beside it. The real renderJournalState always sets submissions, so only the hand-built test journals whose snapshots list items alone change behavior — they previously crashed newestAcceptedSend's findLast on undefined, which is what left first-work-branch-rename and the agentSession.subscribeStatus RPC suite red.
  • Two e2e tests use the child-work read. agent-session-resume-marker-downgrade.unit.test.ts passes childWork: () => undefined to structuredAgentSessionWorkingAtStop (was the removed backgroundTasks), and codex-child-approval-activity-row.unit.test.ts drops the removed readBackgroundTasks status-feed dependency.

I read the commit end to end and the affected production file, and ran first-work-branch-rename (38/38), codex-child-approval-activity-row (1/1), the agentSession.subscribeStatus RPC suite (55/55), pnpm tc:node (exit 0) and oxlint on the three files (0 findings), all green. The cross-version downgrade test cannot execute in this shallow checkout (its harness needs the v1.4.211 tag), but its change is a type alignment that now compiles.

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: ready for your review at bc7bc6ef685 (CI green, 38 checks)

The problem. A chat session's subagents and background commands appear in two places: the worktree sidebar and the chat's background-task strip. The two read different copies of the provider's task list and disagreed. The strip also dropped every finished row as soon as nothing else was running, so you never saw how a background agent or shell ended, including failures.

What changes for you. Both surfaces now read the host's one record per child.

  • The sidebar lists running children only.
  • The strip keeps finished children, with their outcome, until you send your next message. Claude waking up on its own to report a finished task no longer clears them.
  • Stop reaches exactly the rows the strip offers it on.
  • /clear, /compact and rewind are blocked only while the strip shows live work.
  • Terminal (CLI) agents are unchanged.

Fixed in this review (main merged in; each fix has a test that fails without it):

  • Stop could do nothing, blocking /clear / /compact / rewind until the tab closed. Stop still went through the provider's own task list while everything else read the records. It now resolves from the records, and an acknowledged Stop settles the task.
  • Background children vanished about 2 s after finishing. Claude's own wake turn counted as "the next turn". Retention now keys on your next accepted message, and only children that finished before you wrote it leave.
  • Stop could read "Stopped" on a task that had just finished on its own, losing its result. The Stop's ending is now provisional, and the task's own ending replaces it.
  • A finished parent in a nested chain was dropped while its descendant still ran. One rule now covers both the listing and the cleanup.
  • Older clients: Codex shell rows show as before (hidden while their agent runs, then labelled " — ").
  • The client decodes child rows once. An unexpected row can't crash it, and the strip no longer rebuilds on every streamed frame.
  • A child past the 100-row cap whose parent row was cut is now shown under the main agent instead of nowhere.
  • Stop-all gives up after one unanswered request instead of waiting 30 s per task.
  • A small per-chat memory leak on close, and a repeated empty frame, are fixed.
  • Main's new /compact acceptance and handover checks now read the records too.
  • 3 CI reds were from this PR: a test fake without submissions, and a stale e2e test input. Both are fixed.

Deferred (follow-ups, not in this PR):

  • Delete the Claude background-task tracker. It still runs, but nothing in production reads it.
  • A Codex child with no ending stays live and blocks commands until the tab closes. This predates the PR; Codex has no Stop.
  • Keep finished children across an app restart. fix(claude): a restarted provider continues the subagent roster earlier runs journaled #23758's journaled roster could rebuild them.
  • A real mixed-version test that sends a background-task list. Today the capability-gate unit tests cover it; the cross-version suite doesn't send one.
  • Cosmetic: after contact is lost, the sidebar's "No update in Nm" can read one minute higher than the strip's. A nested shell row can repeat its title as its summary.
  • Nits: redundant legacy lists sent to new clients; legacy lists not decoded; an older send accepted out of order delays cleanup by one message.

Verified

  • Typecheck (node, web, cli): 0 errors.
  • 204 targeted test files: 2,455 passed, 12 skipped, 0 failed.
  • Full CI green.
  • A readiness checklist found no P0/P1. Its two P2s (the stale description and a confusing file name) are fixed.
  • An architecture review found the design right, and recommends landing it as one PR.
  • Live QA on a separate Mac with Claude Code 2.1.285, screenshots in the description:
    • Running subagent: pass.
    • Finished subagent: pass.
    • A background shell and a background subagent finishing after Claude's wake turn stay: pass.
    • Your next message clears them: pass.
    • Stop, then /compact accepted: pass.

Not verified

  • Codex live at this head (the earlier head's Codex runs are in the description).
  • The "monitoring" state live: this Claude version kills a finished subagent's shell, which the strip showed correctly.
  • Terminal agents live. A probe shows their sidebar rows are identical to main.
  • Windows, Linux, SSH and mobile runs.
  • The cross-version suites locally (environment timeouts; CI ran them green).
  • The real Claude CLI in the stop-race case, which was tested with a scripted CLI through the real SDK.

…sidebar's rule, and hides when none runs

A finished subagent's result is already in the transcript ("Ran N subagents ·
completed"), so the strip is for work that runs. It now lists exactly what the
sidebar lists, by one predicate (a running child, or a finished one whose own
shell still runs, which reads monitoring), and the host sends no roster once none
runs, so the strip hides.

Gone with it: the 100-row budget and the running-then-newest-finished
selection, the re-homing of a child whose owner the budget cut, and the RPC
gate's rule for a roster of finished rows only (no such roster exists now).
Older clients still get their derived task list, running work only.

Finished records still stay in the host's store until the user's next accepted
message: they refuse a late frame of their run, let a task's own ending replace
an acknowledged Stop's, and keep a running shell's owner. Dating that retention
by when the user wrote the message only kept finished rows visible longer, so it
is removed.

@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 in the delta — one description note in the body.

Reviewed changes

This run re-reviewed the single PR-authored commit since the prior pullfrog review (bc7bc6e → b9e1ef8), which sits atop a clean merge of origin/main (e769c0978e, bringing #22619 and unrelated main content). It deliberately reverses the strip's listing model.

  • The chat strip lists running children only, by the sidebar's rule, and hides when none runs. structuredStripChildWork / structuredSidebarChildWork / worktreeSidebarListsChild / STRUCTURED_STRIP_CHILD_WORK_LIMIT are replaced by one predicate (agentChildWorkIsRunning) and one selection (structuredRunningChildWork), shared by the status summary, the strip channel and the renderer's buildSubagentChildRows.
  • Retention keys on the accepted send alone. newestAcceptedSend ({ epoch, clientMessageId, actedAt }) is reverted to newestAcceptedSendKey; the turn-started evidence loses actedAt and removableSettled drops the settle-time filter. A finished record still lives until the user's next accepted send (or a rewind), but no surface lists it — its stated job is now only to absorb a late frame, preserve an acknowledged Stop's replaceable ending, and keep a live shell's owner.
  • The old-reader RPC gate simplifies. withoutChildViews always returns the derived legacy roster; the branch that withheld a finished-only roster is gone because no roster is finished-only now.
  • Tests updated/deleted to match: the newestAcceptedSend suite is removed, and the selection, parity, sidebar-running-children, feed-children, background-task view/channel, e2e switch, reconciliation and RPC-capability suites assert the running-only model.

I read the commit and the incremental diff end to end, checked the dangling-reference surface (newestAcceptedSend, structuredStripChildWork, the deleted structured-agent-session-status-child-work.test.ts — all gone), traced withoutChildViews against state() (every roster now lists running work, so the old reader's "any roster is live work" reading holds), and ran the 10 changed suites green (97 tests: 50 host, 47 renderer). The two prior open threads — duplicate reviews of a garbled actedAt doc comment — are addressed by that comment's deletion and were replied to and resolved.

ℹ️ The PR description still describes the finished-rows-stay design this commit removes

The commit's whole point is that a finished child is no longer listed on either surface, but the description's "What this changes for you" table, ELI5, "Strip selection" bullet and "Older readers" note still say the strip keeps finished rows up to 100 (and that old Codex clients see a finished agent as a settledTasks "done" row). A reviewer reading the description first is led to expect the opposite of the shipped behavior.

Technical details
# Stale PR description after the running-only strip reversal

## Affected sites
- PR body → "What this changes for you" table: "A background agent or shell finishes after your turn … It stays in the strip with how it ended … until your next message"
- PR body → "Which rows the strip shows": "Every running child, then finished ones, up to 100 rows"
- PR body → ELI5: "A finished helper stays on the chat's list, with its result, until you send your next message"
- PR body → "Older readers": "New for them: finished Codex agents appear as 'done' rows in `settledTasks`"

## Required outcome
- The description should say both surfaces list running children only and the strip hides when none runs; the finished record is retained internally (no surface lists it) until the user's next accepted send.

## Open questions for the human
- Is the transcript's "Ran N subagents · completed" line intended to be the only user-visible outcome for a finished child, or is a follow-up surface planned?

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

if (!session || stored === undefined) {
return undefined
}
const views = structuredRunningChildWork(stored)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Finished children vanish from strip

When the last background child finishes, structuredRunningChildWork removes it from the chat strip and the channel sends no roster. The strip hides before the user sends another message, so a child that finishes after the parent turn—especially one that fails—loses its visible outcome. This reverses the strip retention behavior introduced by this PR.

Knowledge Base Used:

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +134 to +136
return owned
.filter((record) => record.membership === 'settled' && !owners.has(record.childWorkId))
.map((record) => record.childWorkId)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Delayed sends retire recent children

When a user writes a steer or queues a message while a child is running, the child may finish before the provider accepts that send. The new turn-started path then removes the settled record without checking when the user acted. Although the user has sent nothing since the child finished, its result and the record needed to reconcile late evidence are discarded.

Knowledge Base Used: Agent workspaces and sessions

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…d hides after a released session's last child

- A new app paired with an older host no longer shows that host's finished task
  rows: the strip lists running work only, whatever host sent it, and hides when
  an older host's roster has only finished rows left.
- A test for the path that hides the strip when a session's last running child
  settles after the provider let go of the session (Claude's release path): the
  channel sends `null` though no provider answers for the session any more.
- A test comment still described the strip keeping finished children.
isMonitoring: turnId === null && liveWork,
tasks: backgroundTasks?.tasks ?? NO_TASKS,
// Running work only, from any host: an older host's finished rows are not shown either.
settledTasks: NO_TASKS,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Older hosts lose finished rows

When a newer client connects to an older Claude host, the host can report a finished task alongside another task that is still running. This line discards the finished task, so its outcome disappears from the chat strip even while the strip remains open.

Suggested change
settledTasks: NO_TASKS,
settledTasks: children ? NO_TASKS : (backgroundTasks?.settledTasks ?? NO_TASKS),

Knowledge Base Used: Agent workspaces and sessions

@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

This run re-reviewed the single commit that landed since the prior pullfrog review (b9e1ef8 → 4430535): a follow-up that extends the running-children-only strip rule to older hosts and pins the hide after a released session.

  • The strip hides an older host's finished-only roster. structuredSessionBackgroundTasksView now computes onlyFinished (!children && no tasks && some settledTasks) and sets show = monitoring && !onlyFinished, so a host that publishes no child records but lists only finished tasks no longer leaves the strip on screen.

  • Finished legacy rows are never rendered. settledTasks is now always the shared empty list (was the host's settledTasks ?? NO_TASKS), so an older host's finished rows are dropped on the client too, matching the new host's running-only roster. tasks still pass through untouched for a live provider.

  • Monitoring follows the new visibility. On the no-children path, liveWork is now show, so a finished-only roster no longer reads as monitoring.

  • Tests. A new view case asserts an older host's running tasks render while a finished-only roster shows nothing (and a state-only host still shows); worktree-sidebar-running-children.test.ts now derives the strip rows through the production view, and a channel case pins the strip hiding when the last child settles after the adapter released the session.

I read the commit and its single production file end to end, checked every production consumer of StructuredSessionBackgroundTasksView.settledTasks (only the strip's buildBackgroundTaskGroups reads it), and confirmed the new view test fails against the pre-delta code. Ran the four changed suites (22/22) and pnpm tc (exit 0) — all green. The open review threads on the PR are all from greptile/coderabbit; no pullfrog thread was left to retire. The prior review's informational note about the PR description still describing the finished-rows-stay design is unchanged but is not re-raised here.

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

…child-records

# Conflicts:
#	src/main/codex/codex-structured-session-teardown.ts
#	src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts
#	src/main/native-chat/agent-session-wire/structured-agent-session-rest-test-rig.ts
@@ -1,3 +1,4 @@
import { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from './agent-session-background-task-child-views-capability'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Stacked PR loses capability export

This moves AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY out of protocol-version.ts without re-exporting it. PR #22634 still imports it from that module in its desktop capability code and CLI transport test, so the combined stack fails TypeScript compilation.

Suggested change
import { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from './agent-session-background-task-child-views-capability'
import { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from './agent-session-background-task-child-views-capability'
export { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from './agent-session-background-task-child-views-capability'

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status update: strip shows running children only, ready at 9313ec25548 (CI green, 38 checks)

This supersedes the earlier status comment's strip rule.

What changed since the last update. The chat's background-task strip (above the composer) now follows the standard: it lists only RUNNING subagents and background commands, by the same rule as the worktree sidebar. That rule counts a finished subagent whose own shell is still running, shown as "Monitoring background tasks". The strip disappears entirely when nothing runs. Finished subagents stay visible where they belong, in the transcript ("Ran N subagents · completed"). Before this change in the PR, the strip kept finished rows until your next message.

What this means for you

  • A subagent or background command that finishes leaves the strip and the sidebar together, about 1 s after it ends.
  • With nothing running, there is no strip at all.
  • The app paired with an older host shows that host's running tasks only, and also hides when none are left.
  • Stop, /clear, /compact and rewind are unchanged from the last update: they act on exactly what the strip shows.

How

  • One rule (agentChildWorkIsRunning) now feeds the session list, the strip's channel and the sidebar.
  • The 100-row cap, the "running, then newest finished" selection and the cut-owner handling are deleted, since they only served the old strip.
  • The refinement that kept a child for one more message (it finished after you wrote) is deleted too. It only affected visibility.
  • Finished records are still kept in the host's memory until your next accepted message, but never shown. While a finished record exists, a late frame from the same run can't bring it back as a phantom "running" row that blocks /clear. A Stop's provisional ending can still be replaced by the task's own result. And a finished agent stays the owner of a shell that is still running.

Verified

  • A fresh review of the change found no P0–P2. Its three P3s are fixed: a test for the strip hiding after Claude lets go of a session, older hosts' finished rows hidden, and a stale comment.
  • Typecheck (node, web, cli): 0 errors. 367 targeted test files: 4,034 passed, 0 failed.
  • CI at 9313ec25548 (current main merged in): all green.
  • Live QA re-run on a separate Mac at b9e1ef8eb09, Claude Code 2.1.286: 6/6 scenarios PASS, with screenshots embedded in the description:
    • running subagent;
    • finished subagent leaves the strip and the sidebar together;
    • background shell gone before Claude's wake reply;
    • next message: nothing lingers;
    • Stop hides the strip, then /compact is accepted;
    • two parallel subagents go 2 → 1 → hidden, with the sidebar matching.

Not verified: terminal (CLI) Claude live (a probe shows its rows are identical to main); the monitoring state live (this Claude version kills a finished subagent's shell); Codex chat live at this head; paired/remote clients and mixed versions live.

Follow-ups (not this PR):

  • Delete the Claude task tracker, which nothing in production reads.
  • A Codex child with no ending blocks commands until the tab closes (pre-existing).
  • A real mixed-version test that sends a background-task list.
  • After a recovery or attach snapshot, a strip with running children can vanish until the list next changes. Main does the same.

Not merged.

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