cmux NEXT agent chat: sent message rows show one status word, a name, no JSON

Merged
TE
15d ago
+1011-92

Summary

Leo opened a sent-message card in a Claude chat and said "THIS SHOW MORE IS IMMEDIATELY TMI". The opened card showed the full message, then "Sent", then the raw tool result ({"success":true,"message":"Message queued for delivery to a39e8…","pin":{…}}), under a header that read "This agent → a39e817af38ddf5e7".

#23738 (28c01c3aaa) already moved this row onto the shared AgentMessageRow. This PR fixes what that left, and keeps AgentMessageRow as the one shared component with its API unchanged.

PointMain before this PRThis PR
1. Never show the result JSON; status is one muted wordOpened, the card added a status line ("Sent · via …") and then printed the send's output, so a SendMessage still showed its JSON. Closed, the line ended in a check glyph.Opened, nothing is drawn after the message. The closed line ends with one muted word: Sent, Queued, Delivered or Failed (messageDelivery in agentMessages.ts). "Message queued for delivery…" maps to Queued. acpmux's queued/steered and its --json form map to Queued/Delivered. tell-coordinator's delivered to … maps to Delivered. A result with success:false or error maps to Failed.
2. Show more grows in place, about 8 lines, no extra blocks; no heavy boxAlready fixed by #23738: "Show more" is gone and the line opens to a glass card. Still wrong: the status line and output block under the card, the bordered box around a two-line message, and the 360px cap.Opened, only the message text shows, under the line at its text indent, with no box. It is capped at 8 lines (8 × 20px) and scrolls past that, with the bottom faded while more is below. The fade lifts at the end.
3. Recipient is a name, never hexPartly fixed by #23738: "This agent →" became "Sent to ". Still wrong: the chip showed the raw to, which is a hex agentId for a SendMessage.The subagent fold reads the agentId: in the Agent call's result and records it on that subagent. App provides AgentNamesContext (agentId → the Agent call's description). The chip shows that description, or the to when it is a name, or "agent" when the id isn't known. It never shows hex.
4. Copy in the hover actionsThe sent row had no Copy at all. The Copy that overlapped "SendMessage" in Leo's build is gone.A SentActions hover row (MessageActions.tsx) with Copy goes in the row's existing actions slot. It sits at the line's end, after the status word, and shows only on hover or focus.

A success:false result now reads Failed, never Sent. A follow-up PR (tp/sent-card-real-outcome) will say why, for example "Not delivered: agent stopped".

Not in this PR: drawing acpmux send --no-wait and the acpmux_send MCP tool as message rows. #23876 does that (same lane family), so I left that parsing out to avoid a duplicate. Its rows will get the status words from messageDelivery here.

Gallery

agent-pane.agent-message-row now has these states:

  • sent: collapsed. A SendMessage to a hex agentId shows "Fix grid jump" and the word Queued.
  • sent-hover: Copy at the line's end.
  • sent-opened: the card with the message only.
  • sent-opened-long: a 10-line message capped at about 8 lines, with a fade.

Before/after: https://cmux-lawrences-mac-mini.tail137216.ts.net:18796/compare/tp/sent-card-no-json/?entry=agent-pane.agent-message-row (links per state below once the advisory run finishes).

Tests

  • webviews/test/transcript-row-message.test.tsx:
    • no JSON text, closed or opened, for queued, delivered and sent SendMessage results;
    • failed results show the word Failed;
    • opened, the row has only the line and the card, with one text node in the card;
    • the recipient resolves to the Agent description, shows "agent" for an unknown id and shows a name as given;
    • Copy is the line's last child, after the status word.
  • agentMessages.test.ts: the status-word mapping for every result shape, and looksLikeId/recipientName.
  • subagentFold.test.ts: an Agent call's result gives its subagent the agentId, and agentNames maps it.

Observed / Not run

  • Observed: scripts/web-lint.sh passed on this change (Oxfmt, Oxlint, type check, layer and catalog checks).
  • Not run locally: bun tests. This Mac's hook sends them to the fleet or CI; results will be in the CI run on this head.

Changelog

Fixed: a message an agent sent another agent no longer shows the send's raw result or a hex agent id. Its line ends with one word (Sent, Queued, Delivered), and the opened message grows in place, capped at about eight lines, with Copy on hover.

Risk: risk:normal (webview UI only).

Leo-ask: ask-0033ce890a

Agent session: cosmic-gray

🤖 Generated with Claude Code


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


Summary by cubic

Fixes sent message rows in the agent chat so they never show the send's raw result JSON or a hex recipient id, after the opened card's status block and output were flagged as too much.

Each sent line now ends with one muted status word (Sent, Queued, Delivered, Failed) read from the send's result, including acpmux's queued/steered. Opened messages grow in place with no box, capped at about eight lines with a bottom fade. The recipient chip shows the subagent's description for a SendMessage agentId (recorded from the Agent call's result), a provided name, or "agent" when the id is unknown. Copy appears in the line's hover row after the status word.