File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ export function ChatMessages({
77
77
const showLoading = isLoading && messages [ messages . length - 1 ] . role === 'user'
78
78
79
79
const getIsOpen = ( id : string ) => {
80
+ if ( id . includes ( 'call' ) ) {
81
+ return openStates [ id ] ?? true
82
+ }
80
83
const baseId = id . endsWith ( '-related' ) ? id . slice ( 0 , - 8 ) : id
81
84
const index = messages . findIndex ( msg => msg . id === baseId )
82
85
return openStates [ id ] ?? index >= lastUserIndex
Original file line number Diff line number Diff line change @@ -95,6 +95,14 @@ export function RenderMessage({
95
95
// New way: Use parts instead of toolInvocations
96
96
return (
97
97
< >
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
+ ) ) }
98
106
{ message . parts ?. map ( ( part , index ) => {
99
107
switch ( part . type ) {
100
108
case 'tool-invocation' :
You can’t perform that action at this time.
0 commit comments