Skip to content

feat(minimax): default thinking on for MiniMax-M3 - #42560

Closed
kapelame wants to merge 2 commits into
NousResearch:mainfrom
kapelame:feat/minimax-m3-default-thinking
Closed

feat(minimax): default thinking on for MiniMax-M3#42560
kapelame wants to merge 2 commits into
NousResearch:mainfrom
kapelame:feat/minimax-m3-default-thinking

Conversation

@kapelame

@kapelame kapelame commented Jun 9, 2026

Copy link
Copy Markdown

Summary

MiniMax-M3 supports 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 — disabled returns 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

  • Recognize M3 and default its thinking to enabled when no reasoning level is set.
  • Legacy MiniMax M2.x is unchanged.
  • Explicit opt-out (enabled: False / reasoning off) is preserved.

Verification

Checked against api.minimax.io:

  • thinking: enabled / adaptive → response contains a thinking block + answer.
  • thinking: disabled / omitted → response contains the answer with no thinking block (normal, non-empty).

So the toggle works correctly in both directions; this PR only changes the default when the caller is silent.

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.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/minimax MiniMax (Anthropic transport) labels Jun 9, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@kapelame kapelame changed the title fix(minimax): default thinking on for MiniMax-M3 feat(minimax): default thinking on for MiniMax-M3 Jun 9, 2026
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.
@kapelame
kapelame force-pushed the feat/minimax-m3-default-thinking branch from 7146800 to c5b908c Compare June 9, 2026 11:57

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thinking deliberately means thinking off with a normal response; {"type":"adaptive"} explicitly enables it. That conflicts with the PR-head empty-response claim at agent/anthropic_adapter.py:519-521.
  • The new default at PR-head agent/anthropic_adapter.py:2261 keys only on model name, not base_url. Current main scopes MiniMax-specific OpenAI controls to api.minimax.io/v1 in plugins/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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
bbasketballer75 added a commit to bbasketballer75/hermes-agent that referenced this pull request Jul 18, 2026
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.
@kapelame

Copy link
Copy Markdown
Author

Thanks for flagging this. I revalidated the premise today against the current MiniMax Anthropic endpoint (POST https://api.minimax.io/anthropic/v1/messages) with MiniMax-M3.

With thinking omitted, the request returned a normal message (content: [{type: "text", text: "OK"}], stop_reason: "end_turn", output_tokens: 2). With thinking: {"type": "adaptive"}, it returned a thinking block followed by the same text response. So the original empty-response behavior no longer reproduces and the current documentation matches the live endpoint.

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.

@kapelame kapelame closed this Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants