Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/common/utils/ai/modelDisplay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
11 changes: 11 additions & 0 deletions src/common/utils/ai/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 4 additions & 0 deletions src/common/utils/ai/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
9 changes: 8 additions & 1 deletion src/common/utils/ai/providerOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
{
Expand Down
17 changes: 17 additions & 0 deletions src/common/utils/thinking/policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)", () => {
Expand All @@ -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", () => {
Expand Down
42 changes: 42 additions & 0 deletions src/common/utils/tokens/models-extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,27 @@ export const modelsExtra: Record<string, ModelData> = {
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
Expand Down Expand Up @@ -175,6 +196,27 @@ export const modelsExtra: Record<string, ModelData> = {
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
Expand Down
3 changes: 3 additions & 0 deletions src/common/utils/tools/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Loading