Skip to content

fix: Claude Sonnet 5.5 support for claude_code and anthropic providers - #3947

Merged
amitksingh1490 merged 1 commit into
tailcallhq:mainfrom
bogdanr:feat/claude-sonnet-5-5
Sep 29, 2026
Merged

amitksingh1490 merged 1 commit into
tailcallhq:mainfrom
bogdanr:feat/claude-sonnet-5-5

Conversation

@bogdanr

@bogdanr bogdanr commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What

Registers claude-sonnet-5-5 (released 2026-09-28) as a selectable model. It follows #3928 (Opus 5.5).

Why

Sonnet 5.5 is the new Sonnet in the Claude 5.5 family: 1M context, 128K max output, $2/$10 per MTok (same price as Sonnet 5). Anthropic reports it is 30%+ faster than Sonnet 5.

Changes

provider.json: adds claude-sonnet-5-5 to the claude_code provider list, the same scope as #3928. The anthropic provider gets its model list from the API at runtime.

Unlike Opus 5.5, this one needs a logic fix. ModelSpecificReasoning::family matches contains("sonnet-5"), which puts claude-sonnet-5-5 in AdaptiveFriendly. According to the Sonnet 5.5 migration guide, that family is wrong for this model in three ways:

AdaptiveFriendly behaviour Effect on Sonnet 5.5
Forwards reasoning.max_tokens as thinking.type: enabled + budget_tokens 400: "thinking.type.enabled" is not supported for this model
Forwards non-default temperature / top_p / top_k 400
Rewrites xhigh effort to max Silently raises the effort level; Sonnet 5.5 supports xhigh natively
Location Change
model_specific_reasoning.rs family() sonnet-5-5 is now matched as AdaptiveOnly, before the broader sonnet-5 check
anthropic.rs interleaved_thinking_required returns false for sonnet-5-5, since adaptive thinking enables interleaving on its own
response.rs get_context_length no change; starts_with("claude-sonnet-5") already returns 1M

Tests

  • test_sonnet_5_5_drops_max_tokens_and_sampling_params: covers claude-sonnet-5-5 and the Bedrock-style anthropic.claude-sonnet-5-5; xhigh is preserved
  • test_sonnet_5_remains_adaptive_friendly: checks that plain Sonnet 5 keeps its current behaviour, so the predicate ordering can't regress
  • test_get_context_length_sonnet_5_5
  • claude-sonnet-5-5 added to the no-interleaved-thinking header test matrix

cargo test -p forge_app -p forge_repo: 1060 passed, 0 failed. cargo clippy --all-targets: clean.

Notes for reviewers

  1. Forced tool use: Sonnet 5.5 returns a 400 for tool_choice any/tool, the same as Opus 5.5 (flagged in fix: Claude Opus 5.5 support for claude_code and anthropic providers #3928). Nothing in the agent loop sends those today, so this PR leaves them alone.
  2. thinking: disabled: Sonnet 5.5 rejects it and wants between_tools instead. Thinking::Disabled is never built outside tests, so nothing breaks today. It matters if a "thinking off" mode is added later.
  3. Possible existing mismatch for Sonnet 5: the doc comment on interleaved_thinking_required lists Sonnet 5, but the predicate has no sonnet-5 match, so Sonnet 5 still gets the interleaved beta header. I didn't change it, because that would alter Sonnet 5's behaviour outside this PR's scope. Mentioning it in case it's unintended.
  4. Other providers: Sonnet 5 is also listed under bedrock, vertex_ai_anthropic and opencode_zen. Following fix: Claude Opus 5.5 support for claude_code and anthropic providers #3928, this PR only adds claude_code. Happy to add the others in a follow-up once the per-platform IDs are confirmed.

Co-Authored-By: ForgeCode [email protected]

…viders

Registers `claude-sonnet-5-5` (released 2026-09-28) with a 1M context
window in the `claude_code` provider list.

Unlike Opus 5.5, Sonnet 5.5 is NOT correctly classified by the existing
predicates: `contains("sonnet-5")` puts it in `AdaptiveFriendly`, which
would forward `budget_tokens` and non-default sampling params (both
return 400 on Sonnet 5.5) and rewrite `xhigh` to `max` even though
Sonnet 5.5 supports `xhigh` natively.

- `ModelSpecificReasoning` now matches `sonnet-5-5` as `AdaptiveOnly`,
  ahead of the broader `sonnet-5` check.
- `interleaved_thinking_required` returns false for `sonnet-5-5`, since
  adaptive thinking auto-enables interleaving.
- `get_context_length` already returns 1M via the `claude-sonnet-5`
  prefix; a regression test locks that in.

A guard test ensures plain Sonnet 5 stays `AdaptiveFriendly`.

Co-Authored-By: ForgeCode <[email protected]>
@github-actions github-actions Bot added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. type: provider Updates provider.json configuration. labels Sep 29, 2026
@amitksingh1490 amitksingh1490 changed the title feat: add Claude Sonnet 5.5 support for claude_code and anthropic providers fix: Claude Sonnet 5.5 support for claude_code and anthropic providers Sep 29, 2026
@amitksingh1490 amitksingh1490 removed the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Sep 29, 2026
@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label Sep 29, 2026
@amitksingh1490
amitksingh1490 enabled auto-merge (squash) September 29, 2026 09:13
@amitksingh1490
amitksingh1490 merged commit f067281 into tailcallhq:main Sep 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure. type: provider Updates provider.json configuration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants