diff --git a/web/src/components/chat/ToolCallBubble.tsx b/web/src/components/chat/ToolCallBubble.tsx index 64bc0fbb9..8087680db 100644 --- a/web/src/components/chat/ToolCallBubble.tsx +++ b/web/src/components/chat/ToolCallBubble.tsx @@ -33,11 +33,12 @@ export function ToolCallBubble({ return (
@@ -66,7 +67,7 @@ export function ToolCallBubble({
{t("arguments")}
-
+                
                   {JSON.stringify(args, null, 2)}
                 
@@ -74,7 +75,7 @@ export function ToolCallBubble({ {!isLeft && response && response !== "" && (
{t("response")}
-
+                
                   {response}
                 
diff --git a/web/src/pages/Chat.tsx b/web/src/pages/Chat.tsx index cd5b26bab..b393d2e52 100644 --- a/web/src/pages/Chat.tsx +++ b/web/src/pages/Chat.tsx @@ -75,46 +75,65 @@ export default function ChatPage() {
- {messages.map((msg, i) => ( -
- {msg.role === "assistant" && msg.toolCalls && ( - <> - {msg.toolCalls.map((tc, tcIdx) => ( -
- - {tc.response && ( + {messages.map((msg, i) => { + const isStreamingPlaceholder = + i === messages.length - 1 && + msg.role === "assistant" && + isLoading && + !msg.content?.trim() && + !(msg.toolCalls && msg.toolCalls.length > 0); + if (isStreamingPlaceholder) { + return
; + } + return ( +
+ {msg.role === "assistant" && msg.toolCalls && ( + <> + {msg.toolCalls.map((tc, tcIdx) => ( +
- )} -
- ))} - - )} - -
- ))} - {isLoading && ( -
- {t("processing")} -
- )} + {tc.response && ( + + )} +
+ ))} + + )} + +
+ ); + })} + {(() => { + const lastMsg = messages[messages.length - 1]; + const showProcessing = + isLoading && + lastMsg?.role === "assistant" && + !lastMsg.content?.trim() && + !(lastMsg.toolCalls && lastMsg.toolCalls.length > 0); + return showProcessing ? ( +
+ {t("processing")} +
+ ) : null; + })()} {error && (

{error}