fix(ui): suppress streaming Agent partial content to avoid duplicate prompt display
This commit is contained in:
@@ -448,12 +448,15 @@ function buildStreamingTurnsFromLiveMessage(
|
|||||||
// agent with child calls). Emit the running result so the renderer
|
// agent with child calls). Emit the running result so the renderer
|
||||||
// can display live output / nested tool calls, and flag the
|
// can display live output / nested tool calls, and flag the
|
||||||
// tool_call so the adapter keeps state="input-available".
|
// tool_call so the adapter keeps state="input-available".
|
||||||
|
//
|
||||||
|
// For Agents specifically, partial `content` from Claude Code's
|
||||||
|
// Task tool echoes the prompt (and subagent message fragments)
|
||||||
|
// before the real result arrives — suppress it so the Agent card
|
||||||
|
// doesn't duplicate the prompt already shown in the collapsible.
|
||||||
currentBlocks.push({
|
currentBlocks.push({
|
||||||
type: "tool_result",
|
type: "tool_result",
|
||||||
tool_use_id: block.info.tool_call_id,
|
tool_use_id: block.info.tool_call_id,
|
||||||
output_preview: isAgent
|
output_preview: isAgent ? null : (resolvedOutput ?? null),
|
||||||
? cleanAgentOutput(resolvedOutput)
|
|
||||||
: (resolvedOutput ?? null),
|
|
||||||
is_error: false,
|
is_error: false,
|
||||||
...(agentStats ? { agent_stats: agentStats } : {}),
|
...(agentStats ? { agent_stats: agentStats } : {}),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user