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
{{ message }}
Repository navigation
Bug: Switching from GitHub Copilot (GPT) to Bedrock Claude in same session fails with thinking.signature: Field required #24909
When switching models mid-session from GitHub Copilot (ChatGPT / GPT-x) to Bedrock Claude, the next request to Claude fails because the previously-generated assistant messages from the GPT model do not contain the thinking.signature field that Anthropic's API requires for thinking content blocks.
Environment
Provider A (used first): github-copilot — a GPT model (ChatGPT)
Provider B (switched to): amazon-bedrock — global.anthropic.claude-* (e.g. Claude Opus / Sonnet with extended thinking)
Same OpenCode session / conversation (message history is reused)
Steps to Reproduce
Start an OpenCode session using a GitHub Copilot GPT model (e.g. GPT-5 / ChatGPT).
Have at least a few turns of conversation so the history grows (≥ 5–6 messages).
Without starting a new session, switch the model to a Bedrock Claude model that supports extended thinking.
Send any follow-up message.
Actual Behavior
Request to Bedrock Claude fails immediately with:
undefined: The model returned the following errors: {"type":"error","request_id":"req_hnoklttbjgqogsmlp7yqffgj4teomlda3ufeaf76qw2gslcadwxa","error":{"type":"invalid_request_error","message":"messages.5.content.0.thinking.signature: Field required"}}
The session becomes unusable on Claude until history is trimmed / a new session is started.
Expected Behavior
Switching providers/models within the same session should work seamlessly. Specifically, when replaying history to a Claude model, OpenCode should either:
Strip / convert non-Anthropic assistant blocks (including any synthetic thinking blocks) so Claude only sees plain text content, or
Properly sign thinking blocks (only possible if they were originally produced by Claude), or
Omit thinking blocks entirely from the replayed history when the originating model was not an Anthropic thinking model.
The current behavior passes through content that looks like an Anthropic thinking block but lacks the required signature field, which Anthropic rejects.
Additional Notes
The same cross-provider switching pattern also occasionally triggers a different error when skills are involved in the session history. That one reproduces with much lower probability, but the root cause looks related: history produced under one provider is not normalized before being replayed to another.
Error message prefix in the UI shows undefined: which suggests the provider/label isn't being set on the error surface — minor, but worth cleaning up.
Suggested Fix Direction
When constructing the request payload for Anthropic/Bedrock Claude, sanitize the message history:
Drop thinking blocks that did not originate from a Claude thinking response (i.e. no valid signature).
Alternatively, convert any foreign "reasoning"/"thinking" content to plain text before sending.
Your issue is specifically about cross-provider model switching (GPT → Bedrock Claude) within a session, which is a distinct scenario from the above, but the underlying cause (non-Anthropic thinking blocks being passed to Anthropic/Bedrock without sanitization) may overlap with #23926.
Activity
github-actions commentedon Apr 29, 2026
This issue might be a duplicate of existing issues. Please check:
thinking.signature: Field requirederror — closely related root cause around cross-provider thinking block handlingtrimEnd()in processor.ts invalidates Bedrock extended thinking signatures — same error class, different triggersignaturein thinking block when replaying history to Bedrock Claude — samethinking.signaturevalidation failureYour issue is specifically about cross-provider model switching (GPT → Bedrock Claude) within a session, which is a distinct scenario from the above, but the underlying cause (non-Anthropic thinking blocks being passed to Anthropic/Bedrock without sanitization) may overlap with #23926.
rekram1-node commentedon May 7, 2026
fixed by:
#25303