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
ValidationException: text content blocks must be non-empty when using Bedrock Runtime #15715
When using opencode with AWS Bedrock Runtime (InvokeModelWithResponseStream), a ValidationException is thrown with the message:
messages: text content blocks must be non-empty
This error occurs during normal conversation — no empty message was sent by the user. It appears opencode is generating a request that contains an empty text content block, which Bedrock rejects.
Error Message
InvokeModelWithResponseStream: operation error Bedrock Runtime: InvokeModelWithResponseStream,
https response error StatusCode: 400,
RequestID: 1864b9d1-6a4d-441b-a404-46e48820db57,
ValidationException: messages: text content blocks must be non-empty
Steps to Reproduce
Start a normal conversation session using opencode with AWS Bedrock as the provider
Send a non-empty message
Error occurs consistently on every request
Expected Behavior
Messages are sent to Bedrock API with valid, non-empty text content blocks.
Actual Behavior
Bedrock returns HTTP 400 with ValidationException: messages: text content blocks must be non-empty, suggesting opencode is including an empty text block in the API request body.
Environment
Platform: macOS (darwin)
Provider: AWS Bedrock Runtime
Model: Claude Sonnet 4.6
Provider: Custom Provider
Possible Cause
opencode may be including empty text content blocks (e.g. {"type": "text", "text": ""}) in the messages array when constructing the API request, possibly related to tool use results or message history serialization.
Activity
github-actions commentedon Mar 2, 2026
This issue might be a duplicate of existing issues. Please check:
ValidationException: messages: text content blocks must be non-emptyfrom Bedrock Runtime (open issue, also involves a custom provider setup)Please review those issues to see if they describe the same root cause. If your issue is distinct, feel free to explain how it differs.
fix(provider): filter empty text content blocks for Bedrock
fix: resolve 8 open bug reports from upstream tracker
fix(provider): add universal empty-content guard to message pipeline
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.