| ... | @@ -51,6 +51,7 @@ const CLAUDE_PRESENTATION = { | ... | @@ -51,6 +51,7 @@ const CLAUDE_PRESENTATION = { |
| 51 | displayName: "Claude", | 51 | displayName: "Claude", |
| 52 | showInteractionModeToggle: true, | 52 | showInteractionModeToggle: true, |
| 53 | } as const; | 53 | } as const; |
| | 54 | const MINIMUM_CLAUDE_OPUS_5_VERSION = "2.1.219"; |
| 54 | const MINIMUM_CLAUDE_FABLE_5_VERSION = "2.1.169"; | 55 | const MINIMUM_CLAUDE_FABLE_5_VERSION = "2.1.169"; |
| 55 | const MINIMUM_CLAUDE_OPUS_4_8_VERSION = "2.1.154"; | 56 | const MINIMUM_CLAUDE_OPUS_4_8_VERSION = "2.1.154"; |
| 56 | const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111"; | 57 | const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111"; |
| ... | @@ -87,6 +88,42 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [ | ... | @@ -87,6 +88,42 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [ |
| 87 | ], | 88 | ], |
| 88 | }), | 89 | }), |
| 89 | }, | 90 | }, |
| | 91 | { |
| | 92 | slug: "claude-opus-5", |
| | 93 | name: "Claude Opus 5", |
| | 94 | isCustom: false, |
| | 95 | capabilities: createModelCapabilities({ |
| | 96 | optionDescriptors: [ |
| | 97 | buildSelectOptionDescriptor({ |
| | 98 | id: "effort", |
| | 99 | label: "Reasoning", |
| | 100 | options: [ |
| | 101 | { value: "low", label: "Low" }, |
| | 102 | { value: "medium", label: "Medium" }, |
| | 103 | { value: "high", label: "High", isDefault: true }, |
| | 104 | { value: "xhigh", label: "Extra High" }, |
| | 105 | { value: "max", label: "Max" }, |
| | 106 | { value: "ultracode", label: "Ultracode" }, |
| | 107 | { value: "ultrathink", label: "Ultrathink" }, |
| | 108 | ], |
| | 109 | promptInjectedValues: ["ultrathink"], |
| | 110 | }), |
| | 111 | buildBooleanOptionDescriptor({ |
| | 112 | id: "fastMode", |
| | 113 | label: "Fast Mode", |
| | 114 | }), |
| | 115 | buildSelectOptionDescriptor({ |
| | 116 | id: "contextWindow", |
| | 117 | label: "Context Window", |
| | 118 | // Claude Code selects the 1M variant explicitly (`claude-opus-5[1m]`). |
| | 119 | options: [ |
| | 120 | { value: "200k", label: "200k" }, |
| | 121 | { value: "1m", label: "1M", isDefault: true }, |
| | 122 | ], |
| | 123 | }), |
| | 124 | ], |
| | 125 | }), |
| | 126 | }, |
| 90 | { | 127 | { |
| 91 | slug: "claude-opus-4-8", | 128 | slug: "claude-opus-4-8", |
| 92 | name: "Claude Opus 4.8", | 129 | name: "Claude Opus 4.8", |
| ... | @@ -272,6 +309,10 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [ | ... | @@ -272,6 +309,10 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [ |
| 272 | }, | 309 | }, |
| 273 | ]; | 310 | ]; |
| 274 | | 311 | |
| | 312 | function supportsClaudeOpus5(version: string | null | undefined): boolean { |
| | 313 | return version ? compareSemverVersions(version, MINIMUM_CLAUDE_OPUS_5_VERSION) >= 0 : false; |
| | 314 | } |
| | 315 | |
| 275 | function supportsClaudeFable5(version: string | null | undefined): boolean { | 316 | function supportsClaudeFable5(version: string | null | undefined): boolean { |
| 276 | return version ? compareSemverVersions(version, MINIMUM_CLAUDE_FABLE_5_VERSION) >= 0 : false; | 317 | return version ? compareSemverVersions(version, MINIMUM_CLAUDE_FABLE_5_VERSION) >= 0 : false; |
| 277 | } | 318 | } |
| ... | @@ -288,6 +329,9 @@ function getBuiltInClaudeModelsForVersion( | ... | @@ -288,6 +329,9 @@ function getBuiltInClaudeModelsForVersion( |
| 288 | version: string | null | undefined, | 329 | version: string | null | undefined, |
| 289 | ): ReadonlyArray<ServerProviderModel> { | 330 | ): ReadonlyArray<ServerProviderModel> { |
| 290 | return BUILT_IN_MODELS.filter((model) => { | 331 | return BUILT_IN_MODELS.filter((model) => { |
| | 332 | if (model.slug === "claude-opus-5") { |
| | 333 | return supportsClaudeOpus5(version); |
| | 334 | } |
| 291 | if (model.slug === "claude-fable-5") { | 335 | if (model.slug === "claude-fable-5") { |
| 292 | return supportsClaudeFable5(version); | 336 | return supportsClaudeFable5(version); |
| 293 | } | 337 | } |
| ... | @@ -301,6 +345,11 @@ function getBuiltInClaudeModelsForVersion( | ... | @@ -301,6 +345,11 @@ function getBuiltInClaudeModelsForVersion( |
| 301 | }); | 345 | }); |
| 302 | } | 346 | } |
| 303 | | 347 | |
| | 348 | function formatClaudeOpus5UpgradeMessage(version: string | null): string { |
| | 349 | const versionLabel = version ? `v${version}` : "the installed version"; |
| | 350 | return `Claude Code ${versionLabel} is too old for Claude Opus 5. Upgrade to v${MINIMUM_CLAUDE_OPUS_5_VERSION} or newer to access it.`; |
| | 351 | } |
| | 352 | |
| 304 | function formatClaudeFable5UpgradeMessage(version: string | null): string { | 353 | function formatClaudeFable5UpgradeMessage(version: string | null): string { |
| 305 | const versionLabel = version ? `v${version}` : "the installed version"; | 354 | const versionLabel = version ? `v${version}` : "the installed version"; |
| 306 | return `Claude Code ${versionLabel} is too old for Claude Fable 5. Upgrade to v${MINIMUM_CLAUDE_FABLE_5_VERSION} or newer to access it.`; | 355 | return `Claude Code ${versionLabel} is too old for Claude Fable 5. Upgrade to v${MINIMUM_CLAUDE_FABLE_5_VERSION} or newer to access it.`; |
| ... | @@ -360,6 +409,7 @@ export function normalizeClaudeCliEffort( | ... | @@ -360,6 +409,7 @@ export function normalizeClaudeCliEffort( |
| 360 | if ( | 409 | if ( |
| 361 | effort === "xhigh" && | 410 | effort === "xhigh" && |
| 362 | model !== "claude-fable-5" && | 411 | model !== "claude-fable-5" && |
| | 412 | model !== "claude-opus-5" && |
| 363 | model !== "claude-opus-4-8" && | 413 | model !== "claude-opus-4-8" && |
| 364 | model !== "claude-sonnet-5" | 414 | model !== "claude-sonnet-5" |
| 365 | ) { | 415 | ) { |
| ... | @@ -837,13 +887,15 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( | ... | @@ -837,13 +887,15 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( |
| 837 | claudeSettings.customModels, | 887 | claudeSettings.customModels, |
| 838 | DEFAULT_CLAUDE_MODEL_CAPABILITIES, | 888 | DEFAULT_CLAUDE_MODEL_CAPABILITIES, |
| 839 | ); | 889 | ); |
| 840 | const versionUpgradeMessage = supportsClaudeFable5(parsedVersion) | 890 | const versionUpgradeMessage = supportsClaudeOpus5(parsedVersion) |
| 841 | ? undefined | 891 | ? undefined |
| 842 | : supportsClaudeOpus48(parsedVersion) | 892 | : supportsClaudeFable5(parsedVersion) |
| 843 | ? formatClaudeFable5UpgradeMessage(parsedVersion) | 893 | ? formatClaudeOpus5UpgradeMessage(parsedVersion) |
| 844 | : supportsClaudeOpus47(parsedVersion) | 894 | : supportsClaudeOpus48(parsedVersion) |
| 845 | ? formatClaudeOpus48UpgradeMessage(parsedVersion) | 895 | ? formatClaudeFable5UpgradeMessage(parsedVersion) |
| 846 | : formatClaudeOpus47UpgradeMessage(parsedVersion); | 896 | : supportsClaudeOpus47(parsedVersion) |
| | 897 | ? formatClaudeOpus48UpgradeMessage(parsedVersion) |
| | 898 | : formatClaudeOpus47UpgradeMessage(parsedVersion); |
| 847 | | 899 | |
| 848 | const capabilities = resolveCapabilities | 900 | const capabilities = resolveCapabilities |
| 849 | ? yield* resolveCapabilities(claudeSettings).pipe(Effect.orElseSucceed(() => undefined)) | 901 | ? yield* resolveCapabilities(claudeSettings).pipe(Effect.orElseSucceed(() => undefined)) |