diff --git a/apps/sim/app/api/mcp/copilot/route.ts b/apps/sim/app/api/mcp/copilot/route.ts index 79268ecfc..cc84a53a9 100644 --- a/apps/sim/app/api/mcp/copilot/route.ts +++ b/apps/sim/app/api/mcp/copilot/route.ts @@ -17,7 +17,6 @@ import { createLogger } from '@sim/logger' import { eq, sql } from 'drizzle-orm' import { type NextRequest, NextResponse } from 'next/server' import { getHighestPrioritySubscription } from '@/lib/billing/core/subscription' -import { getCopilotModel } from '@/lib/copilot/config' import { ORCHESTRATION_TIMEOUT_MS, SIM_AGENT_API_URL, @@ -36,6 +35,7 @@ import { resolveWorkflowIdForUser } from '@/lib/workflows/utils' const logger = createLogger('CopilotMcpAPI') const mcpRateLimiter = new RateLimiter() +const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6' export const dynamic = 'force-dynamic' export const runtime = 'nodejs' @@ -624,7 +624,6 @@ async function handleBuildToolCall( ): Promise { try { const requestText = (args.request as string) || JSON.stringify(args) - const { model } = getCopilotModel() const workflowId = args.workflowId as string | undefined const resolved = workflowId ? { workflowId } : await resolveWorkflowIdForUser(userId) @@ -654,7 +653,7 @@ async function handleBuildToolCall( message: requestText, workflowId: resolved.workflowId, userId, - model, + model: DEFAULT_COPILOT_MODEL, mode: 'agent', commands: ['fast'], messageId: randomUUID(), @@ -721,8 +720,6 @@ async function handleSubagentToolCall( context.plan = args.plan } - const { model } = getCopilotModel() - const result = await orchestrateSubagentStream( toolDef.agentId, { @@ -730,7 +727,7 @@ async function handleSubagentToolCall( workflowId: args.workflowId, workspaceId: args.workspaceId, context, - model, + model: DEFAULT_COPILOT_MODEL, headless: true, source: 'mcp', }, diff --git a/apps/sim/app/api/v1/copilot/chat/route.ts b/apps/sim/app/api/v1/copilot/chat/route.ts index fbce426bb..9a71ee54b 100644 --- a/apps/sim/app/api/v1/copilot/chat/route.ts +++ b/apps/sim/app/api/v1/copilot/chat/route.ts @@ -1,7 +1,6 @@ import { createLogger } from '@sim/logger' import { type NextRequest, NextResponse } from 'next/server' import { z } from 'zod' -import { getCopilotModel } from '@/lib/copilot/config' import { SIM_AGENT_VERSION } from '@/lib/copilot/constants' import { COPILOT_REQUEST_MODES } from '@/lib/copilot/models' import { orchestrateCopilotStream } from '@/lib/copilot/orchestrator' @@ -9,6 +8,7 @@ import { resolveWorkflowIdForUser } from '@/lib/workflows/utils' import { authenticateV1Request } from '@/app/api/v1/auth' const logger = createLogger('CopilotHeadlessAPI') +const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6' const RequestSchema = z.object({ message: z.string().min(1, 'message is required'), @@ -42,8 +42,7 @@ export async function POST(req: NextRequest) { try { const body = await req.json() const parsed = RequestSchema.parse(body) - const defaults = getCopilotModel() - const selectedModel = parsed.model || defaults.model + const selectedModel = parsed.model || DEFAULT_COPILOT_MODEL // Resolve workflow ID const resolved = await resolveWorkflowIdForUser( diff --git a/apps/sim/lib/copilot/config.ts b/apps/sim/lib/copilot/config.ts deleted file mode 100644 index e69de29bb..000000000