Skip to content

fix: set display 'summarized' for Opus 4.7 on Bedrock#23331

Open
ahrav wants to merge 1 commit intoanomalyco:devfrom
ahrav:fix/bedrock-opus-4.7-display-summarized
Open

fix: set display 'summarized' for Opus 4.7 on Bedrock#23331
ahrav wants to merge 1 commit intoanomalyco:devfrom
ahrav:fix/bedrock-opus-4.7-display-summarized

Conversation

@ahrav
Copy link
Copy Markdown

@ahrav ahrav commented Apr 18, 2026

Issue for this PR

Closes #23166

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Opus 4.7 on Bedrock crashes with reasoning part 0 not found on first message with extended thinking enabled.

Opus 4.7 changed the default for thinking.display from "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 reasoningConfig schema doesn't have a display field at all -- it hardcodes thinking: { type: "adaptive" } and drops extra keys. So this fix bypasses reasoningConfig for Opus 4.7 and sets additionalModelRequestFields directly with display: "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

Screenshot 2026-04-18 at 12 22 53

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: add display 'summarized' for Opus 4.7 on Bedrock to prevent reasoning errors

1 participant