Skip to content

Claude Sonnet 4.5 Throws "text content block must contain non-whitespace text" #3375

Description

@AbbasCiatek

Description

Using Claude Sonnet 4.5 and GLM.4.6 and switching between them based on the task, after switching from GLM 4.6 to Claude Sonnet 4.5 and sending a message it returns error "messages: text content block must contain non-whitespace text"

OpenCode version

15.4

Steps to reproduce

  1. Start a new session
  2. Use GLM 4.6 to edit some files do somethings
  3. Switch to Claude Sonnet 4.5
  4. Send message
  5. (you might need to switch multiple times between the models to get the error)
  6. Profit.

Screenshot and/or share link

Image

Operating System

Arch Linux (btw)

Terminal

Wizterm

Activity

  1. github-actions commented on Oct 23, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  2. levniko commented on Oct 23, 2025

    @levniko

    this is happening for me too

    Opencode v0.15.14
    Claude Opus 4.1
    Claude Sonnet 4.5

  3. self-assigned this
    on Oct 23, 2025
  4. rekram1-node commented on Oct 23, 2025

    @rekram1-node
    Collaborator

    ill take a look, its kinda annoying because glm makes those whitespace chunks but sonnet wont accept them so we need to walk the line and handle both things

  5. rekram1-node commented on Nov 11, 2025

    @rekram1-node
    Collaborator

    I think anthropic stopped enforcing this, I cannot replicate this error at all, if anyone can I will gladly reopen just pleaseee attach a session export opencode export > err.json << Select a session from the list that u replicated the error in

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions