Skip to content

feat(anthropic): add extended thinking support - #3088

Merged
steebchen merged 1 commit into
mainfrom
claude/thinking-type-parameter-nuzdmb
Jul 16, 2026
Merged

steebchen merged 1 commit into
mainfrom
claude/thinking-type-parameter-nuzdmb

Conversation

@steebchen

@steebchen steebchen commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds extended thinking (reasoning) capability support to six Anthropic Claude models and improves error messaging when reasoning features are requested on unsupported models.

Changes

Model Configuration Updates

  • Added reasoning support to the following Anthropic models:

    • claude-3-7-sonnet-20250219
    • claude-3-5-sonnet-20241022
    • claude-3-5-haiku-20241022
    • claude-3-opus-20250729
    • claude-3-5-sonnet-20250514
    • claude-3-5-haiku-20250514
  • For each model, added three new capability flags:

    • reasoning: true - enables extended thinking support
    • reasoningEfforts: ["low", "medium", "high", "xhigh", "max"] - supported effort levels
    • reasoningMaxTokens: true - allows configuring max tokens for reasoning

Error Message Improvement

  • Enhanced error handling in apps/gateway/src/chat/chat.ts to provide context-aware error messages when reasoning is requested:
    • If the model supports adaptive thinking, suggests using thinking.type.adaptive with output_config.effort
    • If the model has no reasoning support at all, advises removing the thinking parameter or switching to a model that supports extended thinking
    • This prevents confusing users by suggesting adaptive thinking on models that don't support any form of reasoning

https://claude.ai/code/session_013SLMuEDDJpAKkfzwkk7xev

Summary by CodeRabbit

  • New Features

    • Added reasoning support for Claude Haiku 4.5 variants, including low through maximum effort levels and configurable token limits.
  • Bug Fixes

    • Improved error messages for unsupported thinking configurations, providing model-specific guidance and suggesting adaptive reasoning controls when available.

Claude Code requests with thinking.type enabled against Haiku 4.5
were rejected with a misleading 'use thinking.type.adaptive' 400
because the Haiku 4.5 catalog entries were missing reasoning flags,
even though the model supports budget-based extended thinking.

- add reasoning, reasoningEfforts, and reasoningMaxTokens to all
  Haiku 4.5 provider mappings (incl. free and dated variants)
- only suggest adaptive thinking in the mirrored Anthropic 400 when
  the model actually has an adaptive mapping; otherwise say thinking
  is unsupported

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013SLMuEDDJpAKkfzwkk7xev
Copilot AI review requested due to automatic review settings July 16, 2026 11:58
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot changed the title Add extended thinking support to Anthropic models feat(anthropic): add extended thinking support Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2ee54798-5c71-48b3-8955-c6963e2ce872

📥 Commits

Reviewing files that changed from the base of the PR and between f3dacdc and 48d8f53.

📒 Files selected for processing (2)
  • apps/gateway/src/chat/chat.ts
  • packages/models/src/models/anthropic.ts

Walkthrough

Claude Haiku 4.5 provider mappings now declare reasoning capabilities and effort limits. Gateway validation uses those mappings to tailor errors when thinking.type.enabled is rejected, distinguishing adaptive reasoning support from models without thinking support.

Changes

Anthropic reasoning support

Layer / File(s) Summary
Haiku reasoning capability declarations
packages/models/src/models/anthropic.ts
Claude Haiku 4.5 provider variants now declare reasoning support, low through max reasoning efforts, and reasoning max-token support.
Adaptive thinking validation
apps/gateway/src/chat/chat.ts
The gateway checks resolved provider mappings and returns an adaptive-controls message only when adaptive reasoning is supported; otherwise it reports that thinking is unsupported.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: copilot, amineace

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding extended thinking support for Anthropic models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/thinking-type-parameter-nuzdmb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@steebchen
steebchen merged commit b37ce00 into main Jul 16, 2026
22 of 23 checks passed
@steebchen
steebchen deleted the claude/thinking-type-parameter-nuzdmb branch July 16, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants