You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We hit the same messages.1.content.0.thinking.signature: Field required error when switching models mid-session (Azure OpenAI GPT-5.4 → AWS Bedrock Claude Opus) and after investigating we've identified the same root cause you're encountering with Plan(Opus) ↔ Build(Sonnet) on Bedrock.
Root Cause
packages/opencode/src/session/message-v2.ts in toModelMessages() replays assistant parts when building conversation history. For type: "reasoning" it currently does:
When differentModel is true (either different provider or different model), it strips providerMetadatabut keeps the reasoning part. The downstream Anthropic/Bedrock path then serializes that part as a Claude thinking block without a valid signature, and Bedrock rejects the request with exactly the error you're seeing.
For your Plan(Opus) ↔ Build(Sonnet) case, differentModel is true (same provider, different model), so Claude's own signature gets stripped on replay — even though it would have been valid to pass through unchanged.
Fix Applied
We introduced differentProvider and split the behavior:
different provider → drop the reasoning part entirely (can't translate foreign reasoning into Anthropic thinking safely)
same provider, different model → preserve the reasoning part and its providerMetadata, so signatures from one Claude model can round-trip into the next
Two-turn repro (GPT-5.4 → Bedrock Opus) reproduced the failure deterministically before the fix, passes cleanly after
Switching a live session with existing Claude thinking blocks also works
Added focused tests for both cross-provider drop and same-provider preservation
Related Issues
This issue appears related in symptom to #22813 (which focuses on Anthropic thinking block signature validation) and #23926 (which identifies a different code path in transform.ts). All three converge on the same family of errors when mixing providers or models with extended thinking enabled.
@rekram1-node - Apologies for the "giant AI message." I do most of my patching/PRs with LLMs and the larger messages are super helpful for giving the LLM the context it needs to do the job (I don't really have the Typescript expertise needed to write the code all on my own, but I still want to be helpful).
I will keep them shorter in the future (wish I could attach more context instead). In any case, thanks for your GREAT work on this harness, it's been a pleasure to work in/with.
Thanks for working on this. As a Bedrock user it's been a frustrating surprise to get stuck on this. Running /compact on this history is my workaround at the moment.
I'm planning with Opus, and my executor is with Sonnet, but when I do the switching, that's when I get the error. My solution at the moment is to get the planning in Markdown and copy-paste to a new chat with Sonnet, but I've been getting mixed results.
Activity
github-actions commentedon Apr 27, 2026
This issue might be a duplicate of existing issues. Please check:
thinking.signature: Field requirederrorIf your issue is not fully covered by those, please add details (OpenCode version, OS, terminal) so it can be tracked separately.
shakedlokits commentedon Apr 28, 2026
I think it might be possible to resolve this with something like:
rekram1-node commentedon Apr 28, 2026
ill try fixing this today
Dulani commentedon Apr 29, 2026
We hit the same
messages.1.content.0.thinking.signature: Field requirederror when switching models mid-session (Azure OpenAI GPT-5.4 → AWS Bedrock Claude Opus) and after investigating we've identified the same root cause you're encountering with Plan(Opus) ↔ Build(Sonnet) on Bedrock.Root Cause
packages/opencode/src/session/message-v2.tsintoModelMessages()replays assistant parts when building conversation history. Fortype: "reasoning"it currently does:When
differentModelis true (either different provider or different model), it stripsproviderMetadatabut keeps the reasoning part. The downstream Anthropic/Bedrock path then serializes that part as a Claudethinkingblock without a validsignature, and Bedrock rejects the request with exactly the error you're seeing.For your Plan(Opus) ↔ Build(Sonnet) case,
differentModelis true (same provider, different model), so Claude's ownsignaturegets stripped on replay — even though it would have been valid to pass through unchanged.Fix Applied
We introduced
differentProviderand split the behavior:thinkingsafely)providerMetadata, so signatures from one Claude model can round-trip into the nextVerification
Related Issues
This issue appears related in symptom to #22813 (which focuses on Anthropic thinking block signature validation) and #23926 (which identifies a different code path in
transform.ts). All three converge on the same family of errors when mixing providers or models with extended thinking enabled.Ready to submit as a PR if helpful.
rekram1-node commentedon Apr 29, 2026
@Dulani im going to fix it, this solution u propose "works" but it is poor. Also please dont paste giant AI messages
Dulani commentedon Apr 30, 2026
@rekram1-node - Apologies for the "giant AI message." I do most of my patching/PRs with LLMs and the larger messages are super helpful for giving the LLM the context it needs to do the job (I don't really have the Typescript expertise needed to write the code all on my own, but I still want to be helpful).
I will keep them shorter in the future (wish I could attach more context instead). In any case, thanks for your GREAT work on this harness, it's been a pleasure to work in/with.
xer0x commentedon May 1, 2026
Thanks for working on this. As a Bedrock user it's been a frustrating surprise to get stuck on this. Running /compact on this history is my workaround at the moment.
josechirivella commentedon May 1, 2026
I'm planning with Opus, and my executor is with Sonnet, but when I do the switching, that's when I get the error. My solution at the moment is to get the planning in Markdown and copy-paste to a new chat with Sonnet, but I've been getting mixed results.
rekram1-node commentedon May 1, 2026
My open pr fixes this, will prolly release today