diff --git a/apps/sim/app/api/copilot/chat/route.test.ts b/apps/sim/app/api/copilot/chat/route.test.ts index b3248c2b0..bad11be48 100644 --- a/apps/sim/app/api/copilot/chat/route.test.ts +++ b/apps/sim/app/api/copilot/chat/route.test.ts @@ -226,6 +226,7 @@ describe('Copilot Chat API Route', () => { mode: 'agent', messageId: 'mock-uuid-1234-5678', depth: 0, + chatId: 'chat-123', }), }) ) @@ -289,6 +290,7 @@ describe('Copilot Chat API Route', () => { mode: 'agent', messageId: 'mock-uuid-1234-5678', depth: 0, + chatId: 'chat-123', }), }) ) @@ -341,6 +343,7 @@ describe('Copilot Chat API Route', () => { mode: 'agent', messageId: 'mock-uuid-1234-5678', depth: 0, + chatId: 'chat-123', }), }) ) @@ -430,6 +433,7 @@ describe('Copilot Chat API Route', () => { mode: 'ask', messageId: 'mock-uuid-1234-5678', depth: 0, + chatId: 'chat-123', }), }) ) diff --git a/apps/sim/app/api/copilot/chat/route.ts b/apps/sim/app/api/copilot/chat/route.ts index af18aa02c..194525878 100644 --- a/apps/sim/app/api/copilot/chat/route.ts +++ b/apps/sim/app/api/copilot/chat/route.ts @@ -372,13 +372,13 @@ export async function POST(req: NextRequest) { streamToolCalls: true, mode: mode, messageId: userMessageIdToUse, - chatId: actualChatId, ...(providerConfig ? { provider: providerConfig } : {}), ...(effectiveConversationId ? { conversationId: effectiveConversationId } : {}), ...(typeof effectiveDepth === 'number' ? { depth: effectiveDepth } : {}), ...(typeof effectivePrefetch === 'boolean' ? { prefetch: effectivePrefetch } : {}), ...(session?.user?.name && { userName: session.user.name }), ...(agentContexts.length > 0 && { context: agentContexts }), + ...(actualChatId ? { chatId: actualChatId } : {}), } try { diff --git a/apps/sim/providers/utils.ts b/apps/sim/providers/utils.ts index d852cf6e2..78b511519 100644 --- a/apps/sim/providers/utils.ts +++ b/apps/sim/providers/utils.ts @@ -1,4 +1,4 @@ -import { getCostMultiplier, isHosted } from '@/lib/environment' +import { isHosted } from '@/lib/environment' import { createLogger } from '@/lib/logs/console/logger' import { anthropicProvider } from '@/providers/anthropic' import { azureOpenAIProvider } from '@/providers/azure-openai'