[Bug] Bedrock Runtime Error (400 ValidationException) when using base_url in WSL2 #9447

Open
opened 2026-02-16 18:12:28 -05:00 by yindo · 1 comment
Owner

Originally created by @Lh-Ty on GitHub (Feb 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Description

I am encountering a 400 ValidationException related to AWS Bedrock Runtime when attempting to use OpenCode. The error indicates that the request sent to the model contains empty text content blocks (text content blocks must be non-empty).

I am running OpenCode inside WSL2, connecting to a custom model provider via base_url.

Steps to Reproduce

  1. Version: OpenCode v1.2.5
  2. Environment: WSL2 (Windows Subsystem for Linux).
  3. Configuration:
    • Model: claude-3-5-sonnet-20241022
    • Setup: Configured using a base_url (Custom OpenAI-compatible endpoint).
  4. Action: Run any command or prompt (e.g., querying model config /model or a simple chat).
  5. Result: The operation fails immediately with the error log below.

Error Log

InvokeModelWithResponseStream: operation error Bedrock Runtime: InvokeModelWithResponseStream, https response error StatusCode: 400, RequestID: 8d37f0eb-3215-47a8-bae8-5603b8bb79b1, ValidationException: messages: text content blocks must be non-empty (request id: 20260216073702136854627CfvE55fd) (request id: 20260216073702104225029NXXEHzVZ)

### Plugins

oh-my-opencode

### OpenCode version

v1.2.5

### Steps to reproduce

_No response_

### Screenshot and/or share link

_No response_

### Operating System

wsl2

### Terminal

_No response_
Originally created by @Lh-Ty on GitHub (Feb 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ### Description I am encountering a `400 ValidationException` related to AWS Bedrock Runtime when attempting to use OpenCode. The error indicates that the request sent to the model contains empty text content blocks (`text content blocks must be non-empty`). I am running OpenCode inside **WSL2**, connecting to a custom model provider via `base_url`. ### Steps to Reproduce 1. **Version**: OpenCode v1.2.5 2. **Environment**: WSL2 (Windows Subsystem for Linux). 3. **Configuration**: * **Model**: `claude-3-5-sonnet-20241022` * **Setup**: Configured using a `base_url` (Custom OpenAI-compatible endpoint). 4. **Action**: Run any command or prompt (e.g., querying model config `/model` or a simple chat). 5. **Result**: The operation fails immediately with the error log below. ### Error Log ```text InvokeModelWithResponseStream: operation error Bedrock Runtime: InvokeModelWithResponseStream, https response error StatusCode: 400, RequestID: 8d37f0eb-3215-47a8-bae8-5603b8bb79b1, ValidationException: messages: text content blocks must be non-empty (request id: 20260216073702136854627CfvE55fd) (request id: 20260216073702104225029NXXEHzVZ) ### Plugins oh-my-opencode ### OpenCode version v1.2.5 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System wsl2 ### Terminal _No response_
yindo added the windowsbug labels 2026-02-16 18:12:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 16, 2026):

This issue might be a duplicate of or related to existing issues involving empty content validation:

  • #8903: Whitespace content causes API validation errors in provider transformations
  • #11991: Empty content error when switching between models
  • #5674: Custom OpenAI-compatible provider options not being passed to API calls
  • #11035: toolResults sent to AWS/Bedrock models rejected for missing json subdocument

Please check these issues to see if your issue is already being tracked or if there's an existing workaround.

@github-actions[bot] commented on GitHub (Feb 16, 2026): This issue might be a duplicate of or related to existing issues involving empty content validation: - #8903: Whitespace content causes API validation errors in provider transformations - #11991: Empty content error when switching between models - #5674: Custom OpenAI-compatible provider options not being passed to API calls - #11035: toolResults sent to AWS/Bedrock models rejected for missing json subdocument Please check these issues to see if your issue is already being tracked or if there's an existing workaround.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9447