File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
apps/sim/lib/copilot/orchestrator/stream Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -105,19 +105,21 @@ export async function runStreamLoop(
105105
106106 const normalizedEvent = normalizeSseEvent ( event )
107107
108- // Skip duplicate tool events.
108+ // Skip duplicate tool events — both forwarding AND handler dispatch .
109109 const shouldSkipToolCall = shouldSkipToolCallEvent ( normalizedEvent )
110110 const shouldSkipToolResult = shouldSkipToolResultEvent ( normalizedEvent )
111111
112- if ( ! shouldSkipToolCall && ! shouldSkipToolResult ) {
113- try {
114- await options . onEvent ?.( normalizedEvent )
115- } catch ( error ) {
116- logger . warn ( 'Failed to forward SSE event' , {
117- type : normalizedEvent . type ,
118- error : error instanceof Error ? error . message : String ( error ) ,
119- } )
120- }
112+ if ( shouldSkipToolCall || shouldSkipToolResult ) {
113+ continue
114+ }
115+
116+ try {
117+ await options . onEvent ?.( normalizedEvent )
118+ } catch ( error ) {
119+ logger . warn ( 'Failed to forward SSE event' , {
120+ type : normalizedEvent . type ,
121+ error : error instanceof Error ? error . message : String ( error ) ,
122+ } )
121123 }
122124
123125 // Let the caller intercept before standard dispatch.
You can’t perform that action at this time.
0 commit comments