From 9f7e4749f645f2a190e5fe1bec4858e6638d2134 Mon Sep 17 00:00:00 2001 From: Jason Hicks Date: Mon, 28 Sep 2026 19:47:46 -0500 Subject: [PATCH] fix(anthropic): correct Opus 5.5 output budget --- packages/types/src/providers/anthropic.ts | 7 ++----- src/api/providers/__tests__/anthropic.spec.ts | 7 +++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/types/src/providers/anthropic.ts b/packages/types/src/providers/anthropic.ts index 8103690da0..7584225aa0 100644 --- a/packages/types/src/providers/anthropic.ts +++ b/packages/types/src/providers/anthropic.ts @@ -165,7 +165,7 @@ export const anthropicModels = { description: "Claude Opus 5 is Anthropic's most capable model for complex agentic coding and enterprise work.", }, "claude-opus-5-5": { - maxTokens: 128_000, // Overridden to 8k if `enableReasoningEffort` is false. + maxTokens: 128_000, contextWindow: 1_000_000, // 1M context window native (no beta header required) supportsImages: true, supportsPromptCache: true, @@ -173,10 +173,7 @@ export const anthropicModels = { outputPrice: 20.0, // $20 per million output tokens cacheWritesPrice: 5.0, // $5 per million tokens cacheReadsPrice: 0.2, // $0.20 per million tokens - // Opus 5.5 keeps the Opus 5 adaptive-thinking / binary-toggle convention on - // the direct Anthropic provider path: manual budget_tokens and non-default - // sampling parameters return a 400. - supportsReasoningBudget: true, + // Opus 5.5 always uses adaptive thinking and rejects manual budget_tokens. supportsReasoningBinary: true, supportsTemperature: false, description: diff --git a/src/api/providers/__tests__/anthropic.spec.ts b/src/api/providers/__tests__/anthropic.spec.ts index 6a3192798f..a53fc62ce5 100644 --- a/src/api/providers/__tests__/anthropic.spec.ts +++ b/src/api/providers/__tests__/anthropic.spec.ts @@ -486,7 +486,6 @@ describe("AnthropicHandler", () => { apiKey: "test-api-key", apiModelId: "claude-opus-5-5", enableReasoningEffort: true, - modelMaxTokens: 32768, }) const stream = opusHandler.createMessage(systemPrompt, [ @@ -502,7 +501,7 @@ describe("AnthropicHandler", () => { const requestOptions = mockCreate.mock.calls[mockCreate.mock.calls.length - 1]?.[1] expect(requestBody?.thinking).toEqual({ type: "adaptive" }) expect(requestBody?.temperature).toBeUndefined() - expect(requestBody?.max_tokens).toBe(32768) + expect(requestBody?.max_tokens).toBe(128_000) expect(requestOptions?.headers?.["anthropic-beta"]).toContain("prompt-caching-2024-07-31") }) @@ -755,9 +754,9 @@ describe("AnthropicHandler", () => { expect(model.info.outputPrice).toBe(20.0) expect(model.info.cacheWritesPrice).toBe(5.0) expect(model.info.cacheReadsPrice).toBe(0.2) - expect(model.maxTokens).toBe(8192) + expect(model.maxTokens).toBe(128000) expect(model.info.supportsReasoningBinary).toBe(true) - expect(model.info.supportsReasoningBudget).toBe(true) + expect(model.info.supportsReasoningBudget).toBeUndefined() expect(model.info.supportsPromptCache).toBe(true) expect(model.info.supportsTemperature).toBe(false) expect(model.reasoningBudget).toBeUndefined()