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 — bug: text content blocks must be non-empty in custom provider · Issue #16332 · anomalyco/opencode

bug: text content blocks must be non-empty in custom provider #16332

New issue
Copy link
New issue
Copy link
Closed
#25241
Closed
bug: text content blocks must be non-empty in custom provider#16332
#25241
Copy link
Assignees
rekram1-node
Labels
bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Description

@JackFGreen
JackFGreen
opened on Mar 6, 2026
Issue body actions

Description

I use Figma mcp and skill to create React component, chat is ok in TUI, but when it downloads img from figma, there is a error stop tasks.

skill: https://skills.sh/figma/mcp-server-guide/implement-design
mcp: https://github.com/figma/mcp-server-guide

  "mcp": {
    "figma": {
      "type": "remote",
      "url": "https://mcp.figma.com/mcp",
      "enabled": true,
    },
  },

provider config

    "xxx": {
      "name": "xxx",
      "npm": "@ai-sdk/openai-compatible",
      "models": {
        "claude-sonnet-4-5-20250929": {
          "name": "claude sonnet 4.5",
        },
      },
      "options": {
        "baseURL": "xxx",
        "apiKey": "xxx",
      },
    },

error

InvokeModelWithResponseStream: operation error Bedrock Runtime: InvokeModelWithResponseStream, 

https response error StatusCode: 400, RequestID: e0741fc6-7c69-4ac5-bbe5-941f009e79fc, 

ValidationException: messages: text content blocks must be non-empty

logs

ERROR 2026-03-06T06:44:14 +1ms service=llm providerID=xxx modelID=claude-sonnet-4-5-20250929 sessionID=ses_33e1c3fe3ffeRM9DMKE2gFIm45 small=false agent=build mode=primary error={"error":{}} stream error
ERROR 2026-03-06T06:44:14 +1ms service=session.processor error="/chat/completions" cannot be parsed as a URL. stack="TypeError: \"/chat/completions\" cannot be parsed as a URL.\n    at URL (unknown)\n    at url (../../node_modules/.bun/@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/openai-compatible/dist/index.mjs:1428:23)\n    at doStream (../../node_modules/.bun/@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/openai-compatible/dist/index.mjs:468:24)\n    at processTicksAndRejections (native:7:39)" process
INFO  2026-03-06T06:44:14 +1ms service=bus type=session.error publishing
INFO  2026-03-06T06:44:14 +0ms service=bus type=session.status publishing
INFO  2026-03-06T06:44:14 +0ms service=bus type=session.idle publishing
INFO  2026-03-06T06:44:14 +0ms service=bus type=message.updated publishing
INFO  2026-03-06T06:44:14 +1ms service=session.compaction pruning
INFO  2026-03-06T06:44:14 +0ms service=session.prompt sessionID=ses_33e1c3fe3ffeRM9DMKE2gFIm45 cancel
INFO  2026-03-06T06:44:14 +0ms service=bus type=session.status publishing
INFO  2026-03-06T06:44:14 +0ms service=bus type=session.idle publishing
INFO  2026-03-06T06:44:14 +1ms service=session.compaction pruned=0 total=0 found
INFO  2026-03-06T06:44:16 +1292ms service=bus type=session.updated publishing
INFO  2026-03-06T06:44:58 +42099ms service=default worker shutting down
INFO  2026-03-06T06:44:58 +1ms service=default disposing all instances
INFO  2026-03-06T06:44:58 +0ms service=bus type=* unsubscribing

Plugins

No response

OpenCode version

1.2.20

Steps to reproduce

  1. copy figma link
Image
  1. in tui make a component <figma_link>

Screenshot and/or share link

Image

Operating System

macOS 15.1

Terminal

Ghostty

Activity

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

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

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

    • ValidationException: text content blocks must be non-empty when using Bedrock Runtime #15715: Same error ValidationException: messages: text content blocks must be non-empty with Bedrock Runtime / custom provider — the root cause appears identical.

    If your issue is distinct (e.g. it only occurs specifically when an MCP tool returns image content from Figma), please add that clarification so this can be tracked separately.

  5. vbuccigrossi
    added a commit that references this issue on Mar 7, 2026

    fix: resolve 8 open bug reports from upstream tracker

    0d1c221
  6. fermumen
    marked Empty messages issue on Claude when used via @ai-sdk/openai-compatible, #16898 as a duplicate of this issue on Mar 10, 2026
  7. fermumen commented on Mar 10, 2026

    @fermumen
    fermumen
    on Mar 10, 2026
    More actions

    I think this is the same as #15715
    This could be fixed by changing how the filter in here works:

    opencode/packages/opencode/src/provider/transform.ts

    Line 54 in 5ec5d1d

    if (model.api.npm === "@ai-sdk/anthropic") {

    instead of anthropic provider, maybe we could use something that checks the model name too. e.g.

    function claude(model: Provider.Model) {
        if (model.providerID === "anthropic") return true
        return [model.id, model.api.id].some((item) => {
          const id = item.toLowerCase()
          return id.includes("claude") || id.includes("anthropic")
        })
      }
    
    

    then
    if(claude(model)) ...

    although you probably have a Claude detection logic for prompt selection already.

    This affects another provider I'm using (databricks api endpoint of claude)

  8. JackFGreen
    added a commit that references this issue on Mar 13, 2026

    fix: filter empty content blocks for Bedrock provider

    This issue will close once commit 33cd189 is merged into the 'dev' branch.
    33cd189
  9. JackFGreen commented on Mar 23, 2026

    @JackFGreen
    JackFGreen
    on Mar 23, 2026
    Author
    More actions

    @rekram1-node Hi, can you review this

    Issue Difference: #16332 provides the verifiable reproduction path missing in #15715 (MCP tools returning attachments but empty text when Figma MCP downloads images).

    PR Description: I created PR #17396 to fix the root cause where @ai-sdk/openai-compatible doesn't filter empty text blocks causing Bedrock API rejections. This PR resolves three related issues (#16332, #15715, #13811), and has been tested for a week without errors.

  10. jpvelasco
    added a commit that references this issue on Apr 18, 2026

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

    a0bd823
  11. rekram1-node
    closed this as completedin #25241on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

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.