From 01d148ec9347d6c1df7f04fd59a837042bfaf7b4 Mon Sep 17 00:00:00 2001 From: wuyang6 Date: Wed, 13 May 2026 15:42:38 +0800 Subject: [PATCH] Show live stage notes in activity panel --- .../components/assistant-ui/activity-panel.tsx | 17 +++++++++++++++++ .../app/components/assistant-ui/thread-list.tsx | 7 ++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/assistant-ui/activity-panel.tsx b/frontend/app/components/assistant-ui/activity-panel.tsx index 1edea5f..4c37ca0 100644 --- a/frontend/app/components/assistant-ui/activity-panel.tsx +++ b/frontend/app/components/assistant-ui/activity-panel.tsx @@ -911,6 +911,23 @@ function collectLiveRunItems(runStatus: ClawRunStatus | null) { } seenToolCalls.add(event.tool_call_id); const result = resultById.get(event.tool_call_id); + const stageNote = + typeof event.assistant_content === "string" + ? event.assistant_content.trim() + : ""; + if (stageNote) { + items.push({ + id: `live:${runStatus.run_id ?? runStatus.session_id ?? "active"}:${event.tool_call_id}:stage`, + kind: "reasoning", + title: "阶段说明", + summary: stageNote, + status: result + ? result.ok === false + ? "incomplete" + : "complete" + : "running", + }); + } const resultSummary = typeof result?.metadata?.output_preview === "string" ? result.metadata.output_preview diff --git a/frontend/app/components/assistant-ui/thread-list.tsx b/frontend/app/components/assistant-ui/thread-list.tsx index dd7c916..68f79c6 100644 --- a/frontend/app/components/assistant-ui/thread-list.tsx +++ b/frontend/app/components/assistant-ui/thread-list.tsx @@ -605,11 +605,8 @@ function summarizeRunEvents(runStatus: ClawActiveRunStatus) { ? event.assistant_content.trim() : ""; lines.push( - stageNote.startsWith("进度:") || stageNote.startsWith("进度:") - ? stageNote - : event.tool_name - ? `调用工具 ${event.tool_name}` - : "正在调用工具", + stageNote || + (event.tool_name ? `调用工具 ${event.tool_name}` : "正在调用工具"), ); } if (event.type === "tool_result") {