Repository navigation
feat: open the Subagents panel from the chat's subagent count and names - #166142
Conversation
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.
|
🦞👀 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 6, 2026, 10:35 AM ET / 14:35 UTC. ClawSweeper reviewWhat this changesMake 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 Review scores
Verification
How this fits togetherControl 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +230, Tests +154, Docs +11. Total +395 across 23 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
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. |
…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.
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:
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:
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.
showSubagentson 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.
isSubagentsPanelSessionnow 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.
presentNarrowSidebarLayoutreturns 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.tsis at the repository's 700-line cap, so the two callbacks are added where the pane composes the chat view, inchat-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
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
9057501f136034f47ec19045ea9e10cadfd9cd89Behavior on the exact head
ui/src/e2e/chat-subagent-waiting.e2e.test.tsdrives the real pane, panel and layout through a mocked Gateway. On head9057501f136it passes, and it now checks, in this order: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.cssis 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), andsidebar-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 to2abd325f23b.core test typesanduipassTen checks fail, and each fails the same way on the unchanged base commit
2abd325f23bin the same environment, so they are not caused by this change:deadcode:dependenciesanddeadcode:exportsreport the unused exported typeCallBriefinextensions/voice-call/src/types.ts;deadcode:unused-filesreportsscripts/bench-gateway-control-ui-proof.tsandscripts/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