fix(anthropic): keep MiniMax thinking blocks on replay - #76865
Open
ahinks wants to merge 1 commit into
Open
Conversation
MiniMax /anthropic endpoints accept signed thinking blocks verbatim or mutated (live-probed 2026-08-01, HTTP 200 both ways), so the third-party strip-all path was dropping prior chain-of-thought and breaking interleaved reasoning on multi-turn and tool-loop work. Replay as-is like Kimi. Add tests pinning both MiniMax endpoints plus the interleaved tool turn.
Collaborator
teknium1
reviewed
Aug 2, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracing the current replay path. The current-main premise is verified: agent/anthropic_adapter.py:2490-2493 classifies MiniMax as third-party, and agent/anthropic_adapter.py:2521-2528 strips its replayed thinking blocks. The proposed branch correctly reuses the existing MiniMax-only predicate.
Problems
- The new
passbranch applies toredacted_thinkingtoo:_THINKING_TYPESincludes it atagent/anthropic_adapter.py:2487, buttests/agent/test_anthropic_minimax_thinking_replay.pycovers only normalthinkingblocks. Please establish the MiniMax contract for replayingredacted_thinking.data, or handle it conservatively. - The signed-block policy needs maintainer consolidation. Open #75748 changes the same branch to demote signatures, while this PR preserves them verbatim; the MEMBER discussion identifies this as a replay-contract decision.
Suggested changes
- Select one signed-thinking replay policy and consolidate the related MiniMax PRs around it.
- Add a redacted-thinking regression case if verbatim replay is intended.
Automated hermes-sweeper review.
| @@ -2518,6 +2520,13 @@ def _manage_thinking_signatures( | |||
| continue | |||
Contributor
There was a problem hiding this comment.
This pass-through also preserves redacted_thinking blocks and their opaque data payloads because _THINKING_TYPES includes that subtype, but the new tests only exercise ordinary thinking blocks. Please add a MiniMax replay contract test for redacted_thinking, or limit the carve-out until that payload behavior is verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MiniMax's
/anthropicendpoints were classified as generic third-party in_manage_thinking_signatures, so ALL thinking blocks were stripped from every replayed assistant turn. The model's prior chain of thought silently disappeared between turns and inside tool loops, breaking interleaved reasoning on multi-turn agentic work after the 2nd or 3rd turn. Same bug class as the Kimi fix in #13848 / ddd81e9, which MiniMax was left out of.Evidence (live probe, 2026-08-01, MiniMax-M3 via api.minimax.io/anthropic)
MiniMax does not enforce thinking signatures at all, so the strip was pure loss, no 400 protection.
Fix
Replay MiniMax thinking blocks as-is, mirroring the Kimi family rule. Two files:
agent/anthropic_adapter.py: add_is_minimax_anthropic_endpointbranch to_manage_thinking_signatures(pass-through), update the docstringtests/agent/test_anthropic_minimax_thinking_replay.py: new, pins both MiniMax endpoints (io + cn) and the interleaved tool-loop turnVerification
12/12 tests pass: new MiniMax suite (3), Kimi replay suite (3), DeepSeek thinking (3), thinking block order (3).