feat(ui): add dedicated Agent subagent rendering with nested tool call display
Render Agent/Explore/Plan tool calls in a visually distinct collapsible
container with colored left border, replacing the generic tool card. Parse
subagent JSONL transcripts from {sessionId}/subagents/ to extract and
display the actual tool calls (Bash, Read, Grep, etc.) the subagent
executed, reusing the existing ToolCallPart for consistent appearance.
- Add AgentToolCallPart component with collapsible body, prompt section,
execution stats, and nested tool call list via render prop injection
- Add AgentExecutionStats and AgentToolCall types (Rust + TypeScript)
- Parse toolUseResult.agentId to locate and read subagent JSONL files
- Validate agentId against path traversal before filesystem access
- Pass agentStats through adapter for both ID-matched and positional
tool result pairing
- Strip agentStats in nested render to prevent recursive Agent expansion
- Add i18n keys for agent UI labels across all 10 languages
This commit is contained in:
@@ -1053,6 +1053,7 @@ fn extract_tool_result_content(value: &serde_json::Value) -> Vec<ContentBlock> {
|
||||
tool_use_id,
|
||||
output_preview: output,
|
||||
is_error,
|
||||
agent_stats: None,
|
||||
});
|
||||
|
||||
blocks
|
||||
@@ -1238,7 +1239,7 @@ mod tests {
|
||||
assert_eq!(blocks.len(), 1);
|
||||
assert!(matches!(
|
||||
&blocks[0],
|
||||
ContentBlock::ToolResult { tool_use_id, output_preview, is_error }
|
||||
ContentBlock::ToolResult { tool_use_id, output_preview, is_error, .. }
|
||||
if tool_use_id.as_deref() == Some("call_123")
|
||||
&& output_preview.as_deref() == Some("file contents here")
|
||||
&& !is_error
|
||||
|
||||
Reference in New Issue
Block a user