Skip to content

bedrock: Opus 5.5 thinking blocks rejected as 'bound to a different conversation' in subagent sessions #51481

Description

@guss77

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

  1. 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).
  2. Run a prompt that makes the primary agent spawn one or more subagents and do a long, multi-step turn with tool calls.
  3. 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:

{
  "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 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:

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions