Add Claude Sonnet 5 (`claude-sonnet-5`) support

Merged
DS
5mo ago
+49-9

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):

capabilitysonnet-5sonnet-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 — add anthropic: and gateway/anthropic: literals.
  • models/anthropic.py — bridge AnthropicModelName with a claude-sonnet-5 Literal (the installed anthropic SDK 0.109.0 doesn't yet list it in ModelParam), with a TODO to drop it once the floor is bumped — same bridge-then-drop pattern as #5849 for claude-fable-5.
  • profiles/anthropic.py — add claude-sonnet-5 to the prefix tuples it qualifies for (probe-driven); deliberately not added to anthropic_supports_fast_speed or the forced-tool_choice rejection list.
  • tests/profiles/test_anthropic.py — test_model_profile_sonnet_5 asserting the verified flag set.
  • tests/test_capabilities.py — refresh the KnownModelName snapshot (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.