fix: Trace Viewer 内容渲染修复

1. useAgentStream: 每轮迭代只创建一个 TraceStep, 状态转换时更新而非新建; tool_result 反向搜索包含 toolCallId 的步骤, 修复工具结果丢失

2. TraceStep: 渲染工具状态图标/结果/错误/耗时; Thought 添加 maxHeight 200+滚动; 展开状态用户操作后不被自动覆盖

3. ToolResultBlock: 移除 500 字符截断, 改为 maxHeight 300+滚动

4. ToolCallCard: 参数区域添加 overflowY auto+wordBreak
This commit is contained in:
thzxx
2026-07-07 21:13:51 +08:00
parent 6f08759f63
commit ed59305b5e
4 changed files with 168 additions and 44 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ export function ToolCallCard({ toolCall }: ToolCallCardProps): React.JSX.Element
</Stack>
{Object.keys(toolCall.args).length > 0 && (
<Box component="pre" sx={{ fontSize: 11, borderRadius: 1, px: 1, py: 0.75, overflowX: 'auto', bgcolor: 'background.default', color: 'text.secondary', fontFamily: "'SF Mono',monospace", maxHeight: 80, m: 0 }}>
<Box component="pre" sx={{ fontSize: 11, borderRadius: 1, px: 1, py: 0.75, overflowX: 'auto', overflowY: 'auto', bgcolor: 'background.default', color: 'text.secondary', fontFamily: "'SF Mono',monospace", maxHeight: 80, m: 0, whiteSpace: 'pre-wrap', wordBreak: 'break-all' }}>
{JSON.stringify(toolCall.args, null, 2)}
</Box>
)}