Running tray: the folded bar names what runs, newest first, then +N more

Merged
TE
3d ago
+369-13

Leo, 2026-11-03: "the "running" bar above the composer is currently no longer usable bc it doesn't display much". His capture showed the folded bar reading only 1 subagent running · 1 command 4s ›.

What changed

The running tray's folded header now names what runs, as Claude Code's own running-tasks list does: a subagent by its task, a command by its description (or its short command when it has none), a started chat by its title, newest first.

  • One subagent plus one command: Watch the tests · Explore how the daemon updates itself 4s ›
  • Five running: the newest two by name, then +3 more. The bar stays one row.
  • A narrow tray (400px or less, measured) names only the newest. The count and the time never truncate; the names give way first.
  • Opening it (the ›) works as before. Open, the lines name each item, so the header goes back to its counts.

Regressed by #29885 (merged 2026-11-01), which made every headed tray start folded to its header (for #28875) while that header said only counts. This keeps that fold and its one-row height and puts the names back on it. Takes back #29885: only the count-only folded header text; the default fold stays.

Spec: leo-workspace design/running-tray.md (updated in its own PR). References used: claude/live/panel-context-and-background-tasks and claude/live/session-running-with-side-panels.

Gallery: agent-pane.subagent-tray-names with variants one-plus-one, five and long-narrow, plus an experiment subagent-tray-fold-head with three arms: two (the default: newest two, then +N more), one (newest one, then +N more) and counts (as before). I picked two because it names both items in Leo's case and still fits on one row. The SubagentTray gallery's one-agent-two-commands variant now opens the tray before it reads the counts.

Performance: only the newest two items are labelled, in a useMemo that runs when the items change, never on the one-second clock tick. The 300-agent folded test now allows at most 10 name reads (it was 0), and a rerender adds none. No new timer, observer or per-token work. The count string reuses the existing tools.more ("+{n} more"), so there are no new localized strings.

Test

webviews/test/subagent-tray-names.test.tsx, committed first (62a2a9981ff), checks that the folded bar names the subagent's task and the command's description, that a command with no description gets its short command, and that five running show the newest two plus +3 more.
Command: cmux-ci test --setup webviews -- bash -c 'cd webviews && bun test test/subagent-tray-names.test.tsx'

  • Base (62a2a9981ff, test only): RED_RESULT
  • Head: GREEN_RESULT

Observed / Not run

  • Observed: bun test test/subagent-tray-names.test.tsx test/subagent-tray.test.tsx gave 45 pass, 0 fail at the head. scripts/web-lint.sh (with CMUX_LOCAL_HEAVY_CHECKS=0) and scripts/cmux-next/prepush-gate.py both passed. A fleet run of bun run check plus the tray suites (trailing, columns, composer geometry, expand shift, running strip, bottom-stack edges, motion, dead clicks) gave: FLEET_RESULT
  • Not run: I have not looked at the gallery captures myself; the advisory gallery run renders them. No DEV build.

Changelog

  • Fixed: The running bar above the composer names the subagents and commands that are running, not just how many there are.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the running tray header above the composer, which showed only counts when folded (e.g. 1 subagent running · 1 command), so it now names what runs. This restores names to the fold introduced in #29885 while keeping the one-row folded height.

  • The folded header names the two newest running items, newest first: a subagent by its task, a command by its description (or its short command when it has none), a chat by its title, then +N more.
  • Narrow trays (≤400px) name only the newest item; the count and elapsed time never truncate, the names give way first.
  • Opening the tray shows the full list and the header returns to counts.
  • The behavior sits behind an experiment (subagent-tray-fold-head) with arms two (default), one, and counts for comparison.
  • Only the newest two items are labeled, computed when the items change and never on the one-second tick.