Skip to content

[Bug]: Support Anthropic for Claude Opus 5.5 #414

Open

Description

@airlsyn

Product or interface

Desktop app

Version

3.1.0

Platform

macOS

OS version and architecture

macOS 15

Issue area

Other

Desktop log upload ID (optional)

No response

Steps to reproduce

using MiniMax Code with the anthropic-messages protocol and Claude Opus 5.5:

At first steps, It is okay and get the right response

Image

But after Context compacted and request, it failed

Image

digging into the response, I found such errors:

  • prefix_binding_mismatch
  • We have detected an anomaly in your client. Please use the standard Claude Code client for requests.
  • This request was blocked as our automated systems flagged that it may violate Anthropic's Terms of Service restrictions on developing competing model products

And with some deepresearch

Anthropic's newer Claude models bind thinking blocks to the conversation prefix, including the system prompt, tools, and previous messages. This can become an issue for agentic workflows where the system prompt, tool definitions, or conversation history may be modified between turns.

I compared the Anthropic integration in MiniMax Code with the latest versions of Pi and OpenCode.

It looks like MiniMax Code has already backported several Claude 5.x compatibility changes, including:

  • Adaptive thinking
  • output_config.effort
  • Thinking signature replay
  • Signature-only thinking blocks

However, the current vendored pi-mono implementation does not appear to include the newer prefix-binding compatibility mechanism:

Capability MiniMax CodePi v0.79.1 + backports Latest Pi OpenCode
Claude Opus 5.5 ✅ ✅ ✅
Adaptive Thinking ✅ ✅ ✅
Thinking signature replay ✅ ✅ ✅
Signature-only thinking blocks ✅ ✅ ✅
thinking.block_binding ❌ ✅ ✅
prefix_mismatch_behavior ❌ ✅ ✅
thinking-binding-controls-2026-08-01 ❌ ✅ ✅
input_transformations handling ❌ ✅ ✅
Prefix-binding mismatch recovery ❌ ✅ ✅

In particular, the latest Pi and OpenCode implementations send:

{
  "thinking": {
    "type": "adaptive",
    "block_binding": {
      "prefix_mismatch_behavior": "drop_block"
    }
  }
}

together with the beta header: thinking-binding-controls-2026-08-01 They also handle the corresponding input_transformations response when Anthropic drops thinking blocks because of a prefix mismatch.

For reference:

Expected and actual behavior

no such error and use Opus/Sonnet 5.5 correctly

Redacted error summary

Screenshots

No response

Before submitting

  • I have searched existing issues.
  • I have included my version and removed sensitive information.

