Skip to content

Commit 9f7e474

Browse files
committed
fix(anthropic): correct Opus 5.5 output budget
1 parent 778ad3e commit 9f7e474

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎packages/types/src/providers/anthropic.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,15 @@ export const anthropicModels = {
165165
description: "Claude Opus 5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
166166
},
167167
"claude-opus-5-5": {
168-
maxTokens: 128_000, // Overridden to 8k if `enableReasoningEffort` is false.
168+
maxTokens: 128_000,
169169
contextWindow: 1_000_000, // 1M context window native (no beta header required)
170170
supportsImages: true,
171171
supportsPromptCache: true,
172172
inputPrice: 4.0, // $4 per million input tokens
173173
outputPrice: 20.0, // $20 per million output tokens
174174
cacheWritesPrice: 5.0, // $5 per million tokens
175175
cacheReadsPrice: 0.2, // $0.20 per million tokens
176-
// Opus 5.5 keeps the Opus 5 adaptive-thinking / binary-toggle convention on
177-
// the direct Anthropic provider path: manual budget_tokens and non-default
178-
// sampling parameters return a 400.
179-
supportsReasoningBudget: true,
176+
// Opus 5.5 always uses adaptive thinking and rejects manual budget_tokens.
180177
supportsReasoningBinary: true,
181178
supportsTemperature: false,
182179
description:

‎src/api/providers/__tests__/anthropic.spec.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ describe("AnthropicHandler", () => {
486486
apiKey: "test-api-key",
487487
apiModelId: "claude-opus-5-5",
488488
enableReasoningEffort: true,
489-
modelMaxTokens: 32768,
490489
})
491490

492491
const stream = opusHandler.createMessage(systemPrompt, [
@@ -502,7 +501,7 @@ describe("AnthropicHandler", () => {
502501
const requestOptions = mockCreate.mock.calls[mockCreate.mock.calls.length - 1]?.[1]
503502
expect(requestBody?.thinking).toEqual({ type: "adaptive" })
504503
expect(requestBody?.temperature).toBeUndefined()
505-
expect(requestBody?.max_tokens).toBe(32768)
504+
expect(requestBody?.max_tokens).toBe(128_000)
506505
expect(requestOptions?.headers?.["anthropic-beta"]).toContain("prompt-caching-2024-07-31")
507506
})
508507

@@ -755,9 +754,9 @@ describe("AnthropicHandler", () => {
755754
expect(model.info.outputPrice).toBe(20.0)
756755
expect(model.info.cacheWritesPrice).toBe(5.0)
757756
expect(model.info.cacheReadsPrice).toBe(0.2)
758-
expect(model.maxTokens).toBe(8192)
757+
expect(model.maxTokens).toBe(128000)
759758
expect(model.info.supportsReasoningBinary).toBe(true)
760-
expect(model.info.supportsReasoningBudget).toBe(true)
759+
expect(model.info.supportsReasoningBudget).toBeUndefined()
761760
expect(model.info.supportsPromptCache).toBe(true)
762761
expect(model.info.supportsTemperature).toBe(false)
763762
expect(model.reasoningBudget).toBeUndefined()

0 commit comments

Comments
 (0)