Add Claude Sonnet 5 (`claude-sonnet-5`) support
Merged
DS
5mo ago+49+49+01234567890123456789-9-9-0123456789
Adds support for claude-sonnet-5, live in the Anthropic API as of 2026-06-29 (display name "Claude Sonnet 5").
Capability-wise, Sonnet 5 keeps Sonnet 4.6's tool/schema/adaptive surface and adds the Opus 4.7 / 4.8 frontier flags. Every flag below was verified live against the Anthropic API (probing claude-sonnet-5 against claude-sonnet-4-6):
| capability | sonnet-5 | sonnet-4-6 |
|---|---|---|
json-schema output, adaptive thinking, effort, tool search, dynamic filtering, code-exec 20260120 | ✓ | ✓ |
xhigh effort | ✓ | ✗ |
rejects budget-based thinking (thinking.type.enabled) | ✓ | ✗ |
rejects sampling settings (temperature deprecated for model) | ✓ | ✗ |
| user-configurable task budgets | ✓ | ✗ |
forced tool_choice (any/tool) | ✓ | ✓ |
fast speed (anthropic_speed='fast') | ✗ | ✗ |
Changes
models/_known_model_names.py— addanthropic:andgateway/anthropic:literals.models/anthropic.py— bridgeAnthropicModelNamewith aclaude-sonnet-5Literal(the installedanthropicSDK0.109.0doesn't yet list it inModelParam), with aTODOto drop it once the floor is bumped — same bridge-then-drop pattern as #5849 forclaude-fable-5.profiles/anthropic.py— addclaude-sonnet-5to the prefix tuples it qualifies for (probe-driven); deliberately not added toanthropic_supports_fast_speedor the forced-tool_choicerejection list.tests/profiles/test_anthropic.py—test_model_profile_sonnet_5asserting the verified flag set.tests/test_capabilities.py— refresh theKnownModelNamesnapshot (two enum entries).
Mirrors #5849. Docs (docs/models/anthropic.md, docs/thinking.md) are intentionally held until the flags are confirmed in review, then finalized in this PR.
- Closes #
Checklist
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- PR title is fit for the release changelog.