feat(minimax): add MiniMax M3 models (512K / 1M context) and fix double-think on Anthropic endpoint#765
Conversation
…sts for configuration
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds MiniMax-M3-512k and MiniMax-M3-1M to the MiniMax registry, updates the default model, changes MiniMax Anthropic request parameter mapping for M-series models, and extends protocol, handler, and UI tests. ChangesMiniMax M3 Model Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/api/providers/__tests__/minimax.spec.ts`:
- Around line 669-677: The MiniMax-M3 pricing regression tests in minimax.spec
should verify that longContextPricing is truly unset on the model objects, not
just absent from JSON output. Update the two assertions that inspect
minimaxModels["MiniMax-M3-512k"] and minimaxModels["MiniMax-M3-1M"] to check the
property directly on the object so the tests fail if longContextPricing is added
as undefined.
In `@src/api/providers/minimax.ts`:
- Around line 111-130: The M3 request-shape fix is only applied in
createMessage, but completePrompt still builds M-series requests without the
same adaptive-thinking and top_p settings. Extract the shared M-series
request-parameter construction in Minimaxi provider code (for example around
createMessage/completePrompt request assembly) and reuse it in both paths so the
default M3 model gets identical request params everywhere.
- Around line 112-114: The Minimax sampling defaults still allow user-provided
temperature to override the regression-guarded M-series setting; update the
`samplingParams` construction in `minimax.ts` so `isM3` (and the M2/M3 path it
represents) always uses a fixed `temperature: 1.0` instead of `temperature ??
1.0`. Keep the existing `top_p`/`top_k` behavior unchanged, and add provider
test coverage around the relevant Minimax provider methods to verify custom
temperature input is ignored for the M-series default path while still behaving
as expected elsewhere.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6eb19bc3-6440-4a8f-8c2a-0a0f4178ab66
📒 Files selected for processing (5)
packages/types/src/__tests__/provider-settings.test.tspackages/types/src/providers/minimax.tssrc/api/providers/__tests__/minimax.spec.tssrc/api/providers/minimax.tswebview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/api/providers/minimax.ts`:
- Around line 318-326: The completePrompt() flow is still hard-coding the old M2
max token limit even though it now uses M3 request params and the selected
model’s registry settings. Update the MiniMaxProvider.completePrompt method to
use the selected model’s maxTokens (as createMessage() already does) instead of
the fixed 16_384 value, and keep the model lookup via getModel() /
getMSeriesRequestParams(model) consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e6afa1d6-1025-42bf-b57c-5a7d6ebe3a3f
📒 Files selected for processing (2)
src/api/providers/__tests__/minimax.spec.tssrc/api/providers/minimax.ts
…max_tokens fallback The literal 16_384 fallback in both createMessage and completePrompt is the same value exported from @roo-code/types as MINIMAX_DEFAULT_MAX_TOKENS (the registry's own default). Using the constant: - Removes a duplicated magic number. - Self-documents the call site - readers no longer have to guess what 16_384 means in the context of MiniMax. - Matches the pattern used elsewhere in the file (e.g. defaultTemperature: 1.0 in getModel).
Summary
This PR adds the MiniMax M3 model family to the MiniMax provider and ports
a small but important fix from the kilo-code opencode engine to keep M-series
models from hanging/double-thinking on the Anthropic Messages endpoint.
What's new
Bug fix (ported from kilo-code opencode \provider/transform.ts)
When routing M-series models through the Anthropic Messages endpoint
(\�pi.minimax.io/anthropic), MiniMax defaults \ hinking\ to off. The model
would emit a cheap non-thinking response on the first turn, then re-decide to
think from scratch on the next turn, producing the double-think / hang
symptom on multi-turn agentic runs.
The fix mirrors kilo-code's opencode provider (lines 488–524, 661–669, 907–914,
1208–1211) and is implemented in \src/api/providers/minimax.ts:
\ emperature: 1.0, \ op_p: 0.95. Never set \�udget_tokens\ — M-series
is a binary on/off toggle (matching kilo's \instant: { thinking: { type: disabled } }, thinking: { thinking: { type: adaptive }\ mapping).
(matches kilo's \minimax-m2\ defaults at lines 488–524). No \ hinking\ field —
M2.x does not accept it.
maintainers can re-sync if kilo's logic changes.
Files changed
Tests
\
packages/types → provider-settings.test.ts → 17/17 passed
src → minimax.spec.ts → 42/42 passed (38 prior + 4 new)
webview-ui → useSelectedModel.spec.ts → 27/27 passed
Total 86/86 passed
\\
Regression guards
Why no changesets?
Per \AGENTS.md\ in this repo:
Why this PR is targeted at \Zoo-Code-Org/Zoo-Code, not a fork
This contribution is intended for the upstream project. Please review and let
me know if you'd like any of the optional follow-ups below; happy to address
in follow-up PRs.
Optional follow-ups (NOT in this PR)
Verification steps for reviewers
Summary by CodeRabbit
New Features
Bug Fixes
Tests