Skip to content

feat(ui): show when a chat is waiting on subagents - #164190

Merged
steipete merged 3 commits into
mainfrom
steipete/why-did-this-stop-111cb3
Oct 3, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/why-did-this-stop-111cb3

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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_yield tool 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.

Live: waiting on subagents (dark)
Live: waiting on subagents (light)
Live: resumed (dark)

Mocked-Gateway e2e (ui/src/e2e/chat-subagent-waiting.e2e.test.ts), before (origin/main) vs after:

Before: yielded turn shows nothing alive
After: waiting row and hand-off marker
After: mobile width

Tests, each run with pnpm test <file> --maxWorkers=1:

  • ui/src/pages/chat/chat-sessions-yield.test.ts: 15 passed, 5.98 s
  • ui/src/pages/chat/chat-subagent-wait.test.ts: 10 passed, 4.74 s
  • ui/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).
  • Full pnpm test ui/src/pages/chat suite (420 + 39 + 24 files) and ui/src/e2e/chat-run-lifecycle.e2e.test.ts (16) passed. node scripts/check-changed.mjs --base origin/main passed, 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_spawn call that passes prompt instead of task fails with internal_error at failurePhase: bridge, not a clear input error.

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

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 3, 2026
@steipete
steipete marked this pull request as ready for review October 3, 2026 08:45
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 5:27 AM ET / 09:27 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: bf95088b13eb45e360704d95b806d6e591827073

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused implementation with convincing live visual proof and the previous regression blocker resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.
Evidence reviewed 9 items Pinned introduction: Reviewed the merge-base-to-head introduced delta. The supplied test merge is stale, so it was not used to infer removal of current-main behavior.
Previous finding resolved: The latest commit separates the parent's working indicator from subagent waiting in both recovery variants. The captured body reports six focused cases passing; tests were not executed during this read-only review.
Gateway-owned activity: Waiting is gated by the selected session's authoritative descendant activity and absence of parent work. Child navigation uses already-loaded direct-child rows; no RPC, subscription, persisted setting, or migration is introduced.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +313, Tests +669, Docs +8. Total +990 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 14 329 16 +313
Tests 4 672 3 +669
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 1009 19 +990

Review metrics

Metric Value Why it matters
Production versus regression coverage production +313 net; tests +669 net The stated production growth supplies display projection and status presentation, with separate coverage for privacy, activity selection, and browser lifecycle.

Technical review

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This improves a bounded chat workflow where delegated work otherwise appears to have stopped.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected live captures from the branch-built Gateway show the changed chat projection displaying a yielded parent’s waiting status and child link, then removing that status and showing Resumed after child completion. Baseline visual proof is also present; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head introduced delta. The supplied test merge is stale, so it was not used to infer removal of current-main behavior. (bf95088b13eb)
  • Previous finding resolved: The latest commit separates the parent's working indicator from subagent waiting in both recovery variants. The captured body reports six focused cases passing; tests were not executed during this read-only review. (ui/src/pages/chat/chat-pane-run-activity.test.ts:86, bf95088b13eb)
  • Gateway-owned activity: Waiting is gated by the selected session's authoritative descendant activity and absence of parent work. Child navigation uses already-loaded direct-child rows; no RPC, subscription, persisted setting, or migration is introduced. (ui/src/pages/chat/chat-subagent-wait.ts:23, bf95088b13eb)
  • Transcript privacy and implementation boundary: The projection reuses OpenClaw's tool-card pairing and transcript display owners, removes yield inputs from display copies, and leaves ordinary items unchanged. Direct and nested calls, pending and failed yields, and preserved source bytes have focused coverage. This path has no affirmative dependency on the Codex harness contract. (ui/src/pages/chat/chat-sessions-yield.ts:81, bf95088b13eb)
  • Inspected real behavior proof: Inspected prepared images 1–3 from the captured PR body: dark and light live captures show the waiting status, Backend lane link, and elapsed time; the resumed capture shows parent output, a Resumed marker, and no waiting row. Image 4 shows the baseline without a waiting explanation. The captured body identifies a branch-built local Gateway and real-model child/yield/resume scenario; sourceRevision is 890fca5dffed38313d10079c10c303f745f5bd0e395eeeec3052490e95eb4eb3. (bf95088b13eb)
  • Still necessary on main: Current-main transcript projection contains no subagent waiting row. Existing descendant activity serves sidebar and abort behavior, rather than the new transcript presentation. No merged fixing PR was established. (ui/src/pages/chat/components/chat-transcript-projection.ts:536, cec6d9dffe58)

Likely related people:

  • Peter Steinberger: Raw commit 8bb7fb2 adds ui/src/pages/chat/components/chat-transcript-projection.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8bb7fb2f0fb3; files: ui/src/pages/chat/components/chat-transcript-projection.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-03T08:51:26.992Z sha a512efb :: needs changes before merge. :: [P2] Update the idle-parent regression for the new waiting indicator

The completed-parent case now shows the waiting-on-subagents row once history loads, while the parent's own working indicator stays absent.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
@steipete
steipete merged commit 690c6f0 into main Oct 3, 2026
100 of 102 checks passed
@steipete
steipete deleted the steipete/why-did-this-stop-111cb3 branch October 3, 2026 09:34
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
* 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.
shakkernerd added a commit that referenced this pull request Oct 6, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant