diff --git a/apps/sim/lib/copilot/orchestrator/config.ts b/apps/sim/lib/copilot/orchestrator/config.ts index 6658ca6b9..76bf83bd4 100644 --- a/apps/sim/lib/copilot/orchestrator/config.ts +++ b/apps/sim/lib/copilot/orchestrator/config.ts @@ -52,6 +52,12 @@ export const RESPOND_TOOL_NAMES = [ 'deploy_respond', 'superagent_respond', 'discovery_respond', + 'tour_respond', + 'auth_respond', + 'workflow_respond', + 'knowledge_respond', + 'custom_tool_respond', + 'test_respond', ] as const export const RESPOND_TOOL_SET = new Set(RESPOND_TOOL_NAMES) diff --git a/apps/sim/lib/copilot/orchestrator/sse-handlers/handlers.ts b/apps/sim/lib/copilot/orchestrator/sse-handlers/handlers.ts index 84da658b9..b641b10f8 100644 --- a/apps/sim/lib/copilot/orchestrator/sse-handlers/handlers.ts +++ b/apps/sim/lib/copilot/orchestrator/sse-handlers/handlers.ts @@ -248,8 +248,14 @@ export const sseHandlers: Record = { context.currentThinkingBlock.content = `${context.currentThinkingBlock.content || ''}${chunk}` }, content: (event, context) => { - const d = asRecord(event.data) - const chunk = (d.content || d.data || event.content) as string | undefined + // Go backend sends content as a plain string in event.data, not wrapped in an object. + let chunk: string | undefined + if (typeof event.data === 'string') { + chunk = event.data + } else { + const d = asRecord(event.data) + chunk = (d.content || d.data || event.content) as string | undefined + } if (!chunk) return context.accumulatedContent += chunk addContentBlock(context, { type: 'text', content: chunk }) @@ -281,8 +287,14 @@ export const subAgentHandlers: Record = { content: (event, context) => { const parentToolCallId = context.subAgentParentToolCallId if (!parentToolCallId || !event.data) return - const d = asRecord(event.data) - const chunk = (d.content || d.data || event.content) as string | undefined + // Go backend sends content as a plain string in event.data + let chunk: string | undefined + if (typeof event.data === 'string') { + chunk = event.data + } else { + const d = asRecord(event.data) + chunk = (d.content || d.data || event.content) as string | undefined + } if (!chunk) return context.subAgentContent[parentToolCallId] = (context.subAgentContent[parentToolCallId] || '') + chunk