Skip to content

feat: open the Subagents panel from the chat's subagent count and names - #166142

Merged
shakkernerd merged 1 commit into
mainfrom
subagents-panel-from-line
Oct 6, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
subagents-panel-from-line

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #165378, #165477, #165725

What Problem This Solves

While an agent's subagents run, the Control UI chat mentions them in three places: the working line under the agent's message ("3 subagents running"), the same line after the agent hands off ("Waiting on 3 subagents", then "Waiting on Audit the permissions" once one is left), and one launch row per subagent inside the tool activity. None of them is a good way to the subagents themselves:

  • The counts are plain text. To see which subagents are running you open the side panel and pick Subagents from its + menu, or use the pane header's panels menu.
  • A name takes you away. Selecting the name, on the waiting line or on a launch row, navigates the pane to that subagent's own view-only session. The conversation you were watching, which is still running, leaves the screen, and coming back takes Open parent session.
  • The Subagents panel already does this job better. It shows a subagent's transcript beside the conversation, with Stop and a way back to the list. Nothing in the transcript leads to it.
  • A narrow pane has no good place for that panel. On a phone, or in a narrow split, a side panel can only stack under the conversation, which leaves a list-and-transcript panel and the conversation half the height each.

User Impact

The count opens the list. "3 subagents running" and "Waiting on 3 subagents" are now controls. Selecting one opens the Subagents panel on its list, or returns the panel to its list when it is showing one subagent. The count is a quiet control: one step brighter than the status text around it, dimmer than a subagent's name, underlined when pointed at or focused.

A name opens that subagent in the panel. Selecting the name on the waiting line, or on a launch row, opens the Subagents panel on that subagent: its transcript, Back to Subagents, and Stop while it runs. The conversation stays where it was and keeps updating.

A narrow pane shows the panel in place of the conversation. When a pane is too narrow to show a side panel beside the conversation (the existing 680px point, measured on the pane, so a narrow split on a desktop counts), the Subagents panel is shown in place of the conversation instead of under it. That holds however the panel came to be open there: from the count, a name, the pane header's panels menu, the side panel's + menu, a tab switch, or a pane that was narrowed with the panel already open. Closing the panel returns to the conversation, and a wider pane shows the two side by side again. Nothing about this is saved with the layout. The Processes panel shares this rule; every other side panel behaves as before.

Keyboard focus follows. When a narrow pane puts the panel in the conversation's place, the control that had focus is no longer on screen, so focus moves to the panel's tab. When the panel is closed, focus returns to that control if it is still there.

One fix that this depends on. A subagent's header inside the panel (Back to Subagents, its title, Stop) disappeared whenever the side panel filled the pane, because the rule that hides the pane's own header also matched the header of the transcript inside the panel. That was reachable before through the panel's expand control. The rule now hides only the region's own header.

What stays as it was:

  • Subagents the panel does not list. The Subagents panel does not list a swarm's workers or subagents on the ACP runtime. Such a subagent's name still opens its session, and a count that includes one stays plain text, so a control never leads to a list that is missing what it counted.
  • Panes without a side panel of their own. The transcript shown inside the Subagents panel, a session embedded in Home, and catalog sessions keep opening the subagent's session and keep the count as text.
  • Child sessions. "Waiting on 2 sessions" is plain text, as before.
  • No new strings, no Gateway, protocol or configuration change, and no change to what the Subagents panel lists or shows.

Two things a narrow pane no longer offers: Subagents or Processes stacked under the conversation, and the panel's expand control, which has no split to restore there.

Why This Change Was Made

