Closed
Description
Description
When switching from a model with extended thinking (e.g., Claude Opus with thinking enabled) to a model without thinking support (e.g., GPT 5.2, Claude Sonnet without thinking) mid-session, an error occurs:
messages.1.content.0.thinking: each thinking block must contain thinking
Root Cause
The reasoning parts from the previous model's responses are stored in the message history. When switching to a model that doesn't support interleaved reasoning (capabilities.interleaved === false), these parts are still sent to the API, causing validation errors.
Steps to Reproduce
- Start a conversation with Claude Opus (or any model with extended thinking)
- Get a response that includes thinking/reasoning blocks
- Switch to GPT 5.2 or Claude Sonnet (without thinking enabled) mid-session using Ctrl+M
- Send a new message
Expected Behavior
Switching models mid-session should work seamlessly. OpenCode should strip reasoning parts from message history when the target model doesn't support them.
Actual Behavior
API error about invalid thinking blocks.
Environment
- OpenCode version: 0.0.0-dev
- OS: macOS
- Provider: Anthropic / OpenAI
Related Issues
- Invalid
signatureinthinkingblock when switching Claude models (Copilot provider) #11546 (similar but for Claude-to-Claude switching with signature issues)
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Feb 1, 2026
This issue might be a duplicate of existing issues. Please check:
signatureinthinkingblock when switching Claude models (Copilot provider) #11546: Invalidsignatureinthinkingblock when switching Claude models (Copilot provider) - very similar issue with Claude model switchingsignatureinthinkingblock #6418: Error: Invalidsignatureinthinkingblock - general thinking block validation errorFeel free to ignore if none of these address your specific case.
fix: strip reasoning parts when switching to non-interleaved models
fix: strip reasoning parts from messages when switching to non-thinki…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
Apply PR #11590: fix: strip reasoning parts from messages when switch…
wildcatDownstairs commentedon Feb 2, 2026
I also got this problem

rekram1-node commentedon Feb 2, 2026
Fixed in next release, copilot specific issue