Repository navigation
fix(claude): stop downgrading adaptive thinking on claude-haiku-5-5 - #15841
diegosouzapw merged 2 commits into
Conversation
The Haiku guard matched the /haiku/ family name and rewrote adaptive
thinking to a manual thinking.type "enabled" for every Haiku model.
claude-haiku-5-5 is adaptive-only, so Anthropic rejected the rewritten
request with a 400 ("thinking.type.enabled is not supported ... use
thinking.type.adaptive and output_config.effort").
- Add a claude-haiku-5-5 model spec (adaptiveThinkingOnly, 1M context,
128K max output, from the gateway catalog).
- The Haiku guard now defers to the spec: adaptive-only models are never
rejected by the family regex. Haiku 4.5 and earlier keep the manual
contract.
- Regression tests: 5.5 passes adaptive+effort through untouched; 4.5
still downgrades. Without the fix the 5.5 pass-through test fails.
Live probe (before): claude-haiku-5-5 + adaptive -> 400 "enabled not
supported"; claude-sonnet-5 + adaptive -> 200.
|
Confirming this bug independently. I hit the same 400 on
Setup: Claude Code 2.1.294 (VS Code) → OmniRoute, with Thinking Budget set to
The fix here (defer to
This currently blocks every Claude Code user routing Haiku 5.5 through OmniRoute, since Claude Code always sends adaptive thinking for it. I'd really appreciate a review, merge, and release when you have a moment. Thanks for the work on this! |
…daptive thinking
52efa6f
into
cheaper-inference:release/v3.8.52
|
Thanks @aldoeliacim — |
…heaper-inference#15841)⚠️ base-red inherited: cheaper-inference#15306 Validated in local merge-train _artifacts/merge-wave-13/train2.log on devbox-vm-06-dev002 @ 59b137edc8bd23f9c95db60d65fa6dbc5ef00743 (FAST). All 13 boarded. Static gates green except inherited translation drift of docs/reference/ENVIRONMENT.md, the same violations on origin/release/v3.8.52. Changed node:test files passed 90/90 on rerun. The RTL sidebar test passed 19/19. Vitest 5s timeouts in autoCombo (cheaper-inference#8601, cheaper-inference#8603) reproduced on the pure origin/release/v3.8.52 tip; those files are not in this train's diff.
…aiku 4.5 Pins the /v1/messages body handleChatCore sends for claude (OAuth) and anthropic (API key): adaptive + display summarized passes through unchanged on haiku/sonnet/opus 5.5, Haiku 4.5 keeps enabled + budget, and a manual budget on Haiku 5.5 collapses to adaptive (regression cover for cheaper-inference#15841).
Summary
claude-haiku-5-5is adaptive-thinking-only. The Haiku guard matched the/haiku/family name and rewrotethinking.type: "adaptive"to"enabled"for every Haiku model. Anthropic then returned HTTP 400 (thinking.type.enabled is not supported ... use thinking.type.adaptive and output_config.effort).claude-haiku-5-5model spec (adaptiveThinkingOnly, 1M context, 128K max output, from the gateway catalog). The Haiku guard now defers to the spec, so adaptive-only models are never rejected by the family regex. Haiku 4.5 and earlier keep the manual-thinking contract.claude-haiku-5-5requests with adaptive thinking now succeed instead of returning 400.Related Issues
Validation
npm run lint(exit 0, full repo)release/v3.8.52); focused checks rerun afterwardchangelog.d/fixes/15841-haiku-5-5-adaptive-thinking.md;check:changelog-integrityOK (no base bullets lost).Live evidence (before the fix, through the gateway)
enablednot supported)Test results
tests/unit/claude-haiku-no-adaptive-thinking.test.ts: 17/17 pass with the fix.claude-haiku-5-5pass-through test fails, so it guards the bug.release/v3.8.52without this change:codex-effort-model-echo-3697(1) andclaude-web-sonnet5-registry-6209(1, missingclaude-sonnet-5-5in its expected list).tsc --noEmit: 6040 errors on both the release tip and this branch, 0 added (diffed after path normalization). No type errors in the three touched source files.Tests Added Or Updated
tests/unit/claude-haiku-no-adaptive-thinking.test.ts(updated: newclaude-haiku-5-5adaptive pass-through andefforttests; Haiku 4.5 downgrade kept).Coverage Notes
open-sse/services/claudeHaikuConstraints.tsandsrc/shared/constants/modelSpecs.ts. Both are covered by the updated test file above (adaptive pass-through, effort pass-through, and the Haiku 4.5 downgrade path).Reviewer Notes
tests/unit/openai-to-claude-strip-temperature-thinking.test.ts(1 of 10 fails on the base). Its Haiku-5 assertion usesclaude-haiku-5-20251001; left unchanged to keep this PR focused.claude-web-sonnet5-registry-6209fails for the same underlying gap). Not changed here.