Skip to content

fix(models): keep adaptive thinking for Claude 5 and default Haiku to 5.5 - #1580

Merged
NanmiCoder merged 2 commits into
mainfrom
fix/claude-adaptive-thinking-haiku55
Oct 15, 2026
Merged

NanmiCoder merged 2 commits into
mainfrom
fix/claude-adaptive-thinking-haiku55

Conversation

@NanmiCoder

Copy link
Copy Markdown
Owner

Summary

Requests to claude-opus-5-5 through Modelflare failed with 400 claude-opus-5-5 requires adaptive thinking. With CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 set, the CLI sent thinking: {type: "enabled", budget_tokens}. Two things combined to cause this: the provider capability string for Claude models omits required_thinking, and the env var fell back to a manual budget. Some relays rewrite the field (AruHub), but strict ones forward it and the API rejects it.

Per the official thinking table, budget_tokens returns 400 on every Claude 5.x model and on Opus 4.7/4.8. The official CLI removed this env var in 2.1.260.

  • These Claude models now always use adaptive thinking, whatever the env var says. When a provider's capability list declares adaptive_thinking but leaves out required_thinking, adaptive-only models still stay adaptive. A provider can still opt out by leaving out adaptive_thinking.
  • DeepSeek, MiniMax, GLM, Kimi, Doubao, Hunyuan and Claude 4.6 and earlier keep sending the manual budget, as before.
  • Haiku 5.5 is now supported:
    • its own canonical name (it previously collapsed to claude-haiku)
    • 1M context and 128K output
    • all effort levels, default medium
    • adaptive thinking; when thinking is disabled, xhigh/max are capped to high
    • pricing tiered by prompt length (over 100K tokens costs more) in both cost tables, with the local index bumped to v11 so stored dollars are recomputed
  • The first-party Haiku default is now Haiku 5.5, matching the official model list and prompt lineup. Third-party providers keep the lag-safe Haiku 4.5 default.

Feature Quality Contract

  • Changed surface: provider-runtime, server (models API, official runtime, local index version), desktop model catalog
  • Tests added or updated:
    • request-shape matrix of 16 models through a provider-managed environment with the env var set. Before the fix, all 8 Claude 5.x/4.7/4.8 cases failed and the 8 non-Claude/older cases passed. After the fix, all 16 pass.
    • Modelflare-shaped regression where a fake upstream rejects anything except adaptive
    • Haiku 5.5 effort cap when thinking is disabled. Mutation-checked: removing the condition makes the xhigh and max cases fail.
    • haiku55.test.ts: identity, limits, effort, thinking, prompt-length pricing in both tables, alias defaults
    • pricing parity entry; model list/default expectations updated
  • Coverage evidence: not run (check:coverage)
  • E2E / live-model evidence: not run; no live provider was used
  • Known risk / rollback: changes the default Haiku for first-party users. Revert this single commit to roll back.

Verification

Run on the rebased HEAD (target origin/main b6388b4):

  • bun run check:server: 616 files, 7405 passed, 0 failed
  • bun run check:provider-contract: 36 suites passed
  • focused model/thinking/pricing suites: 206 passed
  • desktop vitest (model selector, catalog, provider store, settings, agent teams): 19 files, 442 passed
  • git diff --check: clean
  • not run: check:agent-e2e, check:persistence-upgrade, check:coverage, bun run verify

… 5.5

Claude 5.x and Opus 4.7/4.8 reject budget_tokens with a 400, so CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING no longer falls back to a manual budget for them, and provider capability lists that omit required_thinking keep adaptive-only models adaptive. Non-Claude Anthropic-protocol models are unchanged.

Add Haiku 5.5: canonical name, 1M context, 128K output, all effort levels (medium default), adaptive thinking with the disabled-thinking effort cap, prompt-length tiered pricing in both cost tables, and make it the first-party Haiku default (third-party providers keep Haiku 4.5).
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

PR quality triage

Changed areas: area:cli-core, area:desktop, area:server

CLI core policy: CLI-core change authored by a CODEOWNER; no override label needed.

Missing-test policy: No missing-test policy block detected.

Coverage baseline policy: No coverage-baseline policy block detected.

CLI core files:

  • src/utils/betas.ts
  • src/utils/commitAttribution.ts
  • src/utils/context.ts
  • src/utils/effort.ts
  • src/utils/model/agent.test.ts
  • src/utils/model/configs.ts
  • src/utils/model/fable.test.ts
  • src/utils/model/haiku55.test.ts
  • src/utils/model/model.ts
  • src/utils/model/modelContextWindows.ts
  • src/utils/model/modelOptions.ts
  • src/utils/modelCost.ts
  • src/utils/modelCostParity.test.ts
  • src/utils/thinking.ts
  • src/utils/usageAccounting.ts

Coverage policy files:

  • none

Required check plan:

  • See PR Quality / scope-plan; it is the single source of truth for selected jobs.

Test coverage signals:

  • Agent/model runtime path changed: use mock/request-shape tests in PR and maintainer live-model smoke before release.

Risk notes:

  • No special risk notes from changed paths.

Hard merge gates come from the deterministic GitHub Actions contract lanes above.

@NanmiCoder
NanmiCoder merged commit db6e427 into main Oct 15, 2026
16 checks passed
@NanmiCoder NanmiCoder mentioned this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant