Commit 669dccb
fix(daemon): extract subagent reply text from tool_response envelope
closeSubagentInvokeAgentSpan was storing the full Claude Code
tool_response envelope JSON-stringified into gen_ai.output.messages:
{"status":"completed","prompt":"...","agentId":"...",
"content":[{"type":"text","text":"ok let me push..."}],
...}
The chat view then rendered that whole blob as the subagent's
assistant_message, instead of just the subagent's reply text.
Extract `content[*].text` from the Anthropic-shape envelope. Plain
strings (orphan-path lastAssistantText, error-path messages) and
unrecognized shapes pass through unchanged so behavior is preserved
for the non-envelope call sites.
Verified locally against a realistic tool_response with sibling
fields (status, prompt, agentId, agentType, description,
totalDurationMs, totalTokens). After fix, output_messages.content is
exactly the subagent's text — none of the envelope keys leak through.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2f16e32 commit 669dccb
1 file changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
85 | 119 | | |
86 | 120 | | |
87 | 121 | | |
| |||
810 | 844 | | |
811 | 845 | | |
812 | 846 | | |
813 | | - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
814 | 854 | | |
815 | 855 | | |
816 | | - | |
| 856 | + | |
817 | 857 | | |
818 | 858 | | |
819 | 859 | | |
| |||
0 commit comments