From 7ebbb53b57ce2796feab37ab3543fad2b5e25dce Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Mon, 5 Jan 2026 22:24:52 +0800 Subject: [PATCH] fix(frontend): render all tool calls in the frontend #796 (#797) --- .../components/research-activities-block.tsx | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/web/src/app/chat/components/research-activities-block.tsx b/web/src/app/chat/components/research-activities-block.tsx index ef808d3..b3ba900 100644 --- a/web/src/app/chat/components/research-activities-block.tsx +++ b/web/src/app/chat/components/research-activities-block.tsx @@ -104,21 +104,24 @@ const ActivityListItem = React.memo(({ messageId }: { messageId: string }) => { const message = useMessage(messageId); if (message) { if (!message.isStreaming && message.toolCalls?.length) { - for (const toolCall of message.toolCalls) { - if (typeof toolCall.result === "string" && toolCall.result?.startsWith("Error")) { - return null; - } - if (toolCall.name === "web_search") { - return ; - } else if (toolCall.name === "crawl_tool") { - return ; - } else if (toolCall.name === "python_repl_tool") { - return ; - } else if (toolCall.name === "local_search_tool") { - return ; - } else { - return ; - } + const toolCallComponents = message.toolCalls + .filter(toolCall => !(typeof toolCall.result === "string" && toolCall.result?.startsWith("Error"))) + .map(toolCall => { + if (toolCall.name === "web_search") { + return ; + } else if (toolCall.name === "crawl_tool") { + return ; + } else if (toolCall.name === "python_repl_tool") { + return ; + } else if (toolCall.name === "local_search_tool") { + return ; + } else { + return ; + } + }); + + if (toolCallComponents.length > 0) { + return <>{toolCallComponents}; } } }