From 99bd9db590793382d23a83ce3e70c8ebabcbc2ae Mon Sep 17 00:00:00 2001 From: rUv Date: Fri, 12 Jun 2026 09:48:20 -0400 Subject: [PATCH] fix(agent-execute): refresh retired OpenRouter Claude slugs (#2357 Finding C) (#2365) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenAI-compat path (used for OPENROUTER_API_KEY callers) still referenced the Oct-2025 retired model IDs: - defaultModel: anthropic/claude-3.5-sonnet → anthropic/claude-sonnet-4-6 - haiku alias: anthropic/claude-3.5-haiku → anthropic/claude-haiku-4-5 - sonnet alias: anthropic/claude-3.5-sonnet → anthropic/claude-sonnet-4-6 - opus alias: anthropic/claude-3-opus → anthropic/claude-opus-4-8 Aligns with MODEL_MAP (the canonical Anthropic resolution table). OPENROUTER_DEFAULT_MODEL still wins for callers who want to pin a different slug. Companion fix to PR #2358 (Finding A, merged in b12788777). Together the two cover the entire current frontier family across both the Anthropic native path and the OpenRouter vendored path. Refs #2357. --- .../cli/src/mcp-tools/agent-execute-core.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/v3/@claude-flow/cli/src/mcp-tools/agent-execute-core.ts b/v3/@claude-flow/cli/src/mcp-tools/agent-execute-core.ts index eda5830638..0b7228b6b0 100644 --- a/v3/@claude-flow/cli/src/mcp-tools/agent-execute-core.ts +++ b/v3/@claude-flow/cli/src/mcp-tools/agent-execute-core.ts @@ -132,7 +132,11 @@ export async function callAnthropicMessages(input: AnthropicCallInput): Promise< apiKey: openrouterKey, baseUrl: process.env.OPENROUTER_BASE_URL || 'https://openrouter.ai/api', providerLabel: 'openrouter', - defaultModel: process.env.OPENROUTER_DEFAULT_MODEL || 'anthropic/claude-3.5-sonnet', + // #2357 Finding C: anthropic/claude-3.5-sonnet was retired Oct 2025. + // Default to the same canonical family the rest of the resolver uses + // (MODEL_MAP). `OPENROUTER_DEFAULT_MODEL` still wins for callers who + // want to pin a specific OpenRouter slug. + defaultModel: process.env.OPENROUTER_DEFAULT_MODEL || 'anthropic/claude-sonnet-4-6', }); } if (useOllama && ollamaKey) { @@ -392,10 +396,12 @@ async function callOpenAICompat( function resolveOpenAICompatModel(input: string | undefined, fallback: string): string { if (!input) return fallback; - // Logical Claude names → OpenRouter Anthropic-vendored names - if (input === 'haiku') return 'anthropic/claude-3.5-haiku'; - if (input === 'sonnet' || input === 'inherit') return 'anthropic/claude-3.5-sonnet'; - if (input === 'opus') return 'anthropic/claude-3-opus'; + // Logical Claude names → OpenRouter Anthropic-vendored names. + // #2357 Finding C: the 3.5 / 3-opus slugs were retired Oct 2025; align with + // MODEL_MAP (claude-haiku-4-5 / claude-sonnet-4-6 / claude-opus-4-8). + if (input === 'haiku') return 'anthropic/claude-haiku-4-5'; + if (input === 'sonnet' || input === 'inherit') return 'anthropic/claude-sonnet-4-6'; + if (input === 'opus') return 'anthropic/claude-opus-4-8'; return input; }