From b832e9253d2e62b4ce9e10a7a9a0f8d0263c3490 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Mon, 29 Sep 2025 13:40:34 -0500 Subject: [PATCH] fix: correct Claude Sonnet 4.5 model ID format Changed 'anthropic/claude-4.5-sonnet' to 'anthropic/claude-sonnet-4.5' to match the correct naming convention where the version number comes after 'sonnet'. Updated in: - packages/types/src/providers/openrouter.ts (3 occurrences) - src/api/providers/fetchers/__tests__/openrouter.spec.ts (4 occurrences) --- packages/types/src/providers/openrouter.ts | 6 +++--- src/api/providers/fetchers/__tests__/openrouter.spec.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/types/src/providers/openrouter.ts b/packages/types/src/providers/openrouter.ts index b908f08f2dbd..dde6730e52e0 100644 --- a/packages/types/src/providers/openrouter.ts +++ b/packages/types/src/providers/openrouter.ts @@ -38,7 +38,7 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([ "anthropic/claude-3.7-sonnet:beta", "anthropic/claude-3.7-sonnet:thinking", "anthropic/claude-sonnet-4", - "anthropic/claude-4.5-sonnet", + "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4", "anthropic/claude-opus-4.1", "google/gemini-2.5-flash-preview", @@ -60,7 +60,7 @@ export const OPEN_ROUTER_COMPUTER_USE_MODELS = new Set([ "anthropic/claude-3.7-sonnet:beta", "anthropic/claude-3.7-sonnet:thinking", "anthropic/claude-sonnet-4", - "anthropic/claude-4.5-sonnet", + "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4", "anthropic/claude-opus-4.1", ]) @@ -83,7 +83,7 @@ export const OPEN_ROUTER_REASONING_BUDGET_MODELS = new Set([ "anthropic/claude-opus-4", "anthropic/claude-opus-4.1", "anthropic/claude-sonnet-4", - "anthropic/claude-4.5-sonnet", + "anthropic/claude-sonnet-4.5", "google/gemini-2.5-pro-preview", "google/gemini-2.5-pro", "google/gemini-2.5-flash-preview-05-20", diff --git a/src/api/providers/fetchers/__tests__/openrouter.spec.ts b/src/api/providers/fetchers/__tests__/openrouter.spec.ts index 3517c2be8cef..c5380958226d 100644 --- a/src/api/providers/fetchers/__tests__/openrouter.spec.ts +++ b/src/api/providers/fetchers/__tests__/openrouter.spec.ts @@ -34,7 +34,7 @@ describe("OpenRouter API", () => { "google/gemini-2.5-flash", // OpenRouter doesn't report this as supporting prompt caching "google/gemini-2.5-flash-lite-preview-06-17", // OpenRouter doesn't report this as supporting prompt caching "anthropic/claude-opus-4.1", // Not yet available in OpenRouter API - "anthropic/claude-4.5-sonnet", // Not yet available in OpenRouter API + "anthropic/claude-sonnet-4.5", // Not yet available in OpenRouter API ]) const ourCachingModels = Array.from(OPEN_ROUTER_PROMPT_CACHING_MODELS).filter( @@ -53,7 +53,7 @@ describe("OpenRouter API", () => { const excludedComputerUseModels = new Set([ "anthropic/claude-opus-4.1", // Not yet available in OpenRouter API - "anthropic/claude-4.5-sonnet", // Not yet available in OpenRouter API + "anthropic/claude-sonnet-4.5", // Not yet available in OpenRouter API ]) const expectedComputerUseModels = Array.from(OPEN_ROUTER_COMPUTER_USE_MODELS) @@ -136,7 +136,7 @@ describe("OpenRouter API", () => { "google/gemini-2.5-flash-lite-preview-06-17", "google/gemini-2.5-pro", "anthropic/claude-opus-4.1", // Not yet available in OpenRouter API - "anthropic/claude-4.5-sonnet", // Not yet available in OpenRouter API + "anthropic/claude-sonnet-4.5", // Not yet available in OpenRouter API ]) const expectedReasoningBudgetModels = Array.from(OPEN_ROUTER_REASONING_BUDGET_MODELS)