Skip to content

fix(minimax): route M3 defaults through split reasoning - #59487

Closed
izumi0uu wants to merge 1 commit into
NousResearch:mainfrom
izumi0uu:fix/minimax-m3-reasoning-routing-59461
Closed

fix(minimax): route M3 defaults through split reasoning#59487
izumi0uu wants to merge 1 commit into
NousResearch:mainfrom
izumi0uu:fix/minimax-m3-reasoning-routing-59461

Conversation

@izumi0uu

@izumi0uu izumi0uu commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Routes the uncustomized built-in minimax + MiniMax-M3 default runtime from the Anthropic-compatible /anthropic transport to MiniMax's OpenAI-compatible https://api.minimax.io/v1 transport. That lets the existing MiniMax provider profile send reasoning_split=True, so provider-specific <mm:think> reasoning does not arrive as visible chat content in Telegram, desktop, or other clients.

This intentionally does not add <mm:think> to the generic think scrubbers. Previous maintainer feedback on related attempts pointed this class of bug at MiniMax reasoning routing instead of chasing provider-specific raw delimiters in shared output filters.

Explicit user endpoints remain user-owned: MINIMAX_BASE_URL, model.base_url, and non-M3 MiniMax routes keep their selected transport.

Related Issue

Fixes #59461

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Security fix
  • Documentation update
  • Tests (adding or improving test coverage)
  • Refactor (no behavior change)
  • New skill (bundled or hub)

Changes Made

  • hermes_cli/runtime_provider.py: route only default built-in minimax MiniMax-M3 to /v1 + chat_completions; preserve explicit MiniMax base URL overrides and non-M3 defaults.
  • plugins/model-providers/minimax/__init__.py: update the profile note to reflect that runtime routing now reaches the existing reasoning_split path.
  • tests/hermes_cli/test_runtime_provider_resolution.py: add coverage for default M3 routing, stale api_mode, credential-pool routing, env override preservation, non-M3 defaults, and local pool isolation in MiniMax resolver tests.

How to Test

  1. pytest tests/hermes_cli/test_runtime_provider_resolution.py -q
  2. pytest tests/plugins/model_providers/test_minimax_profile.py -q
  3. Manual runtime/profile probe confirmed MiniMax-M3 resolves to minimax chat_completions https://api.minimax.io/v1 and the profile emits {'reasoning_split': True}.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes
  • I've tested on my platform: macOS arm64, Darwin 24.6.0

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — docstring only
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact — runtime-provider-only change, no OS-specific behavior expected
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Targeted validation:

pytest tests/hermes_cli/test_runtime_provider_resolution.py -q
154 passed in 2.62s

pytest tests/plugins/model_providers/test_minimax_profile.py -q
17 passed in 0.92s

MiniMax-M3 leaks provider-specific thinking tags on the Anthropic-compatible endpoint, while the MiniMax profile already knows how to request split reasoning on the OpenAI-compatible endpoint. Route only the uncustomized built-in minimax M3 default to /v1 so explicit user endpoints and non-M3 routes keep their transport.

Constraint: Maintainer guidance rejected chasing model-specific raw reasoning delimiters in the generic scrubbers.

Rejected: Add mm:think handling to common think scrubbers | It widens generic filtering for a provider-specific transport issue and repeats previously closed approaches.

Confidence: high

Scope-risk: narrow

Directive: Keep explicit MiniMax base_url overrides user-owned; do not force custom /anthropic routes onto /v1.

Tested: pytest tests/hermes_cli/test_runtime_provider_resolution.py -q

Tested: pytest tests/plugins/model_providers/test_minimax_profile.py -q

Tested: runtime/profile probe resolves MiniMax-M3 to https://api.minimax.io/v1 with reasoning_split=True

Not-tested: Full pytest tests/ -q suite was not run.
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins provider/minimax MiniMax (Anthropic transport) P2 Medium — degraded but workaround exists labels Jul 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #59461 (the issue this fixes) and merged #46648 (same MiniMax-M3 reasoning-routing family, different code site). Not a duplicate — this reroutes the default M3 runtime transport in hermes_cli/runtime_provider.py rather than broadening the reasoning host gate.

@teknium1

teknium1 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — genuinely careful work: the scope is right (env/model.base_url/non-M3 defaults all stay user-owned, minimax-oauth and minimax-cn correctly excluded), and the diagnosis of why the leak happens is accurate. We're closing it though, on the same design line that closed #43836 and #43932.

The <mm:think> markers leaking into delta.content is the provider/model emitting reasoning in a broken shape. Rerouting the default M3 config to /v1 to coax a different output format is a different flavor of the same thing we declined there: making Hermes bend around a model's bad output. Whether we scrub the delimiters (those PRs) or reroute the transport to get the model to split its reasoning for us (this PR), both are "work around the provider not parsing its own reasoning correctly."

The provider should be returning reasoning in a separate field. If a given deployment/endpoint isn't doing that, that's the endpoint's format problem — and these leaks tend to be subtle and unpredictable enough (partial markers, mid-stream splits, format drift between model versions) that we can't reliably special-case them without accumulating an open-ended maintenance surface keyed on each model's quirks.

Users who want the split-reasoning behavior can already point MiniMax-M3 at https://api.minimax.io/v1 explicitly (via MINIMAX_BASE_URL or model.base_url) — the profile emits reasoning_split: True on that route today. We're keeping that as the explicit, user-owned choice rather than silently rewriting the built-in default's transport.

Not a knock on the implementation. Closing.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: reasoning stream markers leak verbatim into Telegram, Windows desktop, and Linux desktop on v0.18.0

3 participants