Skip to content

Commit ada8a9a

Browse files
MilkCloudsclaude
andcommitted
fix(providers): give Claude 4.6/4.7 their 1M context windows
ANTHROPIC_MODEL_CONTEXT_WINDOWS omitted claude-opus-4-7, claude-opus-4-6, and claude-sonnet-4-6 even though all three ship in ANTHROPIC_MODELS. Without a window those models advertise max_input_tokens: null, shouldMarkOneMillion() rejects them on its typeof guard, and buildAnthropicModelInfos never emits the [1m] picker row — so Claude Code accounts them at its 200k default instead of the 1M Anthropic documents for all three. Also guard the whole roster: every model in the anthropic provider's list must carry a context window, so the next model addition cannot repeat the omission. The loop was driven red against the unfixed map before landing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MqLtuGeb1Mb2izcYRZXgT4
1 parent e1fc0f2 commit ada8a9a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/providers/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export type ProviderConfigSeed = Pick<
214214
// 260710 context refresh: Tier-2 evidence in
215215
// devlog/_plan/260710_provider_hardening/001_research_frontier.md.
216216
const ANTHROPIC_MODELS = ["claude-fable-5", "claude-sonnet-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-opus-4-6", "claude-sonnet-4-6", "claude-haiku-4-5"];
217-
const ANTHROPIC_MODEL_CONTEXT_WINDOWS: Record<string, number> = { "claude-sonnet-5": 1_000_000, "claude-fable-5": 1_000_000, "claude-opus-5": 1_000_000, "claude-opus-4-8": 1_000_000, "claude-haiku-4-5": 200_000 };
217+
const ANTHROPIC_MODEL_CONTEXT_WINDOWS: Record<string, number> = { "claude-sonnet-5": 1_000_000, "claude-fable-5": 1_000_000, "claude-opus-5": 1_000_000, "claude-opus-4-8": 1_000_000, "claude-opus-4-7": 1_000_000, "claude-opus-4-6": 1_000_000, "claude-sonnet-4-6": 1_000_000, "claude-haiku-4-5": 200_000 };
218218

219219
const ZAI_GLM_52_MODELS = ["glm-5.2", "glm-5.2[1m]"];
220220
const ZAI_GLM_52_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"];

‎tests/provider-registry-parity.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,13 @@ describe("provider registry parity", () => {
607607
expect(OAUTH_PROVIDERS.anthropic.providerConfig.models).toContain("claude-sonnet-5");
608608
expect(OAUTH_PROVIDERS.anthropic.providerConfig.models).toContain("claude-fable-5");
609609
expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-sonnet-5"]).toBe(1_000_000);
610+
expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-opus-4-7"]).toBe(1_000_000);
611+
expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-opus-4-6"]).toBe(1_000_000);
612+
expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-sonnet-4-6"]).toBe(1_000_000);
613+
// A missing window makes the model advertise max_input_tokens: null and lose its [1m] picker row.
614+
for (const model of OAUTH_PROVIDERS.anthropic.providerConfig.models ?? []) {
615+
expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.[model]).toBeGreaterThan(0);
616+
}
610617
expect(OAUTH_PROVIDERS.xai.providerConfig.defaultModel).toBe("grok-4.5");
611618
expect(OAUTH_PROVIDERS.xai.providerConfig.liveModels).toBe(true);
612619
expect(OAUTH_PROVIDERS.xai.providerConfig.models).toContain("grok-4.5");

0 commit comments

Comments
 (0)