From ada8a9a168516d44cf86343038c7772388d8134e Mon Sep 17 00:00:00 2001 From: Suhwan Choi Date: Sat, 1 Aug 2026 06:05:01 +0000 Subject: [PATCH] fix(providers): give Claude 4.6/4.7 their 1M context windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Claude-Session: https://claude.ai/code/session_01MqLtuGeb1Mb2izcYRZXgT4 --- src/providers/registry.ts | 2 +- tests/provider-registry-parity.test.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/providers/registry.ts b/src/providers/registry.ts index 48ad865eb..df65bbb1b 100644 --- a/src/providers/registry.ts +++ b/src/providers/registry.ts @@ -214,7 +214,7 @@ export type ProviderConfigSeed = Pick< // 260710 context refresh: Tier-2 evidence in // devlog/_plan/260710_provider_hardening/001_research_frontier.md. 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"]; -const ANTHROPIC_MODEL_CONTEXT_WINDOWS: Record = { "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 }; +const ANTHROPIC_MODEL_CONTEXT_WINDOWS: Record = { "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 }; const ZAI_GLM_52_MODELS = ["glm-5.2", "glm-5.2[1m]"]; const ZAI_GLM_52_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"]; diff --git a/tests/provider-registry-parity.test.ts b/tests/provider-registry-parity.test.ts index 3ed777716..744c9aa0a 100644 --- a/tests/provider-registry-parity.test.ts +++ b/tests/provider-registry-parity.test.ts @@ -607,6 +607,13 @@ describe("provider registry parity", () => { expect(OAUTH_PROVIDERS.anthropic.providerConfig.models).toContain("claude-sonnet-5"); expect(OAUTH_PROVIDERS.anthropic.providerConfig.models).toContain("claude-fable-5"); expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-sonnet-5"]).toBe(1_000_000); + expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-opus-4-7"]).toBe(1_000_000); + expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-opus-4-6"]).toBe(1_000_000); + expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.["claude-sonnet-4-6"]).toBe(1_000_000); + // A missing window makes the model advertise max_input_tokens: null and lose its [1m] picker row. + for (const model of OAUTH_PROVIDERS.anthropic.providerConfig.models ?? []) { + expect(OAUTH_PROVIDERS.anthropic.providerConfig.modelContextWindows?.[model]).toBeGreaterThan(0); + } expect(OAUTH_PROVIDERS.xai.providerConfig.defaultModel).toBe("grok-4.5"); expect(OAUTH_PROVIDERS.xai.providerConfig.liveModels).toBe(true); expect(OAUTH_PROVIDERS.xai.providerConfig.models).toContain("grok-4.5");