fix(provider): scope thinking binding to Claude 5.1+ - #46848
Merged
Conversation
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.
Issue for this PR
Fixes #46729
Fixes #46777
Type of change
What does this PR do?
Stop automatically adding thinking block binding to Claude 4.x and 5.0 requests. Those models do not need the prefix-mismatch control, and some deployments reject it. This also affects Haiku 4.5 title generation even when the main Opus 5 request succeeds.
Use Claude 5.1+ as the forward-compatible default, with an explicit exception for Mythos 5.1. Anthropic documents enforcement on Fable 5.1 and later models, and says Mythos 5.1 does not run the conversation-prefix check: https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-in-conversation
The numeric cutoff is our forward-compatibility policy, not a claim that every future cloud deployment has been verified. Match API model IDs, including Bedrock prefixes, Vertex suffixes, and either family/version order. Preserve existing thinking settings on excluded models and keep binding protection on eligible models.
No opt-out, SDK upgrade, retry change, or API routing change.
How did you verify your code works?
Run from
packages/opencode:bun test test/provider/transform.test.ts test/provider/amazon-bedrock.test.ts --only-failures— 576 passbun typecheck— passesThe new regression cases failed before the implementation change. Coverage includes future versions, the Mythos exception, and SDK request bodies/betas for Opus 5, Sonnet 5, and Haiku title generation across Anthropic, Vertex, and Bedrock. Existing Fable 5.1 wire tests still pass.
These are captured-request tests, not new live-provider verification.
Screenshots / recordings
N/A
Checklist