Skip to content

An AI-powered search engine with a generative UI

fix(ui): apply hasNextPart logic to tool sections

Yoshiki Miura33221dc423a6
diff --git a/components/chat-messages.tsx b/components/chat-messages.tsx
index 25b05692..c1a2f632 100644
--- a/components/chat-messages.tsx
+++ b/components/chat-messages.tsx
@@ -136,8 +136,9 @@ export function ChatMessages({
if (toolCount > 1) {
return false
}
- // Single tool defaults to open
- return true
+ // Single tool: check if there's a next part
+ // If there's subsequent content, default to closed
+ return !hasNextPart
}
// For tool-invocations, default to open