Skip to content

feat(minimax): extract M3 reasoning_content on OpenAI tiers - #6073

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
KooshaPari:pr-5804-minimax-m3-replay
Jul 3, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
KooshaPari:pr-5804-minimax-m3-replay

Conversation

@KooshaPari

Copy link
Copy Markdown
Contributor

Replacement for #5804 because the original PR branch is stale/conflicting and I do not have permission to update diegosouzapw:feat/port-pr-2231-minimax-m3-reasoning directly.

This replays the actual MiniMax M3 feature commit onto current release/v3.8.44 as a narrow 3-file patch:

  • CHANGELOG.md
  • open-sse/handlers/responseSanitizer/reasoning.ts
  • tests/unit/responsesanitizer-reasoning-split.test.ts

Validation run locally after rebasing onto current release:

npm exec --yes tsx -- --test tests/unit/responsesanitizer-reasoning-split.test.ts tests/unit/role-normalizer.test.ts
npm run check:docs-sync
npm run check:test-discovery

Results:

  • 40 targeted node tests passed
  • docs sync passed
  • test discovery passed

…at tiers

MiniMax M3 is registered with format:"openai" on 8 provider tiers (trae,
huggingchat, bazaarlink, ollama-cloud, opencode, cline, opencode-zen,
codebuddy-cn), where its raw <think>...</think> tags leaked directly into
`content` instead of surfacing as a separate `reasoning_content` field.

OmniRoute already has the extraction primitive
(extractThinkingFromContent in responseSanitizer/reasoning.ts); it was just
gated to deepseek-r1/r1-distill/qwq. Extend the allowlist
(isTextualReasoningTagNativeRoute) with a minimax-m3-only pattern, excluding
the two direct minimax/minimax-cn tiers, which stay on Anthropic's Messages
format (targetFormat: "claude") and already surface reasoning natively.

Co-authored-by: zmf963 <19422469+zmf963@users.noreply.github.com>
Inspired-by: decolua/9router#2231
@KooshaPari
KooshaPari requested a review from diegosouzapw as a code owner July 3, 2026 09:07

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds support for parsing and extracting textual reasoning tags (...) from MiniMax M3 models on OpenAI-format provider tiers (such as trae and huggingchat) while ensuring direct minimax and minimax-cn tiers remain unaffected. Comprehensive unit tests and regression guards are also added. The reviewer suggested a robust improvement to check if the providerId starts with "minimax" rather than checking for specific hardcoded provider IDs, which makes the exclusion logic future-proof.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

// opencode, cline, opencode-zen, codebuddy-cn). The direct minimax/minimax-cn
// tiers stay on Anthropic's Messages format (targetFormat: "claude") and
// already surface reasoning natively, so they are excluded here.
(providerId !== "minimax" && providerId !== "minimax-cn" && /minimax[-_]?m3\b/.test(routeId))

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.

medium

To make the exclusion of direct MiniMax provider tiers more robust and future-proof (e.g., if direct tiers like minimax-us or minimax-eu are introduced in the future), we can check if providerId starts with "minimax" instead of hardcoding individual provider IDs.

Suggested change
(providerId !== "minimax" && providerId !== "minimax-cn" && /minimax[-_]?m3\b/.test(routeId))
(!providerId.startsWith("minimax") && /minimax[-_]?m3\b/.test(routeId))

@diegosouzapw
diegosouzapw merged commit 1f6ec5b into diegosouzapw:release/v3.8.44 Jul 3, 2026
1 of 3 checks passed
@diegosouzapw diegosouzapw mentioned this pull request Jul 4, 2026
@KooshaPari
KooshaPari deleted the pr-5804-minimax-m3-replay branch August 13, 2026 06:55
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…iegosouzapw#6073)

MiniMax M3 leaks raw <think>...</think> into content on 8 OpenAI-format provider tiers; extract it into reasoning_content, leaving the direct minimax/minimax-cn (Claude-format) tiers untouched. Replacement for the stale diegosouzapw#5804 branch.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants