Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/sim/app/api/copilot/chat/stop/route.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,6 +29,16 @@ const {
mockSql: vi.fn((strings: TemplateStringsArray, ...values: unknown[]) => ({ strings, values })),
}))

vi.mock('@sim/db/schema', () => ({
copilotChats: {
id: 'copilotChats.id',
userId: 'copilotChats.userId',
workspaceId: 'copilotChats.workspaceId',
messages: 'copilotChats.messages',
conversationId: 'copilotChats.conversationId',
},
}))

vi.mock('@sim/db', () => ({
db: {
select: mockSelect,
Expand DownExpand Up@@ -140,6 +150,7 @@ describe('copilot chat stop route', () => {
workspaceId: 'ws-1',
chatId: 'chat-1',
type: 'completed',
streamId: 'stream-1',
})
})
})
1 change: 1 addition & 0 deletions apps/sim/app/api/copilot/chat/stop/route.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,6 +111,7 @@ export const POST = withRouteHandler((req: NextRequest) =>
workspaceId: updated.workspaceId,
chatId,
type: 'completed',
streamId,
})
}

Expand Down
1 change: 1 addition & 0 deletions apps/sim/app/api/copilot/chat/stream/route.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -248,6 +248,7 @@ async function handleResumeRequestBody({
events: batchEvents,
previewSessions,
status: run.status,
...(run.chatId ? { chatId: run.chatId } : {}),
})
}

Expand Down
1 change: 1 addition & 0 deletions apps/sim/app/api/mothership/events/route.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,6 +27,7 @@ const mothershipEventsHandler = createWorkspaceSSE({
send('task_status', {
chatId: event.chatId,
type: event.type,
...(event.streamId ? { streamId: event.streamId } : {}),
timestamp: Date.now(),
})
})
Expand Down
Loading
Loading