Skip to content

improve: show the subagent wait in place without handoff markers - #165378

Merged
shakkernerd merged 4 commits into
mainfrom
subagent-wait-row
Oct 6, 2026
Merged

shakkernerd merged 4 commits into
mainfrom
subagent-wait-row

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #164190

What Problem This Solves

When an agent delegates work to subagents and then hands off to wait for them, the Control UI chat breaks its reply apart. A centered "Handed off and waiting" marker appears under the reply with a large gap around it, the working claw leaves the reply and reappears as a separate boxed row at the far left, and that row says "Waiting on subagents" without saying how many, adding a name only when exactly one loaded child is running. Its timer counts from the transcript row that carried the handoff call instead of from the handoff, so it can already read several seconds when it appears. When the agent comes back, the marker changes to "Resumed" and stays in the transcript between the two halves of the answer.

The marker works like a divider: one request reads as stacked pieces, and it describes the agent's internal run boundary, which the person reading the chat did not ask about. What that person wants to know during the wait is simpler: the agent is still on it, and how many subagents are left.

User Impact

The wait now stays where the agent was already working. The claw does not move, no marker is drawn, and the line under the reply reads "Waiting on 3 subagents", then "Waiting on 2 subagents", and names the last one once only one is left ("Waiting on Write a six-line robot story"). The name still opens that subagent's session, as before; it is underlined on hover and keyboard focus instead of permanently. The timer starts at the handoff.

A number or a name is shown only once the chat's own list of that session's subagents has loaded. Until then, and when that list is not loaded at all, the line reads "Waiting on subagents" as it does today. A subagent that has itself handed off to its own subagents counts as unfinished.

The number keeps up with the launches. When the session reports a child that the chat's list does not hold yet, the chat reads that list again straight away instead of waiting for its next paced refresh, which could leave the line without a number for several seconds.

Only subagents are counted and named. A child session that is not a subagent, such as one opened with visible, is not presented as one: once no subagent is left the line reads "Waiting on 2 sessions" or "Waiting on 1 session", with no name and no link.

Once everything the turn waited on has finished, the line goes away until the agent resumes; it no longer falls back to "Waiting on subagents" for that moment. Tool rows and operation groups you opened before the handoff stay open through it.

When the agent resumes, its answer follows below with the normal working indicator and no "Resumed" marker. Once the turn settles the transcript keeps the same shape it has today, minus the marker and its gap: the handed-off reply keeps its own text and operations, and the resumed reply keeps its own "Worked for" summary and "Done in" line.

When a turn ends without a handoff while subagents are still running, the wait line still follows the finished reply, now with the bare claw and the same wording, and the reply keeps its "Done in" line.

Preserved behavior: the sessions_yield call stays out of tool details, and the private continuation message that wakes the agent is still never shown, including with tool calls hidden. Search results still omit the live wait line. Nothing changes for sessions without subagents.

This PR covers the handoff and the wait only. Two related gaps are left to the next PRs in this stack: the answer after a wait still starts a second assistant block, and the working line does not yet count subagents while the agent itself is still working.

Why This Change Was Made

#164190 introduced the wait row and the markers. The wait was appended as its own transcript row after all chat items, so it could never sit inside the reply it belonged to, and the marker between the reply and that row closed the reply's run frame. The claw jumping was a consequence of that structure rather than of styling.

The wait is the handed-off run's own status. When loaded history holds a confirmed handoff that nothing has resumed, buildChatItems appends the wait as the same kind of item the working indicator uses, carrying the handed-off run's id. The existing run-frame grouping then places it inside that reply with the bare claw. A wait that no loaded handoff can place, such as a turn that simply ended while subagents were still running, keeps its place as a row after the transcript; it is rendered through the standard working row so it loses the box.

The marker's structural job is kept without drawing anything. The marker was also what kept a resumed run apart from the run that handed off: without an item there, the completed-turn summary folds the handed-off reply and its operations under the resumed run's "Worked for" header, and adjacent operations from both runs pool into one row that belongs to neither reply. The handoff projection therefore still emits a boundary for a resumed handoff, now flagged as structural, and the transcript chain drops it before rows are built. A pending handoff emits nothing, which is what lets the wait join the reply.

The projection reports what the wait needs. It keeps hiding the sessions_yield call and the continuation message, and reports the latest handoff nothing has resumed yet (timestamp and run id). The wait resolver starts the timer at the parent run's recorded end when that is at or after the handoff's transcript row.

