Skip to content

feat(anthropic): add Claude 4.6 adaptive thinking support#1480

Open
illegalcall wants to merge 3 commits into0xPlaygrounds:mainfrom
illegalcall:feat/anthropic-adaptive-thinking
Open

feat(anthropic): add Claude 4.6 adaptive thinking support#1480
illegalcall wants to merge 3 commits into0xPlaygrounds:mainfrom
illegalcall:feat/anthropic-adaptive-thinking

Conversation

@illegalcall
Copy link
Contributor

@illegalcall illegalcall commented Mar 6, 2026

Fixes #1452

Summary

Adds Anthropic Claude 4.6 adaptive thinking support in rig-core, including typed handling for thinking and output_config in both streaming and non-streaming requests.

This also preserves legacy manual thinking support and adds validation for known unsupported models.

Testing

  • cargo test -p rig-core test_adaptive_thinking -- --nocapture

Comment on lines +10 to +18
### Added

- support Anthropic adaptive thinking for Claude 4.6 (`thinking.type = "adaptive"` with `output_config.effort`) with typed request mapping for both streaming and non-streaming paths
- add new Claude 4.6 model constants: `claude-opus-4-6`, `claude-sonnet-4-6`

### Fixed

- preserve legacy Anthropic manual thinking support (`thinking.type = "enabled"` and `budget_tokens`) in both streaming and non-streaming request conversion
- add model-aware validation for adaptive thinking / `output_config.effort: "max"` on known unsupported Anthropic models (both streaming and non-streaming) while preserving pass-through for unknown future model variants
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah crap, just realised we need to delete this part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool Thanks, anything I need to do?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nah it's fine I added a commit to fix it. Should be fine now. I think.

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.

feat(anthropic): new "reasoning level" format

2 participants