opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Error: Invalid `signature` in `thinking` block

Open rdvo opened this issue 2 weeks ago • 6 comments

Description

When changing model mid session from GLM 4.7 or MinMax 2.1 i get this error

messages.19.content.0: Invalid signatureinthinking block

Not sure why, if I toggle back to the first model I was using it works fine.

OpenCode version

1.0.207

Steps to reproduce

  1. Start a new sesson
  2. Send few messages with GLM 4.7 or MinMax 2.1
  3. Switch model to Opus 4.5 via Anthropic
  4. Send message

Will error

Screenshot and/or share link

Image

Operating System

mac os x

Terminal

ghostty

rdvo avatar Dec 30 '25 02:12 rdvo

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

  • #4832: [BUG]: Gemini 3 Pro function calling fails - missing thoughtSignature support - Similar issue with signature in thinking blocks when using models with reasoning
  • #6244: Response terminates prematurely when using Gemini 3 via LiteLLM - Related issue with thinking/reasoning blocks and signature validation
  • #3596: SSE Stream Bug: Out-of-Order thinking_delta via LiteLLM → AWS Bedrock - Addresses thinking block ordering issues that could relate to signature problems

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

github-actions[bot] avatar Dec 30 '25 02:12 github-actions[bot]

Yeah ik why, I think we have to filter out all reasoning from old model when u switch

rekram1-node avatar Dec 30 '25 03:12 rekram1-node

would there be a way to transform it to the right format or somethin without just stripping it? or is the default behavior to strip thoughts from subsequent messages?

rdvo avatar Dec 30 '25 03:12 rdvo

I can confirm this issue as well:

Description: An error occurs when switching to Anthropic models during an active session and sending a message after switching.|

Steps to reproduce:

  1. Connect to the Anthropic provider using the Pro subscription option
  2. Start chat with non-Anthropic model (e.g., Grok)
  3. Switch to any Anthropic model (Claude Sonnet 4.5 or Opus)
  4. Try to send a message or switch models

Error message: messages.1.content.0: Invalid signature in thinking block

mastternick avatar Jan 02 '26 22:01 mastternick

I made a Session Repair Tool on this issue.

vieenrose avatar Jan 06 '26 06:01 vieenrose