Resumed subagent (SendMessage) detail panel renders garbled transcript: turns inverted, and raw SendMessage envelope shown on reopen
What's wrong
In Claude Desktop (Code tab), when a background subagent is resumed via the SendMessage tool (the response reads "resumed from transcript in the background"), the subagent's detail panel renders a garbled transcript. I observed two distinct rendering symptoms for the same agent:
Symptom 1 — turn order inverted. After the agent completed one turn and was then resumed with a follow-up, the panel rendered the newest turn above the older turn. The header still shows the original spawn prompt, but the body leads with the response to the second message, and the footer (agent id + usage) belonging to the first call appears at the very bottom. So authoring order is inverted.
Symptom 2 — raw SendMessage envelope shown on reopen. After closing and reopening the same panel, it no longer shows the agent's turns at all — it renders the raw SendMessage tool-result JSON envelope ({"success":true,"message":"…resumed from transcript…","resumedAgentId":…,"pin":{…}}) as if it were the transcript.
Both point at the same area: how the detail panel reconstructs a SendMessage-resumed background agent's transcript.
Screenshots
Symptom 1 — inverted turn order (panel titled "Count from 1 to 10"):
<img width="2000" height="1194" alt="Image" src="https://github.com/user-attachments/assets/b26a4225-7338-4639-90e4-ab1b0cc8ad05" />
Transcribed content, top to bottom:
[header prompt bubble] Count from 1 to 10. Output the numbers 1 through 10, each on its own line, and nothing else.
11
12
13
14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
agentId: a56d3a975a62a9767 (use SendMessage with to: 'a56d3a975a62a9767', summary: '<5-10 word recap>' to continue this agent)
<usage>subagent_tokens: 56351 tool_uses: 0 duration_ms: 2415</usage>
Note the header is the original prompt, yet the body leads with the second turn's output (11–20) above the first turn's output (1–10).
Symptom 2 — raw SendMessage envelope after close/reopen (same panel):
<img width="838" height="538" alt="Image" src="https://github.com/user-attachments/assets/0afcc000-9e54-4c58-a509-3c62c400f326" />
Transcribed content:
{"success":true,"message":"Agent \"Alice\" had no active task; resumed from transcript in the background with your message. You'll be notified when it finishes. Output: /private/tmp/claude-501/…/tasks/a56d3a975a62a9767.output","resumedAgentId":"a56d3a975a62a9767","pin":{"id":"a56d3a975a62a9767","name":"Alice","ref":"915361"}}
Steps to reproduce
- Spawn a background subagent via the Agent tool (I named mine "Alice") and let it complete a turn.
- Resume it with a follow-up via
SendMessage({to: "<agentId or name>"})— the result reads "resumed from transcript in the background" — and let that turn complete. - Open the subagent's detail panel → Symptom 1: the newest turn is rendered above the older turn.
- Close the panel and reopen it → Symptom 2: the panel renders the raw
SendMessagetool-result envelope instead of the agent's transcript.
Expected
The detail panel should render the resumed agent's turns in authoring order (oldest → newest), and reopening the panel should show the same transcript — never the raw SendMessage tool-result envelope.
Actual
Turns are rendered newest-first (Symptom 1), and on reopen the panel shows the raw SendMessage result JSON instead of the transcript (Symptom 2).
Environment
- Claude Code version: 2.1.185
- Model: Opus (claude-opus-4-8)
- Platform: macOS (Darwin 25.5.0), Apple Silicon
- Relevant flag:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1(enabled —SendMessageresume is in use in this session) - Agent was spawned in the background and resumed via
SendMessage.
Related
- #73095 — SendMessage-resumed background subagent never appears in the background tasks UI (same trigger — a
SendMessage-resumed background subagent — different UI surface).