GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ValidationException: text content blocks must be non-empty when using Bedrock Runtime · Issue #15715 · anomalyco/opencode

ValidationException: text content blocks must be non-empty when using Bedrock Runtime #15715

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
ValidationException: text content blocks must be non-empty when using Bedrock Runtime#15715
Copy link
Assignees
jlongster

Description

@icodeu
icodeu
opened on Mar 2, 2026
Issue body actions

Description

Description

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

  1. Start a normal conversation session using opencode with AWS Bedrock as the provider
  2. Send a non-empty message
  3. 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.

Plugins

No response

OpenCode version

1.2.15

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Reacted by Alex Sadleir

Activity

  1. icodeu
    added
    bugSomething isn't working
    on Mar 2, 2026
  2. github-actions
    assigned
    thdxr
    on Mar 2, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 2, 2026
  4. github-actions commented on Mar 2, 2026

    @github-actions
    github-actionsBot
    on Mar 2, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [Bug] Bedrock Runtime Error (400 ValidationException) when using base_url in WSL2 #13811: Same error — ValidationException: messages: text content blocks must be non-empty from Bedrock Runtime (open issue, also involves a custom provider setup)
    • Call Missing content in messages: text content blocks must be non-empty #5028: Same error message reported with a different provider (closed)

    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.

  5. zerone0x
    added a commit that references this issue on Mar 3, 2026

    fix(provider): filter empty text content blocks for Bedrock

    This issue will close once commit bf68e93 is merged into the 'dev' branch.
    bf68e93
  6. vbuccigrossi
    added a commit that references this issue on Mar 7, 2026

    fix: resolve 8 open bug reports from upstream tracker

    0d1c221
  7. erichasinternet
    marked Empty content blocks persist in database causing permanent Bedrock ValidationException (LiteLLM/openai-compatible proxies) #19309 as a duplicate of this issue on Apr 15, 2026
  8. jpvelasco
    added a commit that references this issue on Apr 18, 2026

    fix(provider): add universal empty-content guard to message pipeline

    a0bd823
  9. thdxr
    assigned
    jlongster
    and unassigned
    thdxr
    on Apr 26, 2026
  10. thdxr
    removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  11. github-actions commented on Jul 3, 2026

    @github-actions
    github-actionsBot
    on Jul 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  12. github-actions
    closed this as not plannedon Jul 3, 2026
  13. jpvelasco commented on Nov 19, 2026

    @jpvelasco
    jpvelasco
    on Nov 19, 2026
    More actions

    For anyone landing here from a search: ValidationException: messages: text content blocks must be non-empty is still reproducible on 2.x. Empty assistant turns can still reach the provider through the AI SDK route.

    Now tracked in #64771, with the fix in #56942.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jlongster
    jlongster

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.