Agent chat: a subagent nothing named reads by its kind or as Subagent, never by an id; ids go in the tooltip
Leo-ask: ask-e6e2477545
Leo: "this needs to be rendered better... it is now right". A subagent's end line read Subagent finished: 7dc1f162-…/toolu_01H9Jk66ek2xu2m2SaOS09M1 · 1…: the raw session and tool-use ids, cut off.
Stacked on #24051 (tp/subagent-stopped-reason): this PR's base branch is feat-cmux-next, so until #24051 lands the diff shows both; this PR's own commits are the top two.
Root cause
subagents/subagentFold.ts named a subagent change.name ?? change.task ?? change.id. A subagent whose first record in the pane carried no name (a page of history that starts after its spawn; a harness that names none) got its raw <session>/<tool call> id as its name for good.
What changes
- acpmux (
cmux-tui/crates/acpmux/src/subagents.rs): a state change or progress record that names no subagent now carries the name it was spawned with (or last given), so a client reading only newer records never falls back to the id. Rust test:a_nameless_state_update_carries_the_spawned_name. - The fold: a subagent nothing named is marked
unnamedand has no name. Its rows call it by its kind (Claude's subagent_type, "Explore"), else "Subagent" (tray, summary card, Inspector, pill, group). It is never called by an id, short or raw. A later record with a real name, or the spawning Agent call'sdescription(rawInput), names it. A named subagent keeps its name. - The done line: "Subagent failed: Explore · 40m", or "Subagent finished · 2h 6m" when there is no kind either (new strings
subagents.endedPlain.*). - Ids in the tooltip: the done line's tooltip holds the full id and Claude's agentId. The row text never does.
- A message to an unnamed subagent reads as the generic recipient, not its id (
conversation/agentNames.ts). - Status and duration are unchanged ("finished", "failed", "stopped" plus the reason from #24051, then the duration). Clicking a row still opens the subagent; subagent click routing is untouched (#24017 is not touched).
- Strings, all 21 languages:
subagents.unnamed("Subagent"),subagents.endedPlain.{completed,failed,cancelled,disconnected}.
Tests (cmux16, at the head)
- webviews: 49 pass in the subagent suites, and 120 pass across every test touching these names. A new test asserts that the visible line text matches no id pattern: no
toolu_/call_, noa/bpath, no 6+ character word mixing letters and digits. The other new tests cover kind or "Subagent", agentNames skipping unnamed agents, and the Restart prompt for an unnamed subagent.vp checkfinds no type errors, and the xcstrings lint passes. cargo test -p acpmux --lib subagents: 13 passed (the Rust code is unchanged since that run).
Before / after (gallery, synthetic fixtures)
New variant agent-pane.subagent-tray#unnamed-line. Before: the line drew the raw id, as in Leo's report above (the variant is new, so the base has no frame of it). After, from top to bottom: a named subagent, an unnamed one with a kind, and an unnamed one with neither:

Compare page: https://cmux-lawrences-mac-mini.tail137216.ts.net:18796/compare/tp-subagent-row-title/?entry=agent-pane.subagent-tray
risk:medium (behaviour change). An independent Codex xhigh review via acpmux posts its receipt at the head.
Agent session: cosmic-gray
🤖 Generated with Claude Code