The count comes from rows the pane already holds. No Gateway change is involved. The resolver counts direct children whose own run is active or that are waiting on their own descendants. It does so only after the pane's subagent roster has answered its own child query, which the roster now reports as hydrated. Before that the roster holds rows seeded from the sidebar list, which can be a partial set and would otherwise name the wrong last subagent.

The single-subagent wording is one translatable sentence, "Waiting on {name}", with the placeholder rendered as the link so translations can place the name where their grammar needs it. A translation that omits the placeholder still gets the name at its end.

Corrections from a live run. The third commit fixes what driving real agent runs through this head showed, and the fourth tightens it after review. The scripted harness had not shown any of it, because it never replaces live rows with stored ones and delivers its roster in one step.

  • Opened rows closed at the handoff. A handoff makes the pane reload history, and the stored messages that replace the live tool rows carry different message keys, so every disclosure the reader had opened started over closed. Disclosure ids stay scoped to their message, which an existing test requires for call ids reused across messages. The open state is carried across by tool call instead: when a call had exactly one disclosure before the reload and has exactly one after it, the reader's choice moves with it.
  • The number arrived late. The roster learned of a new child from its paced list refresh, four to five seconds apart. The parent's own row names its children sooner, so when it names one the roster does not hold, the roster now refreshes its child list at once. It asks once for each named child, so one the list never returns, such as an archived child the parent still names, cannot hide the number again or keep the list re-reading. Review caught the first version doing exactly that: it compared the missing children as one joined string, which read the list twice per launch for such a parent.
  • A handed-off run's leftover live rows drove the next status. Until the reload lands, the pane still holds the previous run's live tool rows, and the working status that followed the handoff borrowed their run id and start time. That showed a stale clock for the first seconds after a resume and kept the earlier operations row drawn as live. Rows that belong to the run whose handoff is pending are now left out while the pane has no run of its own.
  • "Waiting on subagents" flashed after the last subagent finished. With the list loaded and nothing unfinished in it there is nothing to wait on, so the resolver returns no wait instead of its unnumbered fallback.
  • A child session opened with visible was named and counted as a subagent. A visible launch opens a persistent dashboard session, so the resolver now treats a child with a dashboard session key as a session in its own right and reports it as a bare count, used only when no subagent is left. Every other child is a subagent as before. The first version of this fix required a subagent key instead, which the full browser suite caught: it left the existing wait test's child, and any child on the ACP runtime, without its name.

Removed with the visible marker: its rendering branch, stylesheet rule, the hourglass icon only it used, and the two marker strings. The chat documentation describes the new behavior.

Evidence

The captures come from the repository's mocked Control UI browser harness, driven by one scripted flow on main and on this head. The flow follows the shape a real dashboard session records: prose, an exec step with three nested sessions_spawn calls, a sessions_yield with no prose of its own, then a resumed run that answers and settles. A second flow ends the agent's turn without a handoff while one subagent keeps running. Gateway events are invisible in a recording, so an on-screen cue names each one.

The first two rows show the wait moving into the reply and counting down to a name. The third shows that a settled turn keeps the same content as main with no marker between the replies. The fourth shows the turn that ended without a handoff keeping its "Done in" line while the wait follows it.

Visual evidence

View Before After
Handoff, three subagents running Reply under a Worked header, a centered Handed off and waiting marker, and a separate boxed claw row reading Waiting on subagents Reply, its operations row, and the claw directly under them reading Waiting on 3 subagents, with no marker
One subagent left Marker still shown; boxed claw row reads Waiting on subagents followed by the underlined subagent name Claw under the reply reads Waiting on Write a six-line robot story
Turn settled Handed-off reply with its operations, a centered Resumed marker, then the answer with Done in 3 seconds Handed-off reply with its operations, then the answer with Done in 3 seconds, and no marker between them
Turn ended without a handoff, subagent still running Finished reply with Done in 9 seconds, followed by a boxed claw row reading Waiting on subagents and an underlined name Finished reply with Done in 9 seconds, followed by a bare claw reading Waiting on Write a six-line robot story

Same scripted handoff on main (left) and on this head (right)

unit1-handoff-side-by-side.mp4

Visual verification

  • Baseline: origin/main@c1005a2ee593917f0c382ded20f8fbb6dfea7a41
  • Exact head: c6949cb445befb2e0032bb589bf36ecbaf0594cc
  • Runtime: Control UI mocked E2E harness (bundled build of the tested checkout), Chromium, dark theme, 1280x800
  • Marker rows (.chat-notice): one on main while waiting and after resume; none on this head
  • Wait indicator after a handoff: a separate transcript row on main; inside the handed-off reply's assistant group on this head
  • Wait wording: "Waiting on 3 subagents", "Waiting on 2 subagents", then "Waiting on" followed by the last subagent's name
  • Settled transcript: the same two replies, operations row and "Done in" line as main, without the marker
  • Before and after use the same recorder, viewport, theme and fixture; the per-side recordings are kept beside the composed comparison

Tests

  • chat-sessions-yield.test.ts: the handoff call and its private arguments never reach the transcript, with tool calls shown or hidden; a pending handoff leaves no row and reports its run; a resumed handoff leaves exactly one structural boundary with nothing to display.
  • chat-transcript-message-index.test.ts: on a dashboard session, the wait sits inside the handed-off run's frame; once settled, no notice is rendered, the two runs keep separate frames, the handed-off reply stays visible, and the completed-work summary holds only the resumed run.
  • chat-subagent-wait.test.ts: when the chat is waiting at all, which children count (direct, running, or waiting on their own subagents), no count or name before the roster has loaded, where the timer starts, and the rendered wording and link. No wait once every loaded child has finished. Child sessions that are not subagents are counted without a name, only when no subagent is left, and render as "Waiting on 2 sessions" and "Waiting on 1 session"; a child on the ACP runtime is named like any subagent.
  • swarm-roster.test.ts: the roster reports hydration only after its own child query fills it, tells the page, and clears on reset. When the parent names a child the roster does not hold, it reads the child list at once and reports hydration again only when that read answers. A named child the list never returns is asked for once: a later launch then costs one read, not two.
  • chat-thread.test.ts: a row and a group the reader opened stay open when stored rows with new message keys replace the live ones, and nothing is carried between two messages that reuse one call id. A handed-off run's leftover live rows do not give the next status their run or start time.
  • chat-subagent-waiting.e2e.test.ts: in the browser, the wait renders inside the reply's assistant group with the child's name as a working link, no marker rows exist while waiting or after resume, and the resumed run takes the indicator back.

Cost on one worker (pnpm test <files> --maxWorkers=1): the five unit files together take 3 to 6 s wall for 100 tests across two runs. The changed browser test takes 14.4 to 14.9 s alone. In CI on the first commit, the nine browser shards took 253 to 284 s each and the three unit shards 284 to 400 s each as whole jobs; CI does not report per-file time. The three unit files the fix commits touch (swarm-roster.test.ts, chat-subagent-wait.test.ts and the new chat-thread-handoff.test.ts) take 6.1 s wall for 51 tests on one worker.

Validation

Head c6949cb445b (tree c495c02831fa), rebased onto main at c1005a2ee59. The rebase changed no code in this PR's four commits: git range-diff against the previous head (886d8ee3246) shows only moved diff context. Every row ran on this exact tree, on a 128-core Linux server (Ubuntu 26.04, Node 26.8.2). The rows ran side by side in five separate checkouts of the tree, one per lane, so that no two lanes shared build or cache directories.

Check Result
Static stage, 36 of 37 selected checks (format, lint, boundaries, docs, dead code, import cycles) pass
Static stage, the remaining check, deadcode:unused-files fails on the base commit itself (below)
Line-cap and max-lines ratchets with hosted-runner leniency off pass
Type graphs (core tests, ui, extension tests, scripts, test root) pass
Node test rows, 20 files, 243 passed and 2 skipped pass
Control UI performance check against the base pass
Control UI unit suite on the pinned Bun runtime, 3 shards, 1,639 files, 22,690 passed and 6 skipped pass
Mocked-browser suite, 8 shards, 387 files, 1,788 tests pass after shard 4 was rerun (below)

The failing static check is inherited. deadcode:unused-files reports src/infra/open-file-descriptors.test-support.ts. Nothing references that file at c1005a2ee59, the commit this stack is rebased onto, and this stack touches neither it nor anything else under src/infra. main removed the file afterwards in bedc8ae077c. The failure stopped the stage before its last two checks, the architecture check and the additional boundary checks, so I ran those two on their own on the same tree; both pass.

One browser shard failed on its first run and passed when rerun in the same checkout: in shard 4 of 8, agent-switch-roster.e2e.test.ts, "shows selected rows before history and restores warm rows before the replacement list", timed out loading its page (page.goto: Timeout 30000ms exceeded). The lanes of all four heads in this stack were starting on the server at that time, with its one-minute load between 160 and 300 on 128 CPUs. The test renders the session list, not the transcript. A passing rerun is not a fix: the failure is recorded here, not explained.

Live runs. With a real agent in a local preview, on the code at the top of this stack after the rebase. In one run the agent handed off with one subagent still running: the line under its reply read "Waiting on Logic puzzle", it went away when that subagent finished nine seconds later, the resumed run's working line appeared 0.3 seconds after that, and the settled transcript holds no marker. In three other runs on the rebased code the subagents had finished before the agent handed off, so nothing was left to wait on: no wait line appeared and the "Waiting on subagents" fallback did not flash. The countdown from three was last seen live before the rebase, where the line read "Waiting on 3 subagents", then 2, then the last subagent's name, and the operations group and the row opened before the handoff were still open after it. The neutral wording for child sessions was seen live once, on an earlier candidate, where two sessions launched with visible read "Waiting on 2 sessions" and then "Waiting on 1 session"; the preview's Gateway has refused visible launches since.

This PR was validated before on a macOS arm64 worker and, before the rebase, on this server against main at dfd37e81d56; those records are in this description's edit history. Two notes from them still apply. The second commit moves the wait's placement and render key from chat-transcript-projection.ts to chat-subagent-wait.ts, with no behavior change. It was written because the first commit left that file over its 700-line cap on the base it was first published on, which hosted runners report as an annotation with a passing status; on the current base the file is at exactly 700 counted lines after the first commit and 686 after the second. The same ratchet is why the fourth commit keeps the new handoff tests in chat-thread-handoff.test.ts: chat-thread.test.ts is already past its cap and may not grow.

Hosted CI on this head. The run stops at security-fast: its production dependency audit reports a high-severity advisory published against source-map-js (GHSA-68fv-2mgg-jv7q), and the fail-fast step then cancels the remaining jobs. This stack changes no dependency, main fails the same job on its current commits, and #165902 is open to pin the fixed version. I have not rerun CI.

@clawsweeper

clawsweeper Bot commented Oct 5, 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: L labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 10:52 PM ET / October 6, 2026, 02:52 UTC (Revision 6).

ClawSweeper review

What this changes

The Control UI keeps subagent waiting status beneath the delegated reply, shows remaining counts or the last child’s name, preserves opened tool details, and removes visible handoff markers.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main retains the older handoff markers and separate waiting row. No actionable introduced defect was found, and the inspected visual evidence supports the intended improvement.

Priority: P2
Reviewed head: c6949cb445befb2e0032bb589bf36ecbaf0594cc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable enhancement with strong visual evidence and relevant regression coverage; no concrete correctness blocker was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Chromium captures exercise the production transcript renderer with scripted Gateway handoff, child-count, resume, and no-handoff scenarios. They directly show the changed layout and wording; the matching full body additionally records real-agent stack observations. No stored-data contract changes require upgrade proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after Chromium captures exercise the production transcript renderer with scripted Gateway handoff, child-count, resume, and no-handoff scenarios. They directly show the changed layout and wording; the matching full body additionally records real-agent stack observations. No stored-data contract changes require upgrade proof.
Evidence reviewed 8 items Pinned introduction and merge result: Reviewed the merge-base-to-head changes. The raw test-merge commit records the pinned base followed by the exact PR head; its relevant result preserves the introduced waiting and roster changes.
Current main still differs: Current main still derives an optional single-child name without the new hydrated count and projects visible waiting/resumed markers. The requested presentation is therefore still missing.
Existing feature provenance: GitHub confirms #164190 merged as this commit. The waiting resolver exists in that commit and is absent from its raw recorded parent; nearby history also connects steipete to roster and transcript maintenance.
Findings None None.
Security None None.

How this fits together

The Control UI turns Gateway session rows and chat history into the visible conversation. Its waiting indicator combines confirmed handoffs with loaded child-session state to explain ongoing delegated work.

flowchart TD
  A[Gateway session rows] --> C[Child roster]
  B[Chat history] --> D[Handoff projection]
  C --> E[Resolve waiting status]
  D --> E
  E --> F[Reply grouping]
  F --> G[Chat transcript and wait line]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +235, Tests +461, Docs +5. Total +701 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 18 381 146 +235
Tests 6 531 70 +461
Docs 1 12 7 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 924 223 +701

Review metrics

Metric Value Why it matters
Production and test growth production net +240 lines; tests net +461 lines The body explains the growth through wait placement, complete-roster counting, disclosure preservation, and focused regressions.

Technical review

Best possible solution:

