feat(claude): default xhigh support for newer Opus models (#2874)

Integrated into release/v3.8.6.
This commit is contained in:
Randi
2026-05-29 00:44:58 -04:00
committed by GitHub
parent 517c3c6e44
commit 2428ad2bcd
23 changed files with 181 additions and 30 deletions

View File

@@ -103,7 +103,10 @@ export async function getSettings() {
autoRefreshProviderQuotaInterval: 180,
comboConfigMode: "guided",
codexServiceTier: { enabled: false },
claudeFastMode: { enabled: false, supportedModels: ["claude-opus-4-7", "claude-opus-4-6"] },
claudeFastMode: {
enabled: false,
supportedModels: ["claude-opus-4-8", "claude-opus-4-7", "claude-opus-4-6"],
},
codexSessionAffinityTtlMs: 0,
alwaysPreserveClientCache: "auto",
idempotencyWindowMs: 5000,

View File

@@ -6,7 +6,11 @@ type JsonRecord = Record<string, unknown>;
* Mirrors the binary-side gate observed in claude-code v2.1.145 (KT() check):
* only the latest Opus tiers can request the priority service path.
*/
export const CLAUDE_FAST_MODE_DEFAULT_MODELS = ["claude-opus-4-7", "claude-opus-4-6"] as const;
export const CLAUDE_FAST_MODE_DEFAULT_MODELS = [
"claude-opus-4-8",
"claude-opus-4-7",
"claude-opus-4-6",
] as const;
function asRecord(value: unknown): JsonRecord {
return value && typeof value === "object" && !Array.isArray(value) ? (value as JsonRecord) : {};
@@ -39,7 +43,7 @@ export function isClaudeFastModeEnabled(settings: unknown): boolean {
/**
* Returns the configured supported-model list, defaulting to the conservative
* Opus 4-7 / 4-6 pair (matches the binary KT() gate).
* Opus 4-8 / 4-7 / 4-6 set.
*/
export function getClaudeFastModeSupportedModels(settings: unknown): string[] {
const record = asRecord(settings);
@@ -51,7 +55,7 @@ export function getClaudeFastModeSupportedModels(settings: unknown): string[] {
/**
* True when the toggle is on AND the model id prefix-matches a supported model.
* Prefix matching tolerates dated suffixes (e.g. claude-opus-4-7-20260201).
* Prefix matching tolerates dated suffixes (e.g. claude-opus-4-8-20260528).
*/
export function shouldRequestClaudeFastMode(
settings: unknown,

View File

@@ -37,6 +37,7 @@ const STATIC_MODEL_PROVIDERS: Record<string, () => Array<{ id: string; name: str
],
antigravity: () => ANTIGRAVITY_PUBLIC_MODELS.map((model) => ({ ...model })),
claude: () => [
{ id: "claude-opus-4-8", name: "Claude Opus 4.8" },
{ id: "claude-opus-4-7", name: "Claude Opus 4.7" },
{ id: "claude-opus-4-6", name: "Claude Opus 4.6" },
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },

View File

@@ -187,6 +187,20 @@ export const MODEL_SPECS: Record<string, ModelSpec> = {
aliases: BEDROCK_CLAUDE_ALIASES("claude-opus-4-7", "claude-opus-4.7"),
},
// ── Claude Opus 4.8 ─────────────────────────────────────────────
"claude-opus-4-8": {
maxOutputTokens: 128000,
contextWindow: 1000000,
// Opus 4.8 inherits Opus 4.7's adaptive thinking constraints: no fixed
// thinking budget requests, with effort controlled by output_config.
defaultThinkingBudget: 32000,
thinkingBudgetCap: 120000,
supportsThinking: true,
supportsTools: true,
supportsVision: true,
aliases: BEDROCK_CLAUDE_ALIASES("claude-opus-4-8", "claude-opus-4.8"),
},
// ── Claude Sonnet 4.5 ───────────────────────────────────────────
"claude-sonnet-4-5-20250929": {
maxOutputTokens: 64000,

View File

@@ -129,6 +129,13 @@ export const DEFAULT_PRICING = {
// Claude Code (cc)
cc: {
"claude-opus-4-8": {
input: 5.0,
output: 25.0,
cached: 2.5,
reasoning: 25.0,
cache_creation: 5.0,
},
"claude-opus-4-7": {
input: 5.0,
output: 25.0,
@@ -710,6 +717,9 @@ export const DEFAULT_PRICING = {
// Common model IDs (without dates) used across providers
// Intentional duplicates of dot-notation variants (e.g. claude-opus-4.6)
// to cover hyphen-notation IDs (claude-opus-4-6) used by some clients
"claude-opus-4.8": CLAUDE_OPUS_4_PRICING,
"claude-opus-4-8": CLAUDE_OPUS_4_PRICING,
"claude-opus-4-7": CLAUDE_OPUS_4_PRICING,
"claude-opus-4-6": CLAUDE_OPUS_46_PRICING,
"claude-sonnet-4-6": CLAUDE_SONNET_46_PRICING,
"claude-opus-4-5-20251101": CLAUDE_OPUS_4_PRICING,