Repository navigation
feat(sidebar): show native-chat subagents as sidebar child rows, like CLI agents already do - #19807
Conversation
There was a problem hiding this comment.
Important
One correctness regression on the new unverifiable child path: a subagent child that goes unverifiable still reports a "done" completion timestamp, which asserts the exit this PR's observation exists to withhold. See the inline comment.
Reviewed changes
- Status-feed observation — the feed now tracks
confirmedSessionsper connection and exposesgetSessionObservation, clearing confirmation on stream end/error/close/reject and teardown;fenceCandidateAndReconnectis folded intoloseConnection. - Background-task → subagent mapping —
StructuredAgentSessionStatusBridgemaps agent-kindbackgroundTasksintoAgentStatusEntry.subagents, with thelive/unverifiableobservation attached only when children exist. - Child-row rendering —
buildSubagentChildRowshonourssubagentObservation, decaying unverifiable children tounverifiablerather thanidle, while hook rows keepparentIsFresh. - Plumbing —
subagentObservationthreaded throughagent-status-contract.ts,agent-status-live-entry-builder.ts, andagent-status-types.ts(renderer-local, absent on hook rows).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
7d04881 to
548e9b3
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe status feed now tracks whether each session is confirmed by the current stream. The bridge projects valid agent background tasks into bounded subagent snapshots and propagates observation metadata through the store. Sidebar child rows use live, unverifiable, or legacy freshness state. Tests cover task projection, roster changes, disconnection, reconnection, ignored late events, and subscription failures. Merge Risk: ⚪ Minimal · up to The change adds native-chat subagent rows and safely marks them unverifiable across connection loss. The supplied test and quality checks pass, so the change is ready to merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description clearly explains the change, motivation, implementation approach, scope, and verification results. However, it omits the required Linked Issue section and link, and it does not provide the required visual proof or an explicit N/A explanation for this UI behavior change. Several template sections and checklist confirmations are also missing. Resolution Add the required Linked Issue section with an issue reference. Add before-and-after screenshots or a video, or write N/A with a reason if visual proof is not applicable. Complete the Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections as applicable.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Stacked on #19311, which adds the background-task channel this reads. The bridge maps agent-kind background tasks into AgentStatusEntry.subagents, and the renderer status feed confirms per connection so a reconnect cannot leave a child asserting live from a stream that ended.
548e9b3 to
c5bdacc
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Widened the done-timestamp exemption —
lastEnteredDoneAtnow returns null for every non-donesubagent row, so anunverifiablechild falls through to started-at instead of reporting a synthetic completion (addresses the prior review). - Preserved per-task
unverifiableverdicts —subagentStateFromTaskmaps unverifiable background tasks to anunverifiablesubagent state (previously collapsed toidle), andbuildSubagentChildRowsrenders it independently of connection observation. - Kept the pop-out wire vocabulary safe —
patchDashboardSnapshotFromAgentStatusnow projects subagentdotStatethroughdashboardCardDotState, mappingunverifiable→idleexactly asgroupSubagentsByParentPaneKeydoes. - Widened the subagent-state vocabulary —
AgentSubagentStateandnormalizeSubagentSnapshotadmitunverifiable, with a regression test at each touched site.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
CLEAN after adversarial review and fix/re-review loops. The underlying omission was the renderer projection: the host already owned and published native-chat Validation passed: 199 targeted tests in the final review pass, Remaining scope note: I did not expand the pre-existing delivery gap for an already-open dashboard pop-out; this PR’s left-sidebar path works end to end, while pop-out delivery belongs in a separate change. Electron evidence covered macOS/dark theme and the working-child state; normal child completion plus waiting, blocked, and unverifiable UI states remain unit-tested rather than manually exercised here. |


What this does, in one line
Native-chat subagents now appear in the left worktree sidebar exactly the way CLI agent subagents already do — as indented child rows under their session row.
Why it needs a PR at all
The sidebar has always drawn indented subagent rows. Spawn a subagent from a CLI agent session and you get one today: the agent reports its children through agent hooks into
AgentStatusEntry.subagents, andbuildSubagentChildRows()renders them.Native-chat sessions produced nothing there. A Claude chat that fans out to three subagents showed a single flat session row with no children, because nothing was writing that field for structured sessions.
The approach: feed the existing architecture, don't build a second one
This adds no new sidebar concept, no parallel row type, and no second rendering path. It writes into the same field the hook path already uses:
AgentStatusEntry.subagentsis documented inshared/agent-status-types.tsas "Live in-process subagents/teammates of this pane's session … the sidebar derives indented child rows from it." Structured sessions simply become a second producer for it.So the rows a native-chat fan-out draws are the same rows, from the same builder, styled identically to the ones a CLI agent's subagents draw. Nothing downstream can tell the two producers apart, which is the point.
Kinds stay distinct on the way in — a backgrounded shell is not a subagent, so only agent-kind tasks map across.
Scope
Sidebar only. The chat strip is #19311 and #19705, both merged. Three surfaces now, one shared carrier each: in-chat transcript rows, the strip above the composer, and the sidebar.
Children carry an observation: the renderer status feed confirms sessions per connection, so after a stream ends and reconnects a child cannot keep asserting
livefrom a stream that is gone. It readsunverifiableuntil the new connection reconfirms it. Loss of contact is never exit — no synonyms, perdocs/reference/ssh-execution-boundary.md.Files
StructuredAgentSessionStatusBridge.tsx/.test.tsx— the mapping and its two testsruntime/structured-agent-session-status-feed.ts/.test.ts— per-connection confirmation (getSessionObservation)sidebar/worktree-subagent-child-rows.ts— the existing shared row builder; the only change is that row state honours the observation, so it stays one builder for both producers rather than branching on where a subagent came fromstore/slices/agent-status-contract.ts,store/slices/agent-status-live-entry-builder.ts,shared/agent-status-types.ts—subagentObservationplumbingVerification
Renderer + shared surface: 1638 files passed / 1644, 16220 tests passed / 117 skipped. Typecheck,
audit:code-quality:native,audit:code-quality:type-aware,check:max-lines-ratchet,check-react-doctor-changed.mjsandcheck-changed-code-quality.mjsall clean (0 new findings across 34 changed files).