Repository navigation
feat(ui): show when a chat is waiting on subagents - #164190
Conversation
Keep the working indicator visible when the selected session reports active subagents after its own turn ends. Reuse the live session-row projection, already-loaded child labels, and confirmed yield timestamps without new reads. Show quiet handoff and resumed markers for direct and nested sessions_yield calls. Keep private continuation inputs out of pending, failed, and confirmed yield presentation while preserving unsuccessful results and transcript bytes. Validate with focused unit and sibling tests, a mocked Gateway yield/resume flow, inspected light/dark/mobile before-and-after captures, scoped checks, and independent review.
Restrict yield projection rewrites and hidden-tool suppression to messages containing a sessions_yield card. Leave ordinary message identities and hidden-tool handling with the existing rendering path. Cover text, tool calls, and standalone results with identity assertions for both disclosure settings.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 5:27 AM ET / 09:27 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Control UI adds a subagent waiting indicator, navigation to a sole active child, and transcript markers for handoff and resumption. Merge readiness✅ Ready for maintainer review The previous regression finding is resolved, and the inspected live proof supports the intended behavior. No remaining actionable correctness or security finding was identified; current main still lacks this presentation. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives session activity and transcript messages from the Gateway. It projects those facts into chat status, tool activity, and navigation without changing agent execution. flowchart TD
A[Gateway session activity] --> C[Chat presentation]
B[Delivered transcript] --> C
C --> D{Parent working or waiting}
D --> E[Working or subagent status]
B --> F[Handoff and resume markers]
E --> G[Open active child]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +313, Tests +669, Docs +8. Total +990 across 19 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep waiting status derived from Gateway activity and handoff markers derived from display-only transcript projection. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature reproduction gate; inspected baseline and live after-change captures establish the presentation gap and resulting waiting/resume states. Is this the best way to solve the issue? Yes. Reusing authoritative activity and existing transcript pairing is a focused approach that avoids another lifecycle owner or refresh mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cec6d9dffe58. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
The completed-parent case now shows the waiting-on-subagents row once history loads, while the parent's own working indicator stays absent.
|
Merged via squash.
|
* feat(ui): show when a chat is waiting on subagents Keep the working indicator visible when the selected session reports active subagents after its own turn ends. Reuse the live session-row projection, already-loaded child labels, and confirmed yield timestamps without new reads. Show quiet handoff and resumed markers for direct and nested sessions_yield calls. Keep private continuation inputs out of pending, failed, and confirmed yield presentation while preserving unsuccessful results and transcript bytes. Validate with focused unit and sibling tests, a mocked Gateway yield/resume flow, inspected light/dark/mobile before-and-after captures, scoped checks, and independent review. * fix(ui): preserve non-yield transcript item identity Restrict yield projection rewrites and hidden-tool suppression to messages containing a sessions_yield card. Leave ordinary message identities and hidden-tool handling with the existing rendering path. Cover text, tool calls, and standalone results with identity assertions for both disclosure settings. * test(ui): assert idle parent waits on subagents instead of working The completed-parent case now shows the waiting-on-subagents row once history loads, while the parent's own working indicator stays absent.
…5378) The Control UI chat now shows a subagent wait inside the reply that handed off. The working indicator stays where the agent was working and reads "Waiting on 3 subagents", counting down to the last subagent's name, which opens its session. The "Handed off and waiting" and "Resumed" markers are gone. Only subagents are counted and named; other child sessions read as a plain count. Refs #164190.
…nclaw#165378) The Control UI chat now shows a subagent wait inside the reply that handed off. The working indicator stays where the agent was working and reads "Waiting on 3 subagents", counting down to the last subagent's name, which opens its session. The "Handed off and waiting" and "Resumed" markers are gone. Only subagents are counted and named; other child sessions read as a plain count. Refs openclaw#164190.
What Problem This Solves
Fixes: a chat looks like it silently stopped when the agent hands work to a subagent and waits for it with
sessions_yield.User Impact
User impact: while a session waits on its subagents, the chat now shows a live "Waiting on subagents" row (with the child's name as a link when exactly one child is running, plus elapsed time since the hand-off), and the transcript shows a quiet "Handed off and waiting" marker that turns into "Resumed" once the agent continues. Previously the working indicator disappeared while the stop button stayed red, and nothing explained the pause. We saw this on the Team server: a parent yielded for about a minute while its backend child worked, and it looked dead.
Why This Change Was Made
A yielded run ends the parent's own turn, so the chat cleared its working indicator even though work was still happening in a child session. The waiting row is gated on the selected session's server-computed
hasActiveSubagentRun(the same signal the iOS, Android, and OpenClawKit UIs already use) and reuses the live session-row projection. It adds no RPCs, subscriptions, polling, or timers. The child link appears only when the already-loaded child rows show exactly one running child.The yield marker is projected from the
sessions_yieldtool call and result that history already delivers, including nested code-mode calls. It honors the #139801 privacy contract: the yield's private continuation message is never shown, even while pending or after a failure. Persisted transcript bytes, model-facing context, and Gateway run lifecycle are unchanged. Non-yield transcript items keep their object identity, so row memoization is unaffected.Evidence
Live, real model (local Gateway built from this branch, Claude Sonnet 5): the parent spawned a "Backend lane" subagent that ran
sleep 60, then yielded. The waiting row appeared about 20 s in, the parent resumed at about 75 s, the waiting row disappeared, and the marker flipped to "Resumed". Captures are cropped to the transcript.Mocked-Gateway e2e (
ui/src/e2e/chat-subagent-waiting.e2e.test.ts), before (origin/main) vs after:Tests, each run with
pnpm test <file> --maxWorkers=1:ui/src/pages/chat/chat-sessions-yield.test.ts: 15 passed, 5.98 sui/src/pages/chat/chat-subagent-wait.test.ts: 10 passed, 4.74 sui/src/e2e/chat-subagent-waiting.e2e.test.ts: 1 passed, 30.4 s (about 11 s of that is the UI build; the browser flow is 6.4 s)ui/src/pages/chat/chat-pane-run-activity.test.ts: 6 passed, 5 s. The existing idle-parent regression now asserts two things: the parent's own working indicator stays absent, and the waiting-on-subagents row is present once history has loaded (ClawSweeper P2).pnpm test ui/src/pages/chatsuite (420 + 39 + 24 files) andui/src/e2e/chat-run-lifecycle.e2e.test.ts(16) passed.node scripts/check-changed.mjs --base origin/mainpassed, the i18n baseline needed no changes, and autoreview is scoped-clean.Follow-up noticed during live testing (not in this PR): a code-mode
sessions_spawncall that passespromptinstead oftaskfails withinternal_erroratfailurePhase: bridge, not a clear input error.