Repository navigation
fix: Claude Sonnet 5.5 support for claude_code and anthropic providers - #3947
Merged
Merged
Conversation
…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]>
amitksingh1490
approved these changes
Sep 29, 2026
amitksingh1490
enabled auto-merge (squash)
September 29, 2026 09:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: addsclaude-sonnet-5-5to theclaude_codeprovider list, the same scope as #3928. Theanthropicprovider gets its model list from the API at runtime.Unlike Opus 5.5, this one needs a logic fix.
ModelSpecificReasoning::familymatchescontains("sonnet-5"), which putsclaude-sonnet-5-5inAdaptiveFriendly. According to the Sonnet 5.5 migration guide, that family is wrong for this model in three ways:AdaptiveFriendlybehaviourreasoning.max_tokensasthinking.type: enabled+budget_tokens"thinking.type.enabled" is not supported for this modeltemperature/top_p/top_kxhigheffort tomaxxhighnativelymodel_specific_reasoning.rsfamily()sonnet-5-5is now matched asAdaptiveOnly, before the broadersonnet-5checkanthropic.rsinterleaved_thinking_requiredfalseforsonnet-5-5, since adaptive thinking enables interleaving on its ownresponse.rsget_context_lengthstarts_with("claude-sonnet-5")already returns 1MTests
test_sonnet_5_5_drops_max_tokens_and_sampling_params: coversclaude-sonnet-5-5and the Bedrock-styleanthropic.claude-sonnet-5-5;xhighis preservedtest_sonnet_5_remains_adaptive_friendly: checks that plain Sonnet 5 keeps its current behaviour, so the predicate ordering can't regresstest_get_context_length_sonnet_5_5claude-sonnet-5-5added to the no-interleaved-thinking header test matrixcargo test -p forge_app -p forge_repo: 1060 passed, 0 failed.cargo clippy --all-targets: clean.Notes for reviewers
tool_choiceany/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.thinking: disabled: Sonnet 5.5 rejects it and wantsbetween_toolsinstead.Thinking::Disabledis never built outside tests, so nothing breaks today. It matters if a "thinking off" mode is added later.interleaved_thinking_requiredlists Sonnet 5, but the predicate has nosonnet-5match, 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.bedrock,vertex_ai_anthropicandopencode_zen. Following fix: Claude Opus 5.5 support for claude_code and anthropic providers #3928, this PR only addsclaude_code. Happy to add the others in a follow-up once the per-platform IDs are confirmed.Co-Authored-By: ForgeCode [email protected]