Activity

  1. added
    bugSomething isn't working
    needs-triageAwaiting maintainer assessment
    on Oct 1, 2026
  2. hetaoBackend commented on Oct 1, 2026

    @hetaoBackend
    Collaborator

    This was generated by AI during triage.

    @airlsyn — this is an excellent, precise report, and I verified your capability matrix row by row against current main. Your diagnosis is correct: on main, compaction breaks prefix-bound thinking on Opus 5.5, and the missing capability is real.

    Verification against main

    I checked each capability you listed, in third_party/pi-mono/packages/ai/src/providers/anthropic.ts on main:

    Capability Your matrix Verified on main
    Claude Opus 5.5 support ✅ ✅ present
    Adaptive thinking ✅ ✅ present (ThinkingLevel → effort mapping for adaptive models)
    Thinking signature replay ✅ ✅ present (signature_delta handling)
    Signature-only thinking blocks ✅ ✅ present
    thinking.block_binding ❌ ❌ confirmed missing
    prefix_mismatch_behavior ❌ ❌ confirmed missing
    thinking-binding-controls-2026-08-01 ❌ ❌ confirmed missing (no such beta header)
    input_transformations handling ❌ ❌ confirmed missing
    Prefix-binding mismatch recovery ❌ ❌ confirmed missing

    So your matrix is accurate, and your causal chain is right: preserved-thinking blocks are bound to the exact request prefix (system prompt, tools, earlier messages); a history rewrite like context compaction changes that prefix; without block_binding.prefix_mismatch_behavior: "drop_block" the API rejects the request instead of dropping the stale signed thinking — producing prefix_binding_mismatch, and surfacing as the error you're seeing. The fact that it works until the first "Context compacted" is exactly the signature of this bug.

    One clarification worth adding

    It's worth separating the two error strings you captured, because they have different causes:

    • prefix_binding_mismatch — the real, fixable bug on our side. It's a compatibility gap: the vendored pi is behind the thinking-binding-controls beta. This is the one that breaks you specifically after compaction, and it's what the fix below addresses.
    • "flagged that it may violate Anthropic's Terms of Service restrictions…" — that one is Anthropic-side policy enforcement on the request, separate from the prefix binding, and not something a client change can resolve.

    So the compaction failure you diagnosed is ours to fix; if you also hit the ToS string independently of compaction, that's a different (and non-actionable-on-our-side) condition.

    Status: a fix appears to be in progress locally

    Checking the working tree, there's an uncommitted, in-progress fix on a local branch fix/anthropic-thinking-block-binding that implements exactly this:

    • adds THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"
    • adds THINKING_BLOCK_BINDING_MODEL_ID matching claude-opus-5.5 / claude-sonnet-5.5 (and fable/mythos 5.1)
    • supportsThinkingBlockBinding() — on by default for those model IDs, overridable via a new compat.supportsThinkingBlockBinding
    • withThinkingBlockBinding() — injects block_binding: { prefix_mismatch_behavior: "drop_block" } on adaptive thinking, deliberately applied after host payload hooks and preserving a host-chosen block_binding

    There's no open upstream PR for it yet. Since external PRs are collaborator-restricted, the same path as #149 / #364 applies: land it, run pnpm verify, and post the commit here (or open it if you have collaborator access) so it can be brought in with attribution. If you'd rather file it as your own contribution, say so and we'll coordinate.

    Classification

    • Category: bug — a compatibility gap in the vendored Anthropic transport, reproducible and already diagnosed. (Note this is distinct from [Bug]: can't request Opus 5.5 succeed #387, where the request was simply "support Opus 5.5" and the failure was an upstream client-authenticity gate; here the compaction-specific failure is ours.)
    • State: needs-triage — fix is understood and in progress; needs a maintainer to land/merge it. (This tracker has no ready-for-agent label, so needs-triage + this note is the routing.)

    If after landing the fix you still see a failure immediately after compaction on Opus 5.5, please follow up with the new client logs — that would mean the binding fix isn't taking effect on the wire, and it's worth knowing. Your comparison against latest Pi and OpenCode is exactly the right reference; thanks for the matrix — it made verification fast.

    No credentials or sensitive data echoed.

  3. Christian-Sidak commented on Oct 1, 2026

    @Christian-Sidak

    Here is the fix for the prefix_binding_mismatch / context compaction failure on Opus 5.5 and Sonnet 5.5.

    Branch: https://github.com/Christian-Sidak/minimax-code/tree/fix/issue-414
    Commit: Christian-Sidak@a0b7beb

    What the fix does (4 files changed):

    third_party/pi-mono/packages/ai/src/types.ts

    • Adds supportsThinkingBlockBinding?: boolean to AnthropicMessagesCompat

    third_party/pi-mono/packages/ai/src/providers/anthropic.ts

    • Adds THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01" constant
    • Adds THINKING_BLOCK_BINDING_MODEL_IDS = ["claude-opus-5-5", "claude-sonnet-5-5", "claude-fable-5-1", "claude-mythos-5-1"]
    • Adds supportsThinkingBlockBinding(model) helper (auto-detects by model ID, overridable via compat.supportsThinkingBlockBinding)
    • Sends the thinking-binding-controls-2026-08-01 beta header for those models (in createClient)
    • Injects thinking.block_binding.prefix_mismatch_behavior: "drop_block" on adaptive thinking payloads for those models (in buildParams)
    • Adds the 5.5/5.1 model IDs to DEFAULT_THINKING_MODEL_IDS

    third_party/pi-mono/packages/ai/src/index.ts

    • Exports THINKING_BLOCK_BINDING_MODEL_IDS and supportsThinkingBlockBinding

    third_party/pi-mono/packages/ai/test/anthropic-thinking-block-binding.test.ts

    • Unit tests covering: model ID detection, compat overrides, beta header wiring, block_binding payload injection, and negative cases

    The fix matches the capability matrix from the original report.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesktopMiniMax Code desktop appneeds-triageAwaiting maintainer assessment

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions