Skip to content

Commit c74982f

Browse files
authored
Merge pull request #477 from miurla/fix/search-results-manual-tool-calls
fix: display search results from manual tool calls
2 parents 859f8b6 + b75a754 commit c74982f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

components/chat-messages.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ export function ChatMessages({
7777
const showLoading = isLoading && messages[messages.length - 1].role === 'user'
7878

7979
const getIsOpen = (id: string) => {
80+
if (id.includes('call')) {
81+
return openStates[id] ?? true
82+
}
8083
const baseId = id.endsWith('-related') ? id.slice(0, -8) : id
8184
const index = messages.findIndex(msg => msg.id === baseId)
8285
return openStates[id] ?? index >= lastUserIndex

components/render-message.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ export function RenderMessage({
9595
// New way: Use parts instead of toolInvocations
9696
return (
9797
<>
98+
{toolData.map(tool => (
99+
<ToolSection
100+
key={tool.toolCallId}
101+
tool={tool}
102+
isOpen={getIsOpen(tool.toolCallId)}
103+
onOpenChange={open => onOpenChange(tool.toolCallId, open)}
104+
/>
105+
))}
98106
{message.parts?.map((part, index) => {
99107
switch (part.type) {
100108
case 'tool-invocation':

0 commit comments

Comments
 (0)