fix: set display 'summarized' for Opus 4.7 on Bedrock#23331
Open
ahrav wants to merge 1 commit intoanomalyco:devfrom
Open
fix: set display 'summarized' for Opus 4.7 on Bedrock#23331ahrav wants to merge 1 commit intoanomalyco:devfrom
ahrav wants to merge 1 commit intoanomalyco:devfrom
Conversation
6 tasks
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
Closes #23166
Type of change
What does this PR do?
Opus 4.7 on Bedrock crashes with
reasoning part 0 not foundon first message with extended thinking enabled.Opus 4.7 changed the default for
thinking.displayfrom"summarized"to"omitted". Empty thinking blocks break the Vercel AI SDK streaming transform. #22873 fixed this for the Anthropic Messages API but missed Bedrock.The Bedrock SDK's
reasoningConfigschema doesn't have adisplayfield at all -- it hardcodesthinking: { type: "adaptive" }and drops extra keys. So this fix bypassesreasoningConfigfor Opus 4.7 and setsadditionalModelRequestFieldsdirectly withdisplay: "summarized".This applies the same 3-line fix to the Bedrock branch.
Related
How did you verify your code works?
Ran the app locally using the Bedrock opus 4.7 model. (low, med, high, xhigh, max effort levels)
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.