Keep waiting presentation within the existing reply and roster owners while preserving private continuation filtering and separate resumed-run accounting.

Do we have a high-confidence way to reproduce the issue?

Not applicable as an enhancement; current-main source and inspected baseline captures establish the existing marker and separate-wait presentation.

Is this the best way to solve the issue?

Yes. The patch reuses existing reply grouping and session-list ownership rather than adding competing state or Gateway behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 30b5c8e47ffe.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded improvement to delegated-work status and transcript continuity.
  • 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 before/after Chromium captures exercise the production transcript renderer with scripted Gateway handoff, child-count, resume, and no-handoff scenarios. They directly show the changed layout and wording; the matching full body additionally records real-agent stack observations. No stored-data contract changes require upgrade proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after Chromium captures exercise the production transcript renderer with scripted Gateway handoff, child-count, resume, and no-handoff scenarios. They directly show the changed layout and wording; the matching full body additionally records real-agent stack observations. No stored-data contract changes require upgrade proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Chromium captures exercise the production transcript renderer with scripted Gateway handoff, child-count, resume, and no-handoff scenarios. They directly show the changed layout and wording; the matching full body additionally records real-agent stack observations. No stored-data contract changes require upgrade proof.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-10-05T06:23:31.618Z sha b24f964 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T07:48:48.031Z sha ab1e6d6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T23:01:41.554Z sha 886d8ee :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T23:10:01.498Z sha 886d8ee :: needs maintainer review before merge. :: none
  • reviewed 2026-10-06T02:12:00.983Z sha c6949cb :: needs maintainer review before merge. :: none

After a sessions_yield handoff the chat drew a "Handed off and waiting"
marker, moved the working claw into a separate boxed row that said only
"Waiting on subagents", and changed the marker to "Resumed" when the
parent came back.

The wait is now the handed-off run's own live status. It stays inside
that reply, counts the unfinished subagents once the pane's subagent
roster has loaded, names the last one, and times from the handoff. A wait that no loaded
handoff can place still follows the finished reply, without the box.

The marker also kept a resumed run apart from the run that handed off.
That boundary stays as a structural item that is never rendered, so a
settled transcript keeps its shape. The yield projection still hides the
call and the private continuation message.
The previous commit left the transcript projection at 708 counted lines,
over the 700-line cap. The wait's placement and render key move to
chat-subagent-wait.ts and the unplaced wait row to chat-message-stream.ts,
which brings the projection to 694. Behavior is unchanged.
Live runs showed what the mocked captures did not:

- A launched subagent reached the wait line and the roster only on the
  child query's paced re-read, about five seconds late. The roster now
  reads the query as soon as the parent row names a child it does not
  hold, and reports itself incomplete until that read answers.
- A handoff swaps live tool rows for their stored copies under other
  message keys, which closed everything the reader had opened. Opened
  rows and groups are carried across by tool call where one disclosure
  names that call on each side.
- The handed-off run's leftover live rows lent the next working status
  their run and their clock, so the resumed claw counted from the old
  run's first tool call and its last group read as live again.
- The line said "Waiting on subagents" for a moment once every child had
  finished. It now goes away until the agent resumes.
- Child sessions that are not subagents were counted and named as
  subagents. They are counted on their own, without names, once no
  subagent is left: "Waiting on 2 sessions".
Review of the previous commit found the roster could re-read more than it
needed to. It compared the missing children as one joined string, so a
child the list never returns, such as an archived one the parent still
names, made every launch read the list twice and hide the count for two
round trips, and cost one extra read on every pane open.

The roster now remembers each named child it has asked for and reads again
only for one it has neither received nor requested. It also waits for the
first read to answer before asking for more, and leaves queueing a second
read behind one in flight to the session list, which already does it.

The previous commit also told subagents apart by requiring a subagent
session key, which left every other child, including one on the ACP
runtime, without its name. Only a dashboard session, which is what a
`visible` launch opens, is a session in its own right; every other child
is a subagent as before.

The handoff tests the previous commit added to chat-thread.test.ts move to
a file of their own: that file is already past its line cap, and the
ratchet rejects growing it.
@shakkernerd shakkernerd self-assigned this Oct 6, 2026
@shakkernerd
shakkernerd merged commit 59fc07d into main Oct 6, 2026
65 of 95 checks passed
@shakkernerd
shakkernerd deleted the subagent-wait-row branch October 6, 2026 04:40
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Improved: the Control UI chat now shows a subagent wait in place under the reply that handed off, with a count or the last subagent's name, and no handoff markers.

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