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
1 change: 1 addition & 0 deletions apps/sim/app/api/chat/subdomains/validate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function GET(request: Request) {
'support',
'admin',
'qa',
'agent',
]
if (reservedSubdomains.includes(subdomain)) {
return NextResponse.json(
Expand Down
5 changes: 4 additions & 1 deletion apps/sim/app/api/copilot/api-keys/generate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export async function POST(req: NextRequest) {

const res = await fetch(`${SIM_AGENT_API_URL}/api/validate-key/generate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: {
'Content-Type': 'application/json',
...(env.COPILOT_API_KEY ? { 'x-api-key': env.COPILOT_API_KEY } : {}),
},
body: JSON.stringify({ userId }),
})

Expand Down
13 changes: 0 additions & 13 deletions apps/sim/app/api/copilot/chat/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ describe('Copilot Chat API Route', () => {
streamToolCalls: true,
mode: 'agent',
depth: 0,
origin: 'http://localhost:3000',
}),
})
)
Expand Down Expand Up @@ -288,7 +287,6 @@ describe('Copilot Chat API Route', () => {
streamToolCalls: true,
mode: 'agent',
depth: 0,
origin: 'http://localhost:3000',
}),
})
)
Expand All @@ -298,7 +296,6 @@ describe('Copilot Chat API Route', () => {
const authMocks = mockAuth()
authMocks.setAuthenticated()

// Mock new chat creation
const newChat = {
id: 'chat-123',
userId: 'user-123',
Expand All @@ -307,8 +304,6 @@ describe('Copilot Chat API Route', () => {
}
mockReturning.mockResolvedValue([newChat])

// Mock sim agent response

;(global.fetch as any).mockResolvedValue({
ok: true,
body: new ReadableStream({
Expand Down Expand Up @@ -343,7 +338,6 @@ describe('Copilot Chat API Route', () => {
streamToolCalls: true,
mode: 'agent',
depth: 0,
origin: 'http://localhost:3000',
}),
})
)
Expand All @@ -353,11 +347,8 @@ describe('Copilot Chat API Route', () => {
const authMocks = mockAuth()
authMocks.setAuthenticated()

// Mock new chat creation
mockReturning.mockResolvedValue([{ id: 'chat-123', messages: [] }])

// Mock sim agent error

;(global.fetch as any).mockResolvedValue({
ok: false,
status: 500,
Expand Down Expand Up @@ -403,11 +394,8 @@ describe('Copilot Chat API Route', () => {
const authMocks = mockAuth()
authMocks.setAuthenticated()

// Mock new chat creation
mockReturning.mockResolvedValue([{ id: 'chat-123', messages: [] }])

// Mock sim agent response

;(global.fetch as any).mockResolvedValue({
ok: true,
body: new ReadableStream({
Expand Down Expand Up @@ -438,7 +426,6 @@ describe('Copilot Chat API Route', () => {
streamToolCalls: true,
mode: 'ask',
depth: 0,
origin: 'http://localhost:3000',
}),
})
)
Expand Down
Loading
Loading