The pane carries the request to the panel. The panel is loaded lazily, so the transcript cannot call it directly. showSubagents on the pane records what to show (a subagent's key, or the list), opens the panel, and hands the panel a request it takes exactly once, the same way the pane already hands the session companion its focus request. The request is tied to the session that made it, so a panel that finishes loading after the pane moved to another session ignores it.

One rule says what the panel lists. isSubagentsPanelSession now owns that rule. The panel's data uses it to build its list, the status projection uses it to decide whether the line may lead to the panel (listed), and a launch row uses it to choose between the panel and the session. Before, the rule lived inside the panel's data loader, and the working line counted children by a different, wider rule.

The narrow rule is how the pane presents its layout, not a change to the layout. presentNarrowSidebarLayout returns how a narrow pane shows a layout: an open, active Subagents or Processes panel focused in place. The pane applies it once (presentSidebarLayout) and uses the result for everything it shows: the region, which views count as visible, the board, and whether the conversation is on screen. Its controls keep working on the layout as it is saved, so nothing reaches a wider pane or another panel, and every way of reaching the panel gets the same result without each one having to know the rule. An earlier version of this change wrote an expanded state into the layout when the panel was opened in a narrow pane; that state was saved with the session and followed it into wider panes, which is why the rule became presentation.

The component that swaps the views moves focus. The region component is told when a narrow pane holds the side panel in the main view's place. It leaves out its expand control then, moves focus to the active tab when the view it hides held focus, and gives focus back when the panel is closed. That covers every way the swap can begin, including the header's panels menu and a window that narrows.

The counted sentence is one control. Translations put the count in different places ("Oczekiwanie na subagentów: {count}", "{count} 個のサブエージェントを待機中"), so the sentence is not cut around its number: with several subagents left, the whole sentence is the control. The name stays a control of its own inside "Waiting on {name}", as before.

The pane wiring sits in the layout render. chat-pane-render.ts is at the repository's 700-line cap, so the two callbacks are added where the pane composes the chat view, in chat-pane-layout-render.ts.

Evidence

The captures below come from one synthetic session on the repository's mocked-Gateway browser harness, run by the same script on the base commit and on this PR's head. They show the two controls in a wide and a narrow pane. The tests after them prove the behavior on the exact head, and name what is not proven.

Before and after

Open preview

View Before After
Wide pane, after selecting the waited-on subagent's name The pane has navigated to the subagent's own view-only session; the conversation is gone The Subagents panel shows that subagent beside the conversation, with Back to Subagents and Stop
Wide pane, after selecting the running count Nothing happens: 3 subagents running is plain text The Subagents panel opens on its list of three running subagents beside the conversation
Narrow pane, after selecting the waited-on subagent's name The pane has navigated to the subagent's view-only session with an Open parent session notice The Subagents panel takes the conversation's place and shows that subagent with its header
Narrow pane, after selecting the running count Nothing happens: 3 subagents running is plain text The Subagents panel takes the conversation's place and lists the three running subagents

Exact-head recording: the waited-on subagent's name, then Back to Subagents, in the wide pane and then the narrow one

after-name-opens-panel.mp4

Visual verification

  • Baseline: origin/main@2abd325f23b1d04e4b354ee03e017e6d5d91b882
  • Exact head: 9057501f136034f47ec19045ea9e10cadfd9cd89
  • Scenario: One synthetic session with three subagents, on the repository's mocked-Gateway browser harness. In a 1280x800 and a 390x844 viewport: select the waited-on subagent's name, and select the running count. The yellow ring and the label at the bottom mark the input and are not part of the product.
  • Runtime/build: Control UI built from each commit by the mocked-Gateway E2E harness (vitest.ui-e2e.config.ts), headless Playwright Chromium build 1243, Linux x64, dark color scheme
  • Trigger input: One click on the subagent's name, or on the count, at the ringed position
  • Name, before/result: Before: the pane's session changes to the subagent. After: the pane's session is unchanged and the panel shows the subagent
  • Count, before/result: Before: no change. After: the panel lists Running (3)
  • Narrow pane: After: the conversation is hidden while the panel is open and shown again when it is closed
  • Triggering input is marked by a pointer ring and a one-line label
  • Same capture script, fixture, viewport and color scheme on both commits
  • Focused browser test passed on the exact head, and fails on it with either fix removed
  • Original recordings for both commits retained beside the published one

Behavior on the exact head

ui/src/e2e/chat-subagent-waiting.e2e.test.ts drives the real pane, panel and layout through a mocked Gateway. On head 9057501f136 it passes, and it now checks, in this order:

  • In a 390px viewport, as the first side panel the page opens: selecting the count hides the conversation, shows the list, and puts focus on the panel's tab. Opening a subagent there shows Back to Subagents. Closing the side panel, and closing its last tab, each return to the conversation with focus on the count.
  • In a 1280px viewport: selecting the count opens the list beside the conversation and leaves focus alone. Narrowing the viewport with the panel open hides the conversation; widening it shows both again.
  • After the handoff: selecting the waited-on subagent's name shows that subagent in the panel while the pane's own title is unchanged. Leaving the conversation and returning restores the wait from a fresh subagent list.
  • After the run: selecting the finished subagent's name on its launch row shows it in the panel.

The same test fails on the base commit, where the count is not a control and the name navigates. On the head it fails at the Back to Subagents step when the header rule in startup-layout.css is put back, and at the first focus check when the pane no longer tells the region what opened the panel.

Unit tests cover what the browser test cannot reach cheaply: chat-subagent-wait.test.ts (the count is a control only where there is a list to open, the whole counted sentence is the control, child sessions stay text, and the line leads to the panel only when the panel lists every subagent it mentions, with a swarm worker and an ACP subagent as counterexamples), chat-spawned-subagent.test.ts (a swarm worker's launch row still opens its session), and sidebar-layout.test.ts (the narrow presentation leaves the layout untouched and applies to nothing but an open, active Subagents or Processes panel).

Baseline on the exact tree

Run on a remote Linux x64 server against tree 6b3ed6450d51, with the base pinned to 2abd325f23b.

Stage Result
Static checks 34 of 37 pass, including formatting, lint, stylelint, the i18n check, docs checks and architecture boundaries
Line-cap and max-lines ratchets, hosted leniency off pass
Types core test types and ui pass
Node tests 20 files, 243 tests pass
UI unit tests 1,642 files, 22,754 tests pass
UI performance pass
Mocked browser tests 6 of 8 shards pass; the other two pass except for the seven tests below

Ten checks fail, and each fails the same way on the unchanged base commit 2abd325f23b in the same environment, so they are not caused by this change:

  • deadcode:dependencies and deadcode:exports report the unused exported type CallBrief in extensions/voice-call/src/types.ts; deadcode:unused-files reports scripts/bench-gateway-control-ui-proof.ts and scripts/lib/gateway-bench-load-preload.mjs. This PR touches none of them.
  • ui/src/e2e/chat-rail-columns.e2e.test.ts, two tests, time out waiting for Close Terminal; ui/src/e2e/chat-mobile-bubble-margin.e2e.test.ts, five tests, find a bubble inside the session-activity row at 390px. Neither file opens the Subagents or Processes panel, and both fail identically without this change.

Hosted CI on this PR is the remaining check on those ten.

Test cost

Measured on one worker on that server. ui/src/e2e/chat-subagent-waiting.e2e.test.ts: 7.1 s of test time on the base commit, 8.4 s on the head. The three changed unit files together: 62 tests, 4.0 s wall time including startup.

Not proven

  • No test opens the panel from the pane header's menu in a narrow pane, or opens Processes in a narrow pane. Both go through the same presentation rule that the browser test exercises from the count and from an already-open panel.
  • Focus timing is exercised in Chromium only.
  • A name inside the transcript that the Subagents panel shows (a subagent's own subagent) still navigates the pane, as before.

The working line's subagent count and the waiting line's counted sentence
now open the Subagents panel on its list. A subagent's name, on the
waiting line or on a launch row, opens that subagent in the panel instead
of navigating the pane to its session.

A pane too narrow to show a side panel beside the conversation shows the
Subagents or Processes panel in the conversation's place. That is how the
pane presents its layout, not a saved state, so a wider pane shows the
panel beside the conversation again and the other side panels are
unchanged. The region moves keyboard focus to the panel's tab when it
hides the view that held focus, and returns it when the panel closes.

The panel does not list a swarm's workers or ACP subagents, so their
names still open their sessions and a count that includes one stays
text. Panes without a side panel of their own keep the old behavior.

A subagent's header inside the panel is no longer hidden when the side
panel fills the pane: the rule that hides the pane's own header matched
the nested one too.
@clawsweeper

clawsweeper Bot commented Oct 6, 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 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 10:35 AM ET / 14:35 UTC.

ClawSweeper review

What this changes

Make chat subagent counts and names open the existing Subagents panel, and show Subagents or Processes in place of the conversation in narrow panes while managing keyboard focus.

Merge readiness

✅ Ready for maintainer review

This PR adds a distinct, useful interaction that current main lacks. The inspected visual evidence supports the intended behavior, and the review found no blocking introduced defect.

Priority: P3
Reviewed head: 9057501f136034f47ec19045ea9e10cadfd9cd89

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with strong visual evidence and focused boundary coverage; no blocking defect was identified.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. 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 before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.
Evidence reviewed 7 items Pinned introduced change: Reviewed the merge-base-to-head delta. The original head and actual checkout are 9057501; unrelated endpoint drift was excluded.
Current main still lacks the interaction: Fetched main renders running counts as text and routes the waited-on child's name through session navigation. The related merged PRs supplied wait wording, running counts, and launch names, rather than this panel-opening interaction. A latest-release source lookup failed because the required blob could not be retrieved; release inclusion was not established.
Existing owners reused: The pane carries a one-use, session-scoped panel request. Panel membership uses the existing classification and swarm exclusion rule, now shared by the panel, launch rows, and status projection; unsupported children retain session navigation.
Findings None None.
Security None None.

How this fits together

Control UI chat receives session rosters and launch results from the Gateway. It uses those facts to display subagent progress and open existing transcript panels without leaving the parent conversation.

flowchart TD
  A[Gateway session roster] --> B[Chat subagent status]
  C[Subagent launch results] --> B
  B --> D[Count or name selected]
  D --> E[Existing Subagents panel]
  E --> F[Subagent list or transcript]
  G[Pane width and saved layout] --> H[Responsive panel presentation]
  E --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +230, Tests +154, Docs +11. Total +395 across 23 files.

View PR surface stats
Area Files Added Removed Net
Source 18 290 60 +230
Tests 4 168 14 +154
Docs 1 19 8 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 477 82 +395

Review metrics

Metric Value Why it matters
Production and test growth production net +230 lines; tests net +154 lines The PR explains production growth through lazy panel intent, responsive presentation, and focus lifecycle handling.

Technical review

Best possible solution:

Keep panel selection with the existing pane and panel owners, with responsive presentation derived from the saved layout.

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

Not applicable as a feature request; current-main source and inspected before captures establish the existing text counts and session-navigation behavior.

Is this the best way to solve the issue?

Yes. The patch connects transcript controls to the existing panel and keeps responsive layout changes in presentation, avoiding a competing navigation or persistence owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This improves chat navigation and narrow-pane usability without an urgent existing-workflow failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract 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 before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.

Label justifications:

  • P3: This improves chat navigation and narrow-pane usability without an urgent existing-workflow failure.
  • 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 browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser captures show the changed pane and panel owners opening the list or selected child at wide and narrow widths. The matching body identifies the exact head and repository mocked-Gateway browser harness; focused browser assertions supplement visible proof with focus restoration and resize behavior. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit e25a981 adds ui/src/pages/chat/components/chat-subagents-panel.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: e25a98150544; files: ui/src/pages/chat/components/chat-subagents-panel.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@shakkernerd shakkernerd self-assigned this Oct 6, 2026
@shakkernerd
shakkernerd merged commit bf43db3 into main Oct 6, 2026
118 of 126 checks passed
@shakkernerd
shakkernerd deleted the subagents-panel-from-line branch October 6, 2026 15:07
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Added: the subagent count and names in the Control UI chat now open the Subagents panel on its list or on that subagent, and the panel fills the pane on narrow screens.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…es (openclaw#166142)

In the Control UI chat, the subagent count on the working line and the subagent names on wait lines and launch rows now open the Subagents panel instead of leaving the conversation: a count opens the list and a name opens that subagent. Children the panel does not list keep opening their own page.

In a pane narrower than 680px the Subagents and Processes panels fill the pane instead of stacking under the conversation, and closing one returns keyboard focus to the control that opened it. The saved panel layout is unchanged, so widening the pane restores the side-by-side view.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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: L 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