Skip to content

Commit a88d5f6

Browse files
committed
cleanup
1 parent 73f2e73 commit a88d5f6

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

apps/sim/app/api/mcp/copilot/route.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { createLogger } from '@sim/logger'
1717
import { eq, sql } from 'drizzle-orm'
1818
import { type NextRequest, NextResponse } from 'next/server'
1919
import { getHighestPrioritySubscription } from '@/lib/billing/core/subscription'
20-
import { getCopilotModel } from '@/lib/copilot/config'
2120
import {
2221
ORCHESTRATION_TIMEOUT_MS,
2322
SIM_AGENT_API_URL,
@@ -36,6 +35,7 @@ import { resolveWorkflowIdForUser } from '@/lib/workflows/utils'
3635

3736
const logger = createLogger('CopilotMcpAPI')
3837
const mcpRateLimiter = new RateLimiter()
38+
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6'
3939

4040
export const dynamic = 'force-dynamic'
4141
export const runtime = 'nodejs'
@@ -624,7 +624,6 @@ async function handleBuildToolCall(
624624
): Promise<CallToolResult> {
625625
try {
626626
const requestText = (args.request as string) || JSON.stringify(args)
627-
const { model } = getCopilotModel()
628627
const workflowId = args.workflowId as string | undefined
629628

630629
const resolved = workflowId ? { workflowId } : await resolveWorkflowIdForUser(userId)
@@ -654,7 +653,7 @@ async function handleBuildToolCall(
654653
message: requestText,
655654
workflowId: resolved.workflowId,
656655
userId,
657-
model,
656+
model: DEFAULT_COPILOT_MODEL,
658657
mode: 'agent',
659658
commands: ['fast'],
660659
messageId: randomUUID(),
@@ -721,16 +720,14 @@ async function handleSubagentToolCall(
721720
context.plan = args.plan
722721
}
723722

724-
const { model } = getCopilotModel()
725-
726723
const result = await orchestrateSubagentStream(
727724
toolDef.agentId,
728725
{
729726
message: requestText,
730727
workflowId: args.workflowId,
731728
workspaceId: args.workspaceId,
732729
context,
733-
model,
730+
model: DEFAULT_COPILOT_MODEL,
734731
headless: true,
735732
source: 'mcp',
736733
},

apps/sim/app/api/v1/copilot/chat/route.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { createLogger } from '@sim/logger'
22
import { type NextRequest, NextResponse } from 'next/server'
33
import { z } from 'zod'
4-
import { getCopilotModel } from '@/lib/copilot/config'
54
import { SIM_AGENT_VERSION } from '@/lib/copilot/constants'
65
import { COPILOT_REQUEST_MODES } from '@/lib/copilot/models'
76
import { orchestrateCopilotStream } from '@/lib/copilot/orchestrator'
87
import { resolveWorkflowIdForUser } from '@/lib/workflows/utils'
98
import { authenticateV1Request } from '@/app/api/v1/auth'
109

1110
const logger = createLogger('CopilotHeadlessAPI')
11+
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6'
1212

1313
const RequestSchema = z.object({
1414
message: z.string().min(1, 'message is required'),
@@ -42,8 +42,7 @@ export async function POST(req: NextRequest) {
4242
try {
4343
const body = await req.json()
4444
const parsed = RequestSchema.parse(body)
45-
const defaults = getCopilotModel()
46-
const selectedModel = parsed.model || defaults.model
45+
const selectedModel = parsed.model || DEFAULT_COPILOT_MODEL
4746

4847
// Resolve workflow ID
4948
const resolved = await resolveWorkflowIdForUser(

apps/sim/lib/copilot/config.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)