feat(minimax): default thinking on for MiniMax-M3 - #42560
Conversation
M3's Anthropic endpoint returns an empty response (content:null, 1 output
token) when the request omits the thinking parameter — unlike the M2.x
family. build_anthropic_kwargs only sets thinking when a reasoning_config
is passed, so M3 called without one came back empty.
Default reasoning_config to {enabled: True} for M3 when the caller passes
none; M3 then takes the existing enabled branch ({type:enabled,
budget_tokens}). An explicit {enabled: False} still disables it. Other
models are unaffected.
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Overview
This PR fixes an issue where MiniMax-M3 returns empty responses unless thinking is explicitly enabled. The fix defaults thinking on for M3 models.
Changes
- Adds
_is_minimax_m3()helper function - Updates
build_anthropic_kwargs()to default thinking on when M3 is detected and no explicit preference is set - Explicit
{"enabled": False}still disables correctly - Adds test coverage for both default-on and explicit-disable cases
Quality
- Clean fix with good test coverage
- No security concerns
- No performance concerns
Reviewed by Hermes Agent
M3's native thinking control is the adaptive switch — its effort/budget
value does not change reasoning depth — so route M3 through the same
{"type":"adaptive"} shape as Claude 4.6+ instead of enabled+budget_tokens.
This aligns with openclaw/opencode and matches the M3 spec. Toggling is
unchanged: an explicit {"enabled": False} still disables thinking.
7146800 to
c5b908c
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused M3 coverage. The current premise needs revalidation before this can be salvaged.
Problems
- MiniMax's current Anthropic compatibility documentation says that omitted M3
thinkingdeliberately means thinking off with a normal response;{"type":"adaptive"}explicitly enables it. That conflicts with the PR-head empty-response claim atagent/anthropic_adapter.py:519-521. - The new default at PR-head
agent/anthropic_adapter.py:2261keys only on model name, notbase_url. Current main scopes MiniMax-specific OpenAI controls toapi.minimax.io/v1inplugins/model-providers/minimax/__init__.py:16-21,47-59. - Current main intentionally classifies adaptive thinking as Claude-only (
agent/anthropic_adapter.py:243-254); the proposed classifier change would undo that boundary.
Suggested changes
- Please reproduce the claimed empty response against the current documented Anthropic endpoint, including the request shape.
- If a default-on feature is still warranted, scope it to verified MiniMax endpoint routes and preserve the Claude-only adaptive classifier.
Automated hermes-sweeper review.
| # M3 returns an empty response unless thinking is enabled, so default it on | ||
| # when the caller expressed no preference. An explicit {"enabled": False} | ||
| # still disables it below. | ||
| if reasoning_config is None and _is_minimax_m3(model): |
There was a problem hiding this comment.
This applies to every Anthropic transport that uses an M3-named model, without checking base_url. Current MiniMax-specific reasoning controls are route-scoped in plugins/model-providers/minimax/__init__.py:16-21; please scope this to a verified MiniMax Anthropic endpoint before changing the default.
Add _is_minimax_global_anthropic_base_url helper and extend
build_api_kwargs_extras to emit thinking:{type:adaptive} (or
disabled) on the Anthropic-compatible route at
api.minimax.io/anthropic. Previously only the OpenAI-compatible
/v1 route received the reasoning control, leaving every install
that uses the standard minimax-oauth or default minimax provider
with M3 reasoning silently off despite reasoning_effort being set.
Complements NousResearch#42560 (which handles the reasoning_config=None case
in agent/anthropic_adapter.py) — together the two cover both the
explicit-config and silent-default call patterns.
|
Thanks for flagging this. I revalidated the premise today against the current MiniMax Anthropic endpoint ( With I also agree that the PR-head model-name-only default is too broad because it is not scoped to MiniMax base URLs, and expanding the existing Claude-only adaptive classifier is not justified by the current behavior. I am closing this PR rather than carrying forward a stale behavior change. Thanks for the precise review. |
Summary
MiniMax-M3supports Anthropic-style thinking blocks (thinking: {"type":"enabled"}/{"type":"adaptive"}), and benefits from having thinking on for reasoning-heavy work. Today, when a caller provides no reasoning level, M3 is sent with thinking off — so the default experience misses thinking even though M3 is a reasoning-capable model.This makes M3 default to thinking enabled when the caller expresses no preference, matching how M3 is intended to be used. An explicit choice still wins: a caller that disables reasoning still gets thinking off (verified —
disabledreturns a normal answer with no thinking block), and an explicit reasoning level is unchanged.This is a default-behavior improvement, not a bug fix — M3 returns valid answers with thinking on, off, or omitted.
Change
enabled: False/ reasoning off) is preserved.Verification
Checked against
api.minimax.io:thinking: enabled/adaptive→ response contains athinkingblock + answer.thinking: disabled/ omitted → response contains the answer with nothinkingblock (normal, non-empty).So the toggle works correctly in both directions; this PR only changes the default when the caller is silent.