Sidebar hover preview: count and name each agent's running subagents; History drops inbox notices
Summary
Leo (2026-11-01), on the sidebar hover preview of a lead agent:
"e.g. this hover preview being able to see the # of associated subagents and whatnot would be a lot more useful / like the details aren't even very useful / there's a lot of low hanging fruit"
His screenshot showed the hover preview of a workspace called "UI lead". Collapsed, it listed one agent chat row (the lead agent session) with a spinner and "Show details". Expanded, it said "Agent running · 41s", "Prompts: 10 · Worked 26m 52s", the harness and model, the last prompt, and a History list in which several entries were "[inbox] New messages from other agents in 1 thread..." notices. That agent was running about ten background subagents at the time, and none of them showed in the card.
acpmux (Rust) counts the work. No counting or classifying is in Swift.
SubagentTree(subagents.rs) tracks every running subagent (foreground or background, at any depth, live updates only), oldest first, with a label (its name, else its task, one line, cut to 60 characters).- Each chat's summary gets three new fields:
subagentsRunning: how many run now. Between turns only background ones count, because a foreground subagent ends with its turn even when the harness never says so.subagentNames: the first 5 labels.commandsRunning: the chat's running background commands, from the process registry.
- Each change in the count is a
subagents_runningmux record. That record andprocess_updateare nowsession_changedkinds, so the app and peers hear changes live. turn.notice: true while the running turn was started by acpmux's inbox notice or a digest (prompt_line::is_notice), not by anyone's words.
The card (Swift) only renders it.
- Each tab row in the hover preview starts its second line with "3 subagents · 1 command" (tabular digits), then its folder. A compact row has no second line, so it shows no count.
- The expanded details get a "3 subagents · 1 command" line (the running tray's glyph) and then one line per running subagent, by name. This is
WorkspaceHoverCardWork. - A turn started by an inbox notice becomes a
.startedevent markedisNotice. The History leaves it out, so it lists the person's prompts and what happened; the "Prompts / Worked" stats still count its work time. - Nothing is removed: the details section, the History and every row stay.
Design choice. The gallery's new "Running work" cards show three versions of the expanded card:
list(chosen): a count line, then each subagent named on its own line.summary: the count line alone.inline: the count, then the names wrapped onto two lines.
I picked list because Leo's point was that the details should tell him something. A count alone says little more than the spinner already does, and names joined on one line get cut at the card's 280 pt width. The list follows the sidebar rule against repeating a type label on every row: the header line names the kind, and each line is just a name with an icon. Each chat sends at most 5 names; the count line always gives the total, and there is no "Show N more" (sidebar.md).
Follows leo-workspace design/sidebar.md (Hover previews; never "Show N more"; spinner for working state; no status words in rows), design/running-tray.md (the app.sample.runningagents glyph, tabular numerals) and design/overlay-surfaces.md (the card's existing glass and tokens; no new motion). The spec update is a separate leo-workspace notes PR.
Prior art:
- #28773 (carry of #27923, open) adds a usage row and reads
usageStatsin the same files, but it does not count running subagents in the card. ItssubagentsLivecomes from harness transcript reads every 5 s, only when a client asks for usage. Whichever PR lands second will have additive conflicts to resolve. - #28062 (sidebar categories) does not touch the hover card.
Changelog
Added: the sidebar hover preview shows how many subagents and background commands each agent is running and names them in its details; its History no longer lists inbox notices.
Tests
- Swift:
WorkspaceHoverCardRunningWorkTests(an agent with N running subagents shows N in its tab row and the count and names in its details; an inbox-notice turn is absent from History, and the stats keep its work; the summary fields parse, and an older acpmux gives 0). - Rust:
subagents::running_subagents_are_counted_with_their_names_from_start_to_end,hub::work_below_tests::running_subagents_reach_the_summary_and_each_change_is_recorded,prompt_line_tests::inbox_notices_and_digests_are_notices_and_messages_are_not,change_kind::running_work_changes_publish_a_session_change.
Observed / Not run
- Observed:
python3 scripts/cmux-next/prepush-gate.pyreported no new violations. - Results of the fleet compile, the Swift suite and the cargo tests are posted as comments.
- No capture yet. The gallery cards are
debug.hover_cards {gallery}"Running work · list/summary/inline".
Agent session: agent session
🤖 Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Making the sidebar hover preview show what each agent is actually running: tab rows count each agent's running subagents and background commands, and the expanded details name the subagents. Inbox-notice turns drop out of History while their work still counts in the stats.
- acpmux tracks every running subagent at any depth and adds
subagentsRunning,subagentNames(first 5), andcommandsRunningto each chat's summary; count changes and background-command updates now publish live as session changes. Subagent labels are their name or task, masked and cut to 60 characters so no credential reaches the summary. - Tab rows lead their second line with "3 subagents · 1 command" (tabular digits) before the folder; expanded details add the count and one line per named subagent.
- Between turns only background subagents count, since a foreground subagent ends with its turn even when the harness never says so; a restarted turn keeps its History line because no provenance survives the restart.
- A turn started by an inbox notice is now a non-prompt
.startedevent: History omits it, and the Prompts/Worked stats still count its work.