You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AWS Bedrock via openai-compatible provider rejects empty assistant content #17395
When using AWS Bedrock (Anthropic models) through the openai-compatible provider, the API rejects assistant messages that have content: "". This causes the agent to fail when it makes tool calls without accompanying text.
Steps to Reproduce
Configure AWS Bedrock with an Anthropic model using the openai-compatible provider
Send a message that triggers tool calls where the assistant response contains only tool calls (no text)
The AI SDK serializes the content as an empty string ""
Bedrock API rejects the request with an error about empty content
Expected Behavior
The request should be accepted by the Bedrock API, similar to how native Anthropic and Bedrock providers handle this case.
Actual Behavior
The API rejects the request due to content: "" in assistant messages.
Environment
Provider: AWS Bedrock via openai-compatible
Models: Anthropic models (Claude)
Issue occurs when assistant has only tool calls without text response
Proposed Solution
Transform empty assistant content ("") to null for openai-compatible providers
Extend existing empty content filtering to openai-compatible provider
Handle edge cases with tool outputs and empty text blocks
Activity