Summary
With Claude Opus 5.5 on Amazon Bedrock, longer sessions that run subagents fail with a 400 Invalid signature in thinking block. The block is bound to a different conversation. The native Anthropic Messages route automatically sets thinking.block_binding.prefix_mismatch_behavior: "drop_block" and sends the thinking-binding-controls-2026-08-01 beta. The Amazon Bedrock route does neither, so the session gets a hard error and can't continue.
This report was generated by opencode running Claude Opus 5.5
Environment
- opencode version: 2.0.16
- OS: Linux 7.2.5-200.fc44.x86_64 (x86_64)
- Terminal: TERM=xterm-256color (running inside GNU Screen, inside a container with "-ti")
- Shell: /bin/bash
- Install/channel: latest (
~/.opencode/bin/opencode)
- Active plugins: none found in config
Reproduction
- Configure
"model": "amazon-bedrock/global.anthropic.claude-opus-5-5" on an AWS account where the Anthropic prefix check is enforced by default (accounts created on or after 2026-08-31).
- Run a prompt that makes the primary agent spawn one or more subagents and do a long, multi-step turn with tool calls.
- On a later step of the same session, the request fails.
Expected Behavior
The session keeps going. OpenCode should either send history whose thinking blocks still match their original conversation, or do what the Anthropic route already does: send block_binding.prefix_mismatch_behavior: "drop_block" plus the thinking-binding-controls-2026-08-01 beta. On Bedrock, that beta goes in additionalModelRequestFields.anthropic_beta.
Actual Behavior
Error: The model returned the following errors: messages.3.content.95: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Remove the block, or set `thinking.block_binding.prefix_mismatch_behavior` to "drop_block". That setting requires the `thinking-binding-controls-2026-08-01` value in the `anthropic-beta` header. The `thinking` block that preceded this one when it was created is missing from this request.
The last sentence says a thinking block earlier in the history was removed, so the remaining blocks have a gap.
Additional Context
What I found by reading the bundled 2.0.16 code:
- Anthropic Messages route: the request builder wraps
thinking so it adds block_binding: { prefix_mismatch_behavior: "drop_block" } for models that pass supportsThinkingBlockBinding (Claude 5.1+, which includes opus-5-5). The beta list then adds thinking-binding-controls-2026-08-01 whenever thinking.block_binding is present.
- Bedrock Converse route: no equivalent.
additionalModelRequestFields only gets thinking from the reasoning variant settings. There is no block_binding and no anthropic_beta entry for binding controls.
- Probable cause of the gap: Bedrock Converse
lowerMessages turns an assistant reasoning part that has no signature (or an empty one) into a plain text block. If a thinking block's signature is lost, which may happen with interrupted or parallel subagent steps, the thinking chain has a gap and every later thinking block fails the prefix check.
Workaround (verified): this model config fixes it on the default model and on #max:
Without the beta, the same body returns thinking.adaptive.block_binding: Extra inputs are not permitted. That shows the fields reach Bedrock and the beta has to be sent explicitly there.
Suggested fixes:
- Apply the same
block_binding default and beta (via anthropic_beta in additionalModelRequestFields) on the Bedrock route. Google Vertex Messages probably needs the same check.
- Don't turn signature-less reasoning into text in the middle of the history, because that creates the gap. Drop it instead, or keep the thinking chain unbroken.
Reference: https://platform.claude.com/docs/en/build-with-claude/preserved-thinking
Frequency: happens repeatedly in sessions that use subagents.
Summary
With Claude Opus 5.5 on Amazon Bedrock, longer sessions that run subagents fail with a 400
Invalid signature in thinking block. The block is bound to a different conversation. The native Anthropic Messages route automatically setsthinking.block_binding.prefix_mismatch_behavior: "drop_block"and sends thethinking-binding-controls-2026-08-01beta. The Amazon Bedrock route does neither, so the session gets a hard error and can't continue.This report was generated by opencode running Claude Opus 5.5
Environment
~/.opencode/bin/opencode)Reproduction
"model": "amazon-bedrock/global.anthropic.claude-opus-5-5"on an AWS account where the Anthropic prefix check is enforced by default (accounts created on or after 2026-08-31).Expected Behavior
The session keeps going. OpenCode should either send history whose thinking blocks still match their original conversation, or do what the Anthropic route already does: send
block_binding.prefix_mismatch_behavior: "drop_block"plus thethinking-binding-controls-2026-08-01beta. On Bedrock, that beta goes inadditionalModelRequestFields.anthropic_beta.Actual Behavior
The last sentence says a thinking block earlier in the history was removed, so the remaining blocks have a gap.
Additional Context
What I found by reading the bundled 2.0.16 code:
thinkingso it addsblock_binding: { prefix_mismatch_behavior: "drop_block" }for models that passsupportsThinkingBlockBinding(Claude 5.1+, which includesopus-5-5). The beta list then addsthinking-binding-controls-2026-08-01wheneverthinking.block_bindingis present.additionalModelRequestFieldsonly getsthinkingfrom the reasoning variant settings. There is noblock_bindingand noanthropic_betaentry for binding controls.lowerMessagesturns an assistantreasoningpart that has no signature (or an empty one) into a plaintextblock. If a thinking block's signature is lost, which may happen with interrupted or parallel subagent steps, the thinking chain has a gap and every later thinking block fails the prefix check.Workaround (verified): this model config fixes it on the default model and on
#max:{ "providers": { "amazon-bedrock": { "models": { "global.anthropic.claude-opus-5-5": { "settings": { "anthropicBeta": ["thinking-binding-controls-2026-08-01"] }, "body": { "additionalModelRequestFields": { "thinking": { "block_binding": { "prefix_mismatch_behavior": "drop_block" } } } } } } } } }Without the beta, the same
bodyreturnsthinking.adaptive.block_binding: Extra inputs are not permitted. That shows the fields reach Bedrock and the beta has to be sent explicitly there.Suggested fixes:
block_bindingdefault and beta (viaanthropic_betainadditionalModelRequestFields) on the Bedrock route. Google Vertex Messages probably needs the same check.Reference: https://platform.claude.com/docs/en/build-with-claude/preserved-thinking
Frequency: happens repeatedly in sessions that use subagents.