Error: Invalid signature in thinking block #3985

Closed
opened 2026-02-16 17:42:11 -05:00 by yindo · 11 comments
Owner

Originally created by @rdvo on GitHub (Dec 29, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @rdvo on GitHub (Dec 29, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When changing model mid session from GLM 4.7 or MinMax 2.1 i get this error `messages.19.content.0: Invalid `signature` in `thinking` 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 <img width="1482" height="244" alt="Image" src="https://github.com/user-attachments/assets/da17f0c7-61d0-49b2-9106-640204a2bdb4" /> ### Operating System mac os x ### Terminal ghostty
yindo added the bug label 2026-02-16 17:42:11 -05:00
yindo closed this issue 2026-02-16 17:42:11 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 29, 2025):

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] commented on GitHub (Dec 29, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Dec 29, 2025):

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

@rekram1-node commented on GitHub (Dec 29, 2025): Yeah ik why, I think we have to filter out all reasoning from old model when u switch
Author
Owner

@rdvo commented on GitHub (Dec 29, 2025):

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 commented on GitHub (Dec 29, 2025): 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?
Author
Owner

@mastternick commented on GitHub (Jan 2, 2026):

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 commented on GitHub (Jan 2, 2026): ### 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 `
Author
Owner

@vieenrose commented on GitHub (Jan 6, 2026):

I made a Session Repair Tool on this issue.

@vieenrose commented on GitHub (Jan 6, 2026): I made a [Session Repair Tool](https://github.com/vieenrose/opencode-toolkit) on this issue.
Author
Owner

@mounan commented on GitHub (Jan 18, 2026):

I hit this Corrupted thought signature. error when I switch from google provider to manul api token

@mounan commented on GitHub (Jan 18, 2026): I hit this `Corrupted thought signature.` error when I switch from google provider to manul api token
Author
Owner

@MrGuardian commented on GitHub (Feb 2, 2026):

I have this too. I'm not using Anthropic subscription directly, I do it via Github Copilot subscription.

Steps I did before getting the same error (all models from Github Copilot):

  1. Plan with Gemini 3 Pro Preview
  2. Switch to Build Claude Sonnet 4.5 thinking.
  3. Type "Build it".

Got this error messages.1.content.0: Invalid `signature` in `thinking` block.
Using opencode version 1.1.48 in vs code.

@MrGuardian commented on GitHub (Feb 2, 2026): I have this too. I'm not using Anthropic subscription directly, I do it via Github Copilot subscription. Steps I did before getting the same error (all models from Github Copilot): 1. Plan with Gemini 3 Pro Preview 2. Switch to Build Claude Sonnet 4.5 thinking. 3. Type "Build it". Got this error ``messages.1.content.0: Invalid `signature` in `thinking` block``. Using `opencode` version 1.1.48 in `vs code`.
Author
Owner

@DerekCorniello commented on GitHub (Feb 2, 2026):

just now getting this same error on opus 4.5 and sonnet through github copilot sub. Using v1.1.48 on kitty with hyprland/arch

@DerekCorniello commented on GitHub (Feb 2, 2026): just now getting this same error on opus 4.5 and sonnet through github copilot sub. Using v1.1.48 on kitty with hyprland/arch
Author
Owner

@rekram1-node commented on GitHub (Feb 2, 2026):

This was fixed for all models a while ago, but for github copilot there was a separate issue that is fixed in dev.

Release should go out tonight

@rekram1-node commented on GitHub (Feb 2, 2026): This was fixed for all models a while ago, but for github copilot there was a separate issue that is fixed in dev. Release should go out tonight
Author
Owner

@Wenbobobo commented on GitHub (Feb 9, 2026):

This was fixed for all models a while ago, but for github copilot there was a separate issue that is fixed in dev.

Release should go out tonight

Image hi,After GitHub crashed and was restored, I just restarted and seemed to encounter this [Error: Invalid signature in thinking block] issue again.
@Wenbobobo commented on GitHub (Feb 9, 2026): > This was fixed for all models a while ago, but for github copilot there was a separate issue that is fixed in dev. > > Release should go out tonight <img width="1452" height="600" alt="Image" src="https://github.com/user-attachments/assets/a391624f-1fd5-48b8-9b21-8ee4dec8af8f" /> hi,After GitHub crashed and was restored, I just restarted and seemed to encounter this [Error: Invalid signature in thinking block] issue again.
Author
Owner

@geekgil commented on GitHub (Feb 10, 2026):

I can confirm that this bug in switching between models in the same session with Github Copilot subscription integration came back. I've got an error similar to @Wenbobobo 's one (messages.21.content.0: Invalid 'signature' in 'thinking' block) when switching from gemini-3-pro-preview to claude-opus-4.6 in opencode 1.1.53 installed in Pop!_OS 24.04 running in Cosmic Terminal.

Image

The issue seems to happen only in the same execution. I closed opencode CLI client, opened it again, resumed the session, and resent the last prompt and it worked fine.

@geekgil commented on GitHub (Feb 10, 2026): I can confirm that this bug in switching between models in the same session with Github Copilot subscription integration came back. I've got an error similar to @Wenbobobo 's one (`messages.21.content.0: Invalid 'signature' in 'thinking' block`) when switching from gemini-3-pro-preview to claude-opus-4.6 in opencode 1.1.53 installed in Pop!_OS 24.04 running in Cosmic Terminal. <img width="898" height="348" alt="Image" src="https://github.com/user-attachments/assets/0033b053-1ed0-40b4-a76d-1dd31538894f" /> The issue seems to happen only in the same execution. I closed opencode CLI client, opened it again, resumed the session, and resent the last prompt and it worked fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3985