fix: filter empty content blocks for Bedrock provider#14586
fix: filter empty content blocks for Bedrock provider#14586Tom-Ryder wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found related PRs but no direct duplicates of PR #14586: Related PRs:
These are related to content filtering improvements, but none appear to be addressing the exact same issue (filtering empty content blocks for Bedrock specifically with the No duplicate PRs found |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Issue for this PR
Closes #11210
Type of change
What does this PR do?
normalizeMessages()filters empty text/reasoning parts for@ai-sdk/anthropicbut not@ai-sdk/amazon-bedrock. The Bedrock Converse API has the same constraint — empty content arrays cause "content field is empty" and invalid cache point errors that permanently break the session. Extended the existing guard to also cover Bedrock.Note: this fixes the empty content filtering side of #11210. The separate Bedrock ConverseAPI tool call issues flagged in the thread will need a follow-up.
How did you verify your code works?
bun turbo typecheckpassesScreenshots / recordings
N/A — backend logic change.
Checklist