fix(providers/amazon-bedrock): strip empty text content to avoid API errors#7559
Merged
lgrammel merged 3 commits intovercel:mainfrom Aug 9, 2025
Merged
Conversation
…errors.
Without this, with maxSteps set, we sometimes see messages sent to the API like this:
```
{
role: 'assistant',
content: [ { text: '\n\n' }, { toolUse: [Object] } ]
},
```
This leads to API errors like this:
```
The text field in the ContentBlock object at messages.$n.content.0 is blank. Add text to the text field, and try again.
```
This change simply filters out this useless but apparently harmful message.
lgrammel
approved these changes
Jul 26, 2025
Collaborator
|
pls fix ts errors |
Contributor
Author
|
Thanks @dancer, that change looks correct to me. |
lgrammel
approved these changes
Aug 9, 2025
4 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.
Note: this replaces the closed PR which I nuked by accident.
Without this, with maxSteps set, we sometimes see messages sent to the API like this:
This leads to API errors like this:
This change simply filters out this useless but apparently harmful message.
Background
Summary
Verification
Tasks
pnpm changesetin the project root)pnpm prettier-fixin the project root)Future Work
Related Issues
Fixes #6254.
Supersedes #6255