Repository navigation
[Bug]: Support Anthropic for Claude Opus 5.5 #414
Description
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
But after Context compacted and request, it failed
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:
- Anthropic migration guidance: https://github.com/anthropics/skills/blob/main/skills/claude-api/shared/model-migration.md
- PI support Opus 5.5
Latest frontier models — Use Claude Opus 5.5, GPT-6 Sol, and GPT-6 Luna through supported providers, including GitHub Copilot.: https://github.com/earendil-works/pi/releases
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
hetaoBackend commentedon Oct 1, 2026
@airlsyn — this is an excellent, precise report, and I verified your capability matrix row by row against current
main. Your diagnosis is correct: onmain, compaction breaks prefix-bound thinking on Opus 5.5, and the missing capability is real.Verification against
mainI checked each capability you listed, in
third_party/pi-mono/packages/ai/src/providers/anthropic.tsonmain:mainThinkingLevel→ effort mapping for adaptive models)thinking.block_bindingprefix_mismatch_behaviorthinking-binding-controls-2026-08-01input_transformationshandlingSo 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 — producingprefix_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.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-bindingthat implements exactly this:THINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"THINKING_BLOCK_BINDING_MODEL_IDmatchingclaude-opus-5.5/claude-sonnet-5.5(and fable/mythos 5.1)supportsThinkingBlockBinding()— on by default for those model IDs, overridable via a newcompat.supportsThinkingBlockBindingwithThinkingBlockBinding()— injectsblock_binding: { prefix_mismatch_behavior: "drop_block" }on adaptive thinking, deliberately applied after host payload hooks and preserving a host-chosenblock_bindingThere'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
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.)needs-triage— fix is understood and in progress; needs a maintainer to land/merge it. (This tracker has noready-for-agentlabel, soneeds-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.
Christian-Sidak commentedon Oct 1, 2026
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.tssupportsThinkingBlockBinding?: booleantoAnthropicMessagesCompatthird_party/pi-mono/packages/ai/src/providers/anthropic.tsTHINKING_BINDING_CONTROLS_BETA = "thinking-binding-controls-2026-08-01"constantTHINKING_BLOCK_BINDING_MODEL_IDS = ["claude-opus-5-5", "claude-sonnet-5-5", "claude-fable-5-1", "claude-mythos-5-1"]supportsThinkingBlockBinding(model)helper (auto-detects by model ID, overridable viacompat.supportsThinkingBlockBinding)thinking-binding-controls-2026-08-01beta header for those models (increateClient)thinking.block_binding.prefix_mismatch_behavior: "drop_block"on adaptive thinking payloads for those models (inbuildParams)DEFAULT_THINKING_MODEL_IDSthird_party/pi-mono/packages/ai/src/index.tsTHINKING_BLOCK_BINDING_MODEL_IDSandsupportsThinkingBlockBindingthird_party/pi-mono/packages/ai/test/anthropic-thinking-block-binding.test.tsThe fix matches the capability matrix from the original report.