diff --git a/src/common/utils/ai/modelDisplay.test.ts b/src/common/utils/ai/modelDisplay.test.ts index 0aa441b440..0480ff7958 100644 --- a/src/common/utils/ai/modelDisplay.test.ts +++ b/src/common/utils/ai/modelDisplay.test.ts @@ -29,6 +29,11 @@ describe("formatModelDisplayName", () => { expect(formatModelDisplayName("claude-fable-5")).toBe("Fable 5"); expect(formatModelDisplayName("claude-mythos-5")).toBe("Mythos 5"); }); + + test("formats pre-release Opus 5.1 / Fable 5.1 ids", () => { + expect(formatModelDisplayName("claude-opus-5-1")).toBe("Opus 5.1"); + expect(formatModelDisplayName("claude-fable-5-1")).toBe("Fable 5.1"); + }); }); describe("GPT models", () => { diff --git a/src/common/utils/ai/models.test.ts b/src/common/utils/ai/models.test.ts index f4eab11f21..ec60f24e7e 100644 --- a/src/common/utils/ai/models.test.ts +++ b/src/common/utils/ai/models.test.ts @@ -167,6 +167,17 @@ describe("Anthropic 1M context classification", () => { expect(hasNative1MContext("anthropic:claude-sonnet-5")).toBe(true); }); + it("treats pre-release Opus 5.1 / Fable 5.1 as native 1M models", () => { + // Seeded from their direct predecessors (Opus 5 / Fable 5); confirm at release. + expect(getAnthropic1MContextMode("anthropic:claude-opus-5-1")).toBe("native"); + expect(getAnthropic1MContextMode("anthropic:claude-opus-5-1-20260901")).toBe("native"); + expect(getAnthropic1MContextMode("anthropic:claude-fable-5-1")).toBe("native"); + expect(getAnthropic1MContextMode("mux-gateway:anthropic/claude-fable-5-1")).toBe("native"); + expect(hasNative1MContext("anthropic:claude-opus-5-1")).toBe(true); + expect(supports1MContext("anthropic:claude-opus-5-1")).toBe(false); + expect(supports1MContext("anthropic:claude-fable-5-1")).toBe(false); + }); + it("treats Mythos-class Fable 5 / Mythos 5 as native 1M models", () => { expect(getAnthropic1MContextMode("anthropic:claude-fable-5")).toBe("native"); expect(getAnthropic1MContextMode("anthropic:claude-mythos-5")).toBe("native"); diff --git a/src/common/utils/ai/models.ts b/src/common/utils/ai/models.ts index f4b4d614ea..790fbee26c 100644 --- a/src/common/utils/ai/models.ts +++ b/src/common/utils/ai/models.ts @@ -180,6 +180,10 @@ const ANTHROPIC_NATIVE_1M_PATTERNS = [ // Mythos-class models (Fable 5 / Mythos 5) ship 1M context as standard metadata. new RegExp(`^claude-fable-5${OPTIONAL_VERSION_SUFFIX}$`, "i"), new RegExp(`^claude-mythos-5${OPTIONAL_VERSION_SUFFIX}$`, "i"), + // Pre-release Fable 5.1 / Opus 5.1: seeded to keep their predecessors' native 1M + // context; confirm against the announcement before release. + new RegExp(`^claude-fable-5-1${OPTIONAL_VERSION_SUFFIX}$`, "i"), + new RegExp(`^claude-opus-5-1${OPTIONAL_VERSION_SUFFIX}$`, "i"), new RegExp(`^claude-opus-5${OPTIONAL_VERSION_SUFFIX}$`, "i"), new RegExp(`^claude-opus-4-8${OPTIONAL_VERSION_SUFFIX}$`, "i"), new RegExp(`^claude-opus-4-7${OPTIONAL_VERSION_SUFFIX}$`, "i"), diff --git a/src/common/utils/ai/providerOptions.test.ts b/src/common/utils/ai/providerOptions.test.ts index 8467dbe0ca..7ca18e1e1b 100644 --- a/src/common/utils/ai/providerOptions.test.ts +++ b/src/common/utils/ai/providerOptions.test.ts @@ -139,7 +139,14 @@ describe("buildProviderOptions - Anthropic", () => { // Native-xhigh models (Opus 4.7+ / Sonnet 5+): xhigh is a distinct native // effort and adaptive thinking requires `display: "summarized"` to return // thinking content. - for (const model of ["claude-opus-4-7", "claude-opus-5", "claude-sonnet-5"] as const) { + // claude-opus-5-1 is the pre-release Opus 5.1 id (unconfirmed): it must inherit + // the same native-xhigh wire transforms as its predecessor. + for (const model of [ + "claude-opus-4-7", + "claude-opus-5", + "claude-opus-5-1", + "claude-sonnet-5", + ] as const) { describe(`${model} (native xhigh effort + summarized display)`, () => { for (const { thinking, expectedThinking, effort } of [ { diff --git a/src/common/utils/thinking/policy.test.ts b/src/common/utils/thinking/policy.test.ts index baa3862272..e479a664a4 100644 --- a/src/common/utils/thinking/policy.test.ts +++ b/src/common/utils/thinking/policy.test.ts @@ -431,6 +431,15 @@ describe("getThinkingPolicyForModel", () => { "xhigh", "max", ]); + // Pre-release Opus 5.1 (unconfirmed id) — inherits the forward-compatible Opus policy. + expect(getThinkingPolicyForModel("anthropic:claude-opus-5-1")).toEqual([ + "off", + "low", + "medium", + "high", + "xhigh", + "max", + ]); }); test("excludes 'off' for Mythos-class Fable 5 / Mythos 5 (API rejects disabled thinking)", () => { @@ -450,6 +459,14 @@ describe("getThinkingPolicyForModel", () => { "xhigh", "max", ]); + // Pre-release Fable 5.1 (unconfirmed id) — inherits the Mythos-class no-"off" policy. + expect(getThinkingPolicyForModel("anthropic:claude-fable-5-1")).toEqual([ + "low", + "medium", + "high", + "xhigh", + "max", + ]); }); test("clamps 'off' up to 'low' for Mythos-class models", () => { diff --git a/src/common/utils/tokens/models-extra.ts b/src/common/utils/tokens/models-extra.ts index e28a1bc340..2741aaff5b 100644 --- a/src/common/utils/tokens/models-extra.ts +++ b/src/common/utils/tokens/models-extra.ts @@ -135,6 +135,27 @@ export const modelsExtra: Record = { supports_pdf_input: true, }, + // Claude Fable 5.1 - PRE-RELEASE, NOT YET ANNOUNCED (unconfirmed id). + // Every value below is seeded from the direct predecessor `claude-fable-5` + // ($10/M input, $50/M output, cache write 1.25x input, cache read 0.1x input, + // native 1M context, 128K max output) and must be confirmed against + // Anthropic's announcement before release. + "claude-fable-5-1": { + max_input_tokens: 1000000, + max_output_tokens: 128000, + input_cost_per_token: 0.00001, // $10 per million input tokens (seeded from Fable 5) + output_cost_per_token: 0.00005, // $50 per million output tokens (seeded from Fable 5) + cache_creation_input_token_cost: 0.0000125, // $12.50 per million tokens (1.25x input) + cache_read_input_token_cost: 0.000001, // $1.00 per million tokens (0.1x input) + litellm_provider: "anthropic", + mode: "chat", + supports_function_calling: true, + supports_vision: true, + supports_pdf_input: true, + supports_reasoning: true, + supports_response_schema: true, + }, + // Claude Fable 5 / Mythos 5 - Released June 9, 2026 // Mythos-class model (a tier above Opus). Fable 5 (`claude-fable-5`) is the // generally-available variant with safeguards; Mythos 5 (`claude-mythos-5`) is the same @@ -175,6 +196,27 @@ export const modelsExtra: Record = { supports_response_schema: true, }, + // Claude Opus 5.1 - PRE-RELEASE, NOT YET ANNOUNCED (unconfirmed id). + // Every value below is seeded from the direct predecessor `claude-opus-5` + // ($5/M input, $25/M output, cache write $6.25, cache read $0.50, native 1M + // context, 128K max output) and must be confirmed against Anthropic's + // announcement before release. + "claude-opus-5-1": { + max_input_tokens: 1000000, + max_output_tokens: 128000, + input_cost_per_token: 0.000005, // $5 per million input tokens (seeded from Opus 5) + output_cost_per_token: 0.000025, // $25 per million output tokens (seeded from Opus 5) + cache_creation_input_token_cost: 0.00000625, // $6.25 per million tokens + cache_read_input_token_cost: 0.0000005, // $0.50 per million tokens + litellm_provider: "anthropic", + mode: "chat", + supports_function_calling: true, + supports_vision: true, + supports_pdf_input: true, + supports_reasoning: true, + supports_response_schema: true, + }, + // Claude Opus 5 - Released July 24, 2026 // Same pricing/shape as Opus 4.8: $5/M input, $25/M output, native 1M context // (both default and maximum), 128K max output, full effort ladder with native diff --git a/src/common/utils/tools/tools.test.ts b/src/common/utils/tools/tools.test.ts index fd5fb8fcf7..b098c3b2e8 100644 --- a/src/common/utils/tools/tools.test.ts +++ b/src/common/utils/tools/tools.test.ts @@ -71,6 +71,9 @@ describe("supportsAnthropicNativeWebFetch", () => { ["claude-opus-5", true], ["claude-fable-5", true], ["claude-mythos-5", true], + // Pre-release 5.1 ids (unconfirmed) parse as major=5 / minor=1 and qualify. + ["claude-opus-5-1", true], + ["claude-fable-5-1", true], // Two-segment IDs at/after the 4.6 cutoff. ["claude-sonnet-4-6", true], ["claude-opus-4-6", true],