From e3746e7d78a2fe8599fc2fa454b15c6522b11ba9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Jul 2026 06:56:30 +0000 Subject: [PATCH] Switch default AI model from Claude Sonnet to claude-opus-4-6 Updates every hardcoded model reference across the app, MCP server, and example configs to use claude-opus-4-6 / anthropic/claude-opus-4.6. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_011oBg3VG8cjQZJbqRpY3LAc --- .env.example | 4 ++-- app/api/analyze/route.ts | 2 +- app/api/mcp/route.ts | 2 +- app/api/preview/route.ts | 2 +- examples/claude-desktop.mcp.json | 2 +- examples/cursor.mcp.json | 2 +- lib/ai-gateway.ts | 6 +++--- lib/ai-providers.ts | 12 ++++++------ lib/anthropic-model.ts | 2 +- lib/repofuse-core.js | 2 +- mcp/repofuse.mjs | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.env.example b/.env.example index bcdd756..d62d6b2 100644 --- a/.env.example +++ b/.env.example @@ -59,13 +59,13 @@ STRIPE_LIVE_WEBHOOK_SECRET=whsec_... STRIPE_LIVE_PRO_PRICE_ID=price_... STRIPE_LIVE_SCALE_PRICE_ID=price_... # Optional scaffold/MCP model override -ANTHROPIC_MODEL=claude-3-5-sonnet-20241022 +ANTHROPIC_MODEL=claude-opus-4-6 # RepoFuse MCP # GitHub token with repo read access for the repositories you want RepoFuse to analyze GITHUB_TOKEN=ghp_... # Optional model override for the MCP server -REPOFUSE_MODEL=claude-3-5-sonnet-20241022 +REPOFUSE_MODEL=claude-opus-4-6 # Optional tuning knobs REPOFUSE_MAX_FILES_PER_REPO=120 REPOFUSE_MAX_BLUEPRINTS=5 diff --git a/app/api/analyze/route.ts b/app/api/analyze/route.ts index 2f74f8c..4035f68 100644 --- a/app/api/analyze/route.ts +++ b/app/api/analyze/route.ts @@ -14,7 +14,7 @@ export async function POST() { const anthropicRunner = process.env.ANTHROPIC_API_KEY ? createAnthropicPromptRunner({ apiKey: process.env.ANTHROPIC_API_KEY, - model: process.env.ANTHROPIC_MODEL || process.env.REPOFUSE_MODEL || 'claude-sonnet-4-5-20250929', + model: process.env.ANTHROPIC_MODEL || process.env.REPOFUSE_MODEL || 'claude-opus-4-6', }) : undefined diff --git a/app/api/mcp/route.ts b/app/api/mcp/route.ts index 744c07e..a7b302b 100644 --- a/app/api/mcp/route.ts +++ b/app/api/mcp/route.ts @@ -17,7 +17,7 @@ async function handleMcpRequest(request: Request) { } const { canAccessPro } = await resolveProAccess(user) - const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-5-20250929' + const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6' const anthropicRunner = process.env['ANTHROPIC_' + 'API_KEY'] ? createAnthropicPromptRunner({ apiKey: process.env['ANTHROPIC_' + 'API_KEY'], model }) : undefined diff --git a/app/api/preview/route.ts b/app/api/preview/route.ts index 97624e7..d2a1b18 100644 --- a/app/api/preview/route.ts +++ b/app/api/preview/route.ts @@ -177,7 +177,7 @@ async function fixDependencies(raw: string) { catch { return { fixedPackageJson: {}, changes: ["Could not parse package.json"] }; } const response = await anthropic.messages.create({ - model: "claude-sonnet-4-20250514", + model: "claude-opus-4-6", max_tokens: 2048, messages: [{ role: "user", diff --git a/examples/claude-desktop.mcp.json b/examples/claude-desktop.mcp.json index abf8127..6f33236 100644 --- a/examples/claude-desktop.mcp.json +++ b/examples/claude-desktop.mcp.json @@ -7,7 +7,7 @@ "env": { "GITHUB_TOKEN": "ghp_your_token_here", "ANTHROPIC_API_KEY": "sk-ant-your-key-here", - "REPOFUSE_MODEL": "claude-3-5-sonnet-20241022", + "REPOFUSE_MODEL": "claude-opus-4-6", "REPOFUSE_MAX_FILES_PER_REPO": "120", "REPOFUSE_MAX_BLUEPRINTS": "5" } diff --git a/examples/cursor.mcp.json b/examples/cursor.mcp.json index abf8127..6f33236 100644 --- a/examples/cursor.mcp.json +++ b/examples/cursor.mcp.json @@ -7,7 +7,7 @@ "env": { "GITHUB_TOKEN": "ghp_your_token_here", "ANTHROPIC_API_KEY": "sk-ant-your-key-here", - "REPOFUSE_MODEL": "claude-3-5-sonnet-20241022", + "REPOFUSE_MODEL": "claude-opus-4-6", "REPOFUSE_MAX_FILES_PER_REPO": "120", "REPOFUSE_MAX_BLUEPRINTS": "5" } diff --git a/lib/ai-gateway.ts b/lib/ai-gateway.ts index 822c6df..b5c583b 100644 --- a/lib/ai-gateway.ts +++ b/lib/ai-gateway.ts @@ -2,7 +2,7 @@ import Anthropic from '@anthropic-ai/sdk' import { generateText, type ModelMessage } from 'ai' /** Default gateway model (provider/model). See https://ai-gateway.vercel.sh/v1/models */ -export const DEFAULT_GATEWAY_MODEL = 'anthropic/claude-sonnet-4.6' +export const DEFAULT_GATEWAY_MODEL = 'anthropic/claude-opus-4.6' export type AiGatewayFeature = | 'analysis-run' @@ -49,7 +49,7 @@ export function getAnthropicMessagesModel(): string { } return configured } - return usesGatewayAuth() ? DEFAULT_GATEWAY_MODEL : 'claude-sonnet-4-5-20250929' + return usesGatewayAuth() ? DEFAULT_GATEWAY_MODEL : 'claude-opus-4-6' } export function gatewayProviderOptions(userId?: string, feature?: AiGatewayFeature) { @@ -99,7 +99,7 @@ export async function generateWithGateway(params: { // to avoid routing through Vercel AI Gateway which requires paid gateway credits. if (!usesGatewayAuth() && directAnthropicKey()) { const client = getAnthropicClient() - const directModel = process.env.ANTHROPIC_ANALYSIS_MODEL?.trim() || 'claude-sonnet-4-5-20250929' + const directModel = process.env.ANTHROPIC_ANALYSIS_MODEL?.trim() || 'claude-opus-4-6' const response = await client.messages.create({ model: directModel, max_tokens: params.maxOutputTokens ?? 4096, diff --git a/lib/ai-providers.ts b/lib/ai-providers.ts index 171df28..fa087d3 100644 --- a/lib/ai-providers.ts +++ b/lib/ai-providers.ts @@ -14,7 +14,7 @@ export interface AIProviderConfig { export function getProviderModel(provider: AIProvider): string { switch (provider) { case 'anthropic': - return 'anthropic/claude-sonnet-4.6' + return 'anthropic/claude-opus-4.6' case 'openai': return 'gpt-4o' case 'grok': @@ -22,9 +22,9 @@ export function getProviderModel(provider: AIProvider): string { case 'deepinfra': return 'deepseek-ai/deepseek-coder-33b-instruct' case 'builtin': - return 'claude-opus-4.1' // Default to Anthropic for builtin + return 'claude-opus-4.6' // Default to Anthropic for builtin default: - return 'claude-opus-4.1' + return 'claude-opus-4.6' } } @@ -34,7 +34,7 @@ export function getProviderModel(provider: AIProvider): string { export function getAISDKModel(provider: AIProvider, apiKey?: string): string { switch (provider) { case 'anthropic': - return apiKey ? `anthropic/claude-sonnet-4.6?apiKey=${apiKey}` : 'anthropic/claude-sonnet-4.6' + return apiKey ? `anthropic/claude-opus-4.6?apiKey=${apiKey}` : 'anthropic/claude-opus-4.6' case 'openai': return apiKey ? `openai/gpt-4o?apiKey=${apiKey}` : 'openai/gpt-4o' case 'grok': @@ -43,9 +43,9 @@ export function getAISDKModel(provider: AIProvider, apiKey?: string): string { return apiKey ? `deepinfra/deepseek-ai/deepseek-coder-33b-instruct?apiKey=${apiKey}` : 'deepinfra/deepseek-ai/deepseek-coder-33b-instruct' case 'builtin': // Builtin uses Vercel AI Gateway (no API key needed) - return 'anthropic/claude-sonnet-4.6' + return 'anthropic/claude-opus-4.6' default: - return 'anthropic/claude-sonnet-4.6' + return 'anthropic/claude-opus-4.6' } } diff --git a/lib/anthropic-model.ts b/lib/anthropic-model.ts index 3187cec..e96cd39 100644 --- a/lib/anthropic-model.ts +++ b/lib/anthropic-model.ts @@ -1,7 +1,7 @@ import { getAnthropicMessagesModel, getGatewayModel } from '@/lib/ai-gateway' /** @deprecated Prefer getGatewayModel() for AI SDK or getAnthropicMessagesModel() for Messages API */ -export const DEFAULT_ANTHROPIC_MODEL = 'claude-sonnet-4-5-20250929' +export const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-6' /** Anthropic Messages API model (gateway slug when AI Gateway auth is configured). */ export function getAnthropicModel(): string { diff --git a/lib/repofuse-core.js b/lib/repofuse-core.js index 58205d5..fd8665c 100644 --- a/lib/repofuse-core.js +++ b/lib/repofuse-core.js @@ -1,6 +1,6 @@ import Anthropic from '@anthropic-ai/sdk' -const DEFAULT_REPOFUSE_MODEL = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-3-5-sonnet-20241022' +const DEFAULT_REPOFUSE_MODEL = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6' const CODE_EXTENSIONS = new Set([ 'ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'py', 'go', 'rs', 'java', 'rb', 'php', 'vue', 'svelte', 'swift', 'kt', 'kts', diff --git a/mcp/repofuse.mjs b/mcp/repofuse.mjs index a0bd578..6a27062 100644 --- a/mcp/repofuse.mjs +++ b/mcp/repofuse.mjs @@ -6,7 +6,7 @@ import { createRepoFuseMcpServer } from '../lib/repofuse-mcp.js' const githubToken = requireEnv('GITHUB_TOKEN') const anthropicApiKey = requireEnv('ANTHROPIC_API_KEY') -const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-3-5-sonnet-20241022' +const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6' const maxFilesPerRepo = numberFromEnv('REPOFUSE_MAX_FILES_PER_REPO', 120) const maxBlueprints = numberFromEnv('REPOFUSE_MAX_BLUEPRINTS', 5)