feat(minimax): upgrade default model to MiniMax-M3#241
Conversation
- Add MiniMax-M3 as the new default model (1M context window, image input support) - Retain MiniMax-M2.7 and MiniMax-M2.7-highspeed in the model catalog - Add per-model cost resolution: M3 (0.6/2.4), M2.7 (0.3/1.2), M2.7-highspeed - Update OAuth alias mapping to register minimax-m3 - Update onboarding group hints from M2.7 to M3 (recommended) - Mirror changes in both minimax/ (root) and extensions/minimax/ (extension) - Update docs/providers/minimax.md and docs/zh-CN/providers/minimax.md - Update unit tests to reflect new default and M3 cost rates
📝 Walkthrough走查概览本PR将MiniMax推荐模型从M2.7升级到M3,引入模型级成本解析函数,并更新所有配置、文档和测试以适配新的模型默认值及成本结构。 变更MiniMax M3 模型升级和成本解析
代码审查工作量估计🎯 3 (中等) | ⏱️ ~20 分钟 诗
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
extensions/minimax/model-definitions.test.ts (1)
41-44:⚠️ Potential issue | 🟠 Major | ⚡ Quick winM2.7 成本断言与新解析逻辑不一致
Line 42 指定的是
"MiniMax-M2.7",按当前实现应命中MINIMAX_M27_API_COST,不是MINIMAX_API_COST。这里会造成测试与实现冲突。建议修复
import { buildMinimaxApiModelDefinition, buildMinimaxModelDefinition, DEFAULT_MINIMAX_CONTEXT_WINDOW, DEFAULT_MINIMAX_MAX_TOKENS, MINIMAX_API_COST, MINIMAX_HOSTED_MODEL_ID, + MINIMAX_M27_API_COST, } from "./model-definitions.js"; @@ it("builds API model definition with standard cost", () => { const model = buildMinimaxApiModelDefinition("MiniMax-M2.7"); - expect(model.cost).toEqual(MINIMAX_API_COST); + expect(model.cost).toEqual(MINIMAX_M27_API_COST); expect(model.contextWindow).toBe(DEFAULT_MINIMAX_CONTEXT_WINDOW); expect(model.maxTokens).toBe(DEFAULT_MINIMAX_MAX_TOKENS); });🤖 Prompt for 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. In `@extensions/minimax/model-definitions.test.ts` around lines 41 - 44, The test currently calls buildMinimaxApiModelDefinition("MiniMax-M2.7") but asserts MINIMAX_API_COST; update the assertion to expect MINIMAX_M27_API_COST (or change the model name to one that should use MINIMAX_API_COST) so the test matches the implementation; specifically adjust the expectation referencing MINIMAX_M27_API_COST while leaving the contextWindow assertion (DEFAULT_MINIMAX_CONTEXT_WINDOW) unchanged.minimax/model-definitions.test.ts (1)
41-44:⚠️ Potential issue | 🟠 Major | ⚡ Quick win这里也需要改为断言 M2.7 专属成本
Line 42 传入
"MiniMax-M2.7",应断言MINIMAX_M27_API_COST。当前MINIMAX_API_COST断言与实现分支不一致。建议修复
import { buildMinimaxApiModelDefinition, buildMinimaxModelDefinition, DEFAULT_MINIMAX_CONTEXT_WINDOW, DEFAULT_MINIMAX_MAX_TOKENS, MINIMAX_API_COST, MINIMAX_HOSTED_MODEL_ID, + MINIMAX_M27_API_COST, } from "./model-definitions.js"; @@ it("builds API model definition with standard cost", () => { const model = buildMinimaxApiModelDefinition("MiniMax-M2.7"); - expect(model.cost).toEqual(MINIMAX_API_COST); + expect(model.cost).toEqual(MINIMAX_M27_API_COST); expect(model.contextWindow).toBe(DEFAULT_MINIMAX_CONTEXT_WINDOW); expect(model.maxTokens).toBe(DEFAULT_MINIMAX_MAX_TOKENS); });🤖 Prompt for 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. In `@minimax/model-definitions.test.ts` around lines 41 - 44, The test asserts the wrong cost constant for the "MiniMax-M2.7" case: in the test using buildMinimaxApiModelDefinition("MiniMax-M2.7") replace the expectation of MINIMAX_API_COST with MINIMAX_M27_API_COST so the assertion matches the implementation branch; keep the contextWindow assertion against DEFAULT_MINIMAX_CONTEXT_WINDOW unchanged and ensure you reference the constants MINIMAX_M27_API_COST and MINIMAX_API_COST alongside the buildMinimaxApiModelDefinition call to locate the change.
🤖 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 `@docs/zh-CN/providers/minimax.md`:
- Line 5: Summary: You edited a generated file (docs/zh-CN/providers/minimax.md)
directly; generated docs must not be hand-modified. Fix: revert changes to
docs/zh-CN/providers/minimax.md, then make your authoritative changes in the
English source, update the Chinese glossary at docs/.i18n/glossary.zh-CN.json as
needed, and regenerate translations by running scripts/docs-i18n; ensure
x-i18n.source_hash remains consistent and only perform targeted edits to
docs/zh-CN/** if explicitly requested by the i18n process.
In `@extensions/minimax/model-definitions.ts`:
- Line 10: The constant MINIMAX_M3_CONTEXT_WINDOW is defined but not used;
update the code path that currently uses DEFAULT_MINIMAX_CONTEXT_WINDOW so it
selects the context window based on the modelId (e.g., return
MINIMAX_M3_CONTEXT_WINDOW when modelId indicates "MiniMax-M3", otherwise fall
back to DEFAULT_MINIMAX_CONTEXT_WINDOW). Locate the code that resolves the
context window (the place referencing DEFAULT_MINIMAX_CONTEXT_WINDOW) and
implement a conditional switch or lookup by modelId to return
MINIMAX_M3_CONTEXT_WINDOW for MiniMax-M3.
In `@minimax/model-definitions.ts`:
- Line 10: MINIMAX_M3_CONTEXT_WINDOW is defined but not actually used when
constructing the MiniMax-M3 model, so MiniMax-M3 still receives the old 204800
value; update the model-building branch that creates the MiniMax-M3 instance
(the code path referenced around the build/constructor for "MiniMax-M3") to
replace the hardcoded 204800 with MINIMAX_M3_CONTEXT_WINDOW and ensure any
defaulting logic uses that constant; search for occurrences of "MiniMax-M3", the
model constructor/factory, and the constant MINIMAX_M3_CONTEXT_WINDOW to make
the swap so the package behavior matches the extension version.
---
Outside diff comments:
In `@extensions/minimax/model-definitions.test.ts`:
- Around line 41-44: The test currently calls
buildMinimaxApiModelDefinition("MiniMax-M2.7") but asserts MINIMAX_API_COST;
update the assertion to expect MINIMAX_M27_API_COST (or change the model name to
one that should use MINIMAX_API_COST) so the test matches the implementation;
specifically adjust the expectation referencing MINIMAX_M27_API_COST while
leaving the contextWindow assertion (DEFAULT_MINIMAX_CONTEXT_WINDOW) unchanged.
In `@minimax/model-definitions.test.ts`:
- Around line 41-44: The test asserts the wrong cost constant for the
"MiniMax-M2.7" case: in the test using
buildMinimaxApiModelDefinition("MiniMax-M2.7") replace the expectation of
MINIMAX_API_COST with MINIMAX_M27_API_COST so the assertion matches the
implementation branch; keep the contextWindow assertion against
DEFAULT_MINIMAX_CONTEXT_WINDOW unchanged and ensure you reference the constants
MINIMAX_M27_API_COST and MINIMAX_API_COST alongside the
buildMinimaxApiModelDefinition call to locate the change.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 482dd6df-b22d-4ced-b454-b61c72767997
📒 Files selected for processing (14)
docs/providers/minimax.mddocs/zh-CN/providers/minimax.mdextensions/minimax/index.tsextensions/minimax/model-definitions.test.tsextensions/minimax/model-definitions.tsextensions/minimax/openclaw.plugin.jsonextensions/minimax/provider-models.tsminimax/index.tsminimax/model-definitions.test.tsminimax/model-definitions.tsminimax/openclaw.plugin.jsonminimax/provider-models.tssrc/agents/minimax.live.test.tssrc/agents/models-config.providers.minimax.test.ts
| - 你想在 OpenClaw 中使用 MiniMax 模型 | ||
| - 你需要 MiniMax 设置指南 | ||
| summary: 在 OpenClaw 中使用 MiniMax M2.1 | ||
| summary: 在 OpenClaw 中使用 MiniMax M3 |
There was a problem hiding this comment.
请改为走 zh-CN 文档生成流水线,不要直接手改生成文件。
本次在 docs/zh-CN/providers/minimax.md 的直接内容修改会引入与 x-i18n.source_hash 的漂移风险,后续执行 i18n 同步时可能被覆盖。请改为:先更新英文文档,再按仓库流程更新术语并运行 scripts/docs-i18n,仅在被明确要求时做定点修订。
As per coding guidelines, "docs/zh-CN/** is generated; do not edit unless the user explicitly asks. Pipeline: update English docs → adjust glossary (docs/.i18n/glossary.zh-CN.json) → run scripts/docs-i18n → apply targeted fixes only if instructed".
Also applies to: 18-20, 51-51, 59-59, 64-90, 98-100, 109-114, 123-123, 131-132, 144-145, 165-165, 184-184, 188-188, 193-193, 199-201
🤖 Prompt for 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.
In `@docs/zh-CN/providers/minimax.md` at line 5, Summary: You edited a generated
file (docs/zh-CN/providers/minimax.md) directly; generated docs must not be
hand-modified. Fix: revert changes to docs/zh-CN/providers/minimax.md, then make
your authoritative changes in the English source, update the Chinese glossary at
docs/.i18n/glossary.zh-CN.json as needed, and regenerate translations by running
scripts/docs-i18n; ensure x-i18n.source_hash remains consistent and only perform
targeted edits to docs/zh-CN/** if explicitly requested by the i18n process.
| export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID; | ||
| export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`; | ||
| export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800; | ||
| export const MINIMAX_M3_CONTEXT_WINDOW = 1_000_000; |
There was a problem hiding this comment.
M3 上下文窗口常量已定义但未生效
Line 10 定义了 MINIMAX_M3_CONTEXT_WINDOW,但 Line 80 仍固定使用 DEFAULT_MINIMAX_CONTEXT_WINDOW。这会让 MiniMax-M3 仍以 204800 运行,而不是 1,000,000。
建议修复(按 modelId 解析 contextWindow)
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800;
export const MINIMAX_M3_CONTEXT_WINDOW = 1_000_000;
@@
export function resolveMinimaxApiCost(modelId: string): ModelDefinitionConfig["cost"] {
@@
return MINIMAX_API_COST;
}
+
+export function resolveMinimaxContextWindow(modelId: string): number {
+ if (modelId === "MiniMax-M3") {
+ return MINIMAX_M3_CONTEXT_WINDOW;
+ }
+ return DEFAULT_MINIMAX_CONTEXT_WINDOW;
+}
@@
export function buildMinimaxApiModelDefinition(modelId: string): ModelDefinitionConfig {
return buildMinimaxModelDefinition({
id: modelId,
cost: resolveMinimaxApiCost(modelId),
- contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
+ contextWindow: resolveMinimaxContextWindow(modelId),
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
});
}Also applies to: 76-81
🤖 Prompt for 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.
In `@extensions/minimax/model-definitions.ts` at line 10, The constant
MINIMAX_M3_CONTEXT_WINDOW is defined but not used; update the code path that
currently uses DEFAULT_MINIMAX_CONTEXT_WINDOW so it selects the context window
based on the modelId (e.g., return MINIMAX_M3_CONTEXT_WINDOW when modelId
indicates "MiniMax-M3", otherwise fall back to DEFAULT_MINIMAX_CONTEXT_WINDOW).
Locate the code that resolves the context window (the place referencing
DEFAULT_MINIMAX_CONTEXT_WINDOW) and implement a conditional switch or lookup by
modelId to return MINIMAX_M3_CONTEXT_WINDOW for MiniMax-M3.
| export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID; | ||
| export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`; | ||
| export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800; | ||
| export const MINIMAX_M3_CONTEXT_WINDOW = 1_000_000; |
There was a problem hiding this comment.
主包同样遗漏了 M3 的 contextWindow 切换
和 extension 版本一致,Line 10 的 MINIMAX_M3_CONTEXT_WINDOW 没有在 Line 80 的构建路径被使用,MiniMax-M3 仍会拿到 204800。
建议修复(与 extension 保持同构)
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800;
export const MINIMAX_M3_CONTEXT_WINDOW = 1_000_000;
@@
export function resolveMinimaxApiCost(modelId: string): ModelDefinitionConfig["cost"] {
@@
return MINIMAX_API_COST;
}
+
+export function resolveMinimaxContextWindow(modelId: string): number {
+ if (modelId === "MiniMax-M3") {
+ return MINIMAX_M3_CONTEXT_WINDOW;
+ }
+ return DEFAULT_MINIMAX_CONTEXT_WINDOW;
+}
@@
export function buildMinimaxApiModelDefinition(modelId: string): ModelDefinitionConfig {
return buildMinimaxModelDefinition({
id: modelId,
cost: resolveMinimaxApiCost(modelId),
- contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
+ contextWindow: resolveMinimaxContextWindow(modelId),
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
});
}Also applies to: 76-81
🤖 Prompt for 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.
In `@minimax/model-definitions.ts` at line 10, MINIMAX_M3_CONTEXT_WINDOW is
defined but not actually used when constructing the MiniMax-M3 model, so
MiniMax-M3 still receives the old 204800 value; update the model-building branch
that creates the MiniMax-M3 instance (the code path referenced around the
build/constructor for "MiniMax-M3") to replace the hardcoded 204800 with
MINIMAX_M3_CONTEXT_WINDOW and ensure any defaulting logic uses that constant;
search for occurrences of "MiniMax-M3", the model constructor/factory, and the
constant MINIMAX_M3_CONTEXT_WINDOW to make the swap so the package behavior
matches the extension version.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/providers/minimax.md (1)
77-84:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win修正 docs/providers/minimax.md 中 MiniMax-M2.7 的 contextWindow 示例值(lines 77-84)
文档示例写了contextWindow: 200000,但代码侧DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800,且buildMinimaxApiModelDefinition("MiniMax-M2.7")/provider-catalog/test 均以该默认值生成(代码中也未见独立的MINIMAX_M27_CONTEXT_WINDOW之类 per-model 常量)。建议将该 JSON 示例与代码权威值对齐为contextWindow: 204800。🤖 Prompt for 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. In `@docs/providers/minimax.md` around lines 77 - 84, Update the example in docs/providers/minimax.md so the MiniMax-M2.7 contextWindow matches the code's authoritative value: replace the JSON sample's contextWindow (currently 200000) with 204800 to align with DEFAULT_MINIMAX_CONTEXT_WINDOW and the value produced by buildMinimaxApiModelDefinition("MiniMax-M2.7"); ensure no per-model constant is introduced—just adjust the doc example to match the existing DEFAULT_MINIMAX_CONTEXT_WINDOW.
♻️ Duplicate comments (1)
extensions/minimax/model-definitions.ts (1)
10-10:⚠️ Potential issue | 🟠 Major | ⚡ Quick winM3 上下文窗口常量已更正但仍未生效
Line 10 的
MINIMAX_M3_CONTEXT_WINDOW已从 1,000,000 更正为 512,000,但 Line 80 仍固定使用DEFAULT_MINIMAX_CONTEXT_WINDOW。这会导致MiniMax-M3实际以 204,800 运行,而不是正确的 512,000。建议仿照
resolveMinimaxApiCost的模式,新增resolveMinimaxContextWindow(modelId)函数并在buildMinimaxApiModelDefinition中使用:♻️ 建议的修复方案
export function resolveMinimaxApiCost(modelId: string): ModelDefinitionConfig["cost"] { if (modelId === "MiniMax-M2.7") { return MINIMAX_M27_API_COST; } if (modelId === "MiniMax-M2.7-highspeed") { return MINIMAX_API_HIGHSPEED_COST; } return MINIMAX_API_COST; } + +export function resolveMinimaxContextWindow(modelId: string): number { + if (modelId === "MiniMax-M3") { + return MINIMAX_M3_CONTEXT_WINDOW; + } + return DEFAULT_MINIMAX_CONTEXT_WINDOW; +} export function buildMinimaxApiModelDefinition(modelId: string): ModelDefinitionConfig { return buildMinimaxModelDefinition({ id: modelId, cost: resolveMinimaxApiCost(modelId), - contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW, + contextWindow: resolveMinimaxContextWindow(modelId), maxTokens: DEFAULT_MINIMAX_MAX_TOKENS, }); }Also applies to: 76-83
🤖 Prompt for 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. In `@extensions/minimax/model-definitions.ts` at line 10, The constant MINIMAX_M3_CONTEXT_WINDOW was updated but the code still uses DEFAULT_MINIMAX_CONTEXT_WINDOW inside buildMinimaxApiModelDefinition, causing MiniMax-M3 to run with the wrong window; add a helper function resolveMinimaxContextWindow(modelId) (modeled after resolveMinimaxApiCost) that returns MINIMAX_M3_CONTEXT_WINDOW for modelId 'MiniMax-M3' and falls back to DEFAULT_MINIMAX_CONTEXT_WINDOW otherwise, then change buildMinimaxApiModelDefinition to call resolveMinimaxContextWindow(modelId) instead of using DEFAULT_MINIMAX_CONTEXT_WINDOW directly so the correct context window is applied.
🧹 Nitpick comments (1)
extensions/minimax/model-definitions.ts (1)
46-54: ⚡ Quick win建议显式处理 MiniMax-M3 以提高代码清晰度
当前实现通过默认分支隐式地为
MiniMax-M3返回MINIMAX_API_COST。建议显式处理以提高可读性和可维护性:♻️ 建议的改进
export function resolveMinimaxApiCost(modelId: string): ModelDefinitionConfig["cost"] { + if (modelId === "MiniMax-M3") { + return MINIMAX_API_COST; + } if (modelId === "MiniMax-M2.7") { return MINIMAX_M27_API_COST; } if (modelId === "MiniMax-M2.7-highspeed") { return MINIMAX_API_HIGHSPEED_COST; } - return MINIMAX_API_COST; + // Fallback for unknown models + return MINIMAX_API_COST; }这样可以清楚地表明 M3 是当前默认模型,并与
MINIMAX_DEFAULT_MODEL_ID保持一致。🤖 Prompt for 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. In `@extensions/minimax/model-definitions.ts` around lines 46 - 54, The function resolveMinimaxApiCost currently falls through to MINIMAX_API_COST for MiniMax-M3 implicitly; explicitly add a branch handling the "MiniMax-M3" model id to return MINIMAX_API_COST so the code documents that M3 is the default and matches MINIMAX_DEFAULT_MODEL_ID. Update resolveMinimaxApiCost to include an if (modelId === "MiniMax-M3") return MINIMAX_API_COST (keeping existing checks for "MiniMax-M2.7" -> MINIMAX_M27_API_COST and "MiniMax-M2.7-highspeed" -> MINIMAX_API_HIGHSPEED_COST) and leave the final default return for unknown ids unchanged.
🤖 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 `@docs/providers/minimax.md`:
- Around line 21-22: Docs state a 200000-token context while code defines
DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800 (see minimax/model-definitions.ts,
minimax/provider-catalog.ts and extensions/minimax); update
docs/providers/minimax.md and docs/zh-CN/providers/minimax.md (including example
JSON5) to use 204800 for MiniMax-M2.7 and MiniMax-M2.7-highspeed, or else add a
brief note that “200K” is a rounded value and show the precise value
DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800 for clarity and consistency with the
code.
---
Outside diff comments:
In `@docs/providers/minimax.md`:
- Around line 77-84: Update the example in docs/providers/minimax.md so the
MiniMax-M2.7 contextWindow matches the code's authoritative value: replace the
JSON sample's contextWindow (currently 200000) with 204800 to align with
DEFAULT_MINIMAX_CONTEXT_WINDOW and the value produced by
buildMinimaxApiModelDefinition("MiniMax-M2.7"); ensure no per-model constant is
introduced—just adjust the doc example to match the existing
DEFAULT_MINIMAX_CONTEXT_WINDOW.
---
Duplicate comments:
In `@extensions/minimax/model-definitions.ts`:
- Line 10: The constant MINIMAX_M3_CONTEXT_WINDOW was updated but the code still
uses DEFAULT_MINIMAX_CONTEXT_WINDOW inside buildMinimaxApiModelDefinition,
causing MiniMax-M3 to run with the wrong window; add a helper function
resolveMinimaxContextWindow(modelId) (modeled after resolveMinimaxApiCost) that
returns MINIMAX_M3_CONTEXT_WINDOW for modelId 'MiniMax-M3' and falls back to
DEFAULT_MINIMAX_CONTEXT_WINDOW otherwise, then change
buildMinimaxApiModelDefinition to call resolveMinimaxContextWindow(modelId)
instead of using DEFAULT_MINIMAX_CONTEXT_WINDOW directly so the correct context
window is applied.
---
Nitpick comments:
In `@extensions/minimax/model-definitions.ts`:
- Around line 46-54: The function resolveMinimaxApiCost currently falls through
to MINIMAX_API_COST for MiniMax-M3 implicitly; explicitly add a branch handling
the "MiniMax-M3" model id to return MINIMAX_API_COST so the code documents that
M3 is the default and matches MINIMAX_DEFAULT_MODEL_ID. Update
resolveMinimaxApiCost to include an if (modelId === "MiniMax-M3") return
MINIMAX_API_COST (keeping existing checks for "MiniMax-M2.7" ->
MINIMAX_M27_API_COST and "MiniMax-M2.7-highspeed" -> MINIMAX_API_HIGHSPEED_COST)
and leave the final default return for unknown ids unchanged.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d334151a-b39f-4f44-bd8a-02a73c011c4c
📒 Files selected for processing (4)
docs/providers/minimax.mddocs/zh-CN/providers/minimax.mdextensions/minimax/model-definitions.tsminimax/model-definitions.ts
✅ Files skipped from review due to trivial changes (1)
- docs/zh-CN/providers/minimax.md
🚧 Files skipped from review as they are similar to previous changes (1)
- minimax/model-definitions.ts
| - **`MiniMax-M2.7`** — previous generation, 200K-token context, text input. | ||
| - **`MiniMax-M2.7-highspeed`** — faster M2.7 tier, 200K-token context, text input. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 描述:搜索 M2.7 模型的上下文窗口定义和使用
# 查找所有上下文窗口相关的常量定义
rg -n -A2 -B2 'CONTEXT_WINDOW|contextWindow' --glob '**/minimax/**' --glob '!node_modules'
# 查找 M2.7 模型定义中的上下文窗口值
ast-grep --pattern $'contextWindow: $_'Repository: linuxhsj/openclaw-zero-token
Length of output: 11077
🌐 Web query:
MiniMax M2.7 model context window size official documentation
💡 Result:
According to the official MiniMax API documentation, the MiniMax-M2.7 model features a context window size of 204,800 tokens [1][2]. This specification applies to both the standard MiniMax-M2.7 and the high-speed version, MiniMax-M2.7-highspeed [1][3]. Other third-party documentation, such as the NVIDIA NIM reference for this model, also confirms the input context length is 204,800 tokens [4].
Citations:
- 1: https://platform.minimax.io/docs/guides/text-generation
- 2: https://platform.minimax.io/docs/guides/models-intro
- 3: https://www.minimax.io/models/text/m27
- 4: https://docs.api.nvidia.com/nim/reference/minimaxai-minimax-m2.7
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the referenced doc snippet
echo "---- docs/providers/minimax.md (lines 1-80) ----"
nl -ba docs/providers/minimax.md | sed -n '1,120p'
# 2) Search for any mention of 192K/192k in the repo
echo "---- Searching for 192K/192k ----"
rg -n --hidden --no-ignore-vcs '192[ -]?K|192[ -]?k|192K-token|192k-token|192K' .
# 3) Search for 200K / 200K-token / 200000 in minimax-related docs/code
echo "---- Searching for 200K / 200000 / 204800 ----"
rg -n '200K|200k|200000|204800' docs extensions minimax
# 4) Search for contextWindow assignments specifically for MiniMax-M2.7
echo "---- contextWindow for MiniMax-M2.7 ----"
rg -n --glob '**/*minimax*' 'MiniMax-M2\.7' docs minimax extensionsRepository: linuxhsj/openclaw-zero-token
Length of output: 182
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the referenced doc snippet
echo "---- docs/providers/minimax.md (lines 1-120) ----"
nl -ba docs/providers/minimax.md | sed -n '1,120p'
# 2) Search for any mention of 192K/192k in the repo
echo "---- Searching for 192K/192k ----"
rg -n --hidden --no-ignore-vcs '192[ -]?K|192[ -]?k|192K-token|192k-token|192K' .
# 3) Search for 200K / 200000 / 204800 in minimax-related docs/code
echo "---- Searching for 200K / 200000 / 204800 ----"
rg -n '200K|200k|200000|204800' docs extensions minimax
# 4) Search for contextWindow assignments specifically for MiniMax-M2.7
echo "---- contextWindow for MiniMax-M2.7 ----"
rg -n --glob '**/*minimax*' 'MiniMax-M2\.7' docs minimax extensionsRepository: linuxhsj/openclaw-zero-token
Length of output: 183
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the referenced doc snippet (no `nl` in sandbox)
echo "---- docs/providers/minimax.md (lines 1-120) ----"
cat -n docs/providers/minimax.md | sed -n '1,140p'
# 2) Search for any mention of 192K/192k in the repo
echo "---- Searching for 192K/192k ----"
rg -n --hidden --no-ignore-vcs '192[ -]?K|192[ -]?k|192K-token|192k-token|192K' .
# 3) Search for 200K / 200000 / 204800 in minimax-related docs/code
echo "---- Searching for 200K / 200000 / 204800 ----"
rg -n '200K|200k|200000|204800' docs extensions minimax
# 4) Search for contextWindow assignments specifically for MiniMax-M2.7
echo "---- contextWindow for MiniMax-M2.7 ----"
rg -n --glob '**/*minimax*' 'MiniMax-M2\.7' docs minimax extensionsRepository: linuxhsj/openclaw-zero-token
Length of output: 4864
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "---- Search repo for 192K occurrences (should be none) ----"
rg -n '192[ -]?K|192[ -]?k|192K-token|192k-token|192K' . || true
echo "---- Search docs/providers/minimax.md for 192 ----"
rg -n '192[ -]?K|192[ -]?k|192K-token|192k-token|192K' docs/providers/minimax.md || true
echo "---- Search docs for MiniMax context numbers (200K/200000/204800) ----"
rg -n 'MiniMax-M2\.7|contextWindow:\s*(200000|204800)|200K-token|204800' docs extensions minimax || true
echo "---- Inspect minimax/onboard.test.ts contextWindow section ----"
sed -n '60,110p' minimax/onboard.test.ts || true
echo "---- Inspect extensions/minimax/onboard.test.ts contextWindow section ----"
sed -n '60,110p' extensions/minimax/onboard.test.ts || trueRepository: linuxhsj/openclaw-zero-token
Length of output: 10394
统一 MiniMax-M2.7 上下文窗口文档与代码口径
- 代码口径:
DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800(minimax/model-definitions.ts/minimax/provider-catalog.ts,extensions/minimax同样为 204800) - 文档口径:
docs/providers/minimax.md标注MiniMax-M2.7/MiniMax-M2.7-highspeed为 “200K-token context”,且示例配置使用contextWindow: 200000;docs/zh-CN/providers/minimax.md同样为 “20 万 token/200000” - 仓库内未检索到 “192K” 相关字样;当前主要不一致是 “200K(200000)” vs “204800”
建议将 docs/providers/minimax.md 与 docs/zh-CN/providers/minimax.md(含示例 JSON5)更新为 204800,或在文档中明确“200K 为四舍五入”的规则,并确保全站一致。
🤖 Prompt for 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.
In `@docs/providers/minimax.md` around lines 21 - 22, Docs state a 200000-token
context while code defines DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800 (see
minimax/model-definitions.ts, minimax/provider-catalog.ts and
extensions/minimax); update docs/providers/minimax.md and
docs/zh-CN/providers/minimax.md (including example JSON5) to use 204800 for
MiniMax-M2.7 and MiniMax-M2.7-highspeed, or else add a brief note that “200K” is
a rounded value and show the precise value DEFAULT_MINIMAX_CONTEXT_WINDOW =
204800 for clarity and consistency with the code.
Summary
Upgrades OpenClaw's MiniMax provider default model from MiniMax-M2.7 to MiniMax-M3 (the latest-generation reasoning model with 1M-token context window and image input support), while retaining M2.7 and M2.7-highspeed in the model catalog.
Changes
Provider catalog (
minimax/,extensions/minimax/)MINIMAX_DEFAULT_MODEL_ID:MiniMax-M2.7→MiniMax-M3MINIMAX_TEXT_MODEL_ORDER: prependMiniMax-M3, keepMiniMax-M2.7andMiniMax-M2.7-highspeedMINIMAX_TEXT_MODEL_CATALOG: addMiniMax-M3entry (name: "MiniMax M3", reasoning: true)MINIMAX_MODERN_MODEL_MATCHERS: extend to matchminimax-m3andminimax-m2.7Cost resolution (
model-definitions.ts)MINIMAX_API_COST: updated to M3 rates (input 0.6 / output 2.4 / cacheRead 0.12 / cacheWrite 0)MINIMAX_M27_API_COST: extracted (M2.7 rates preserved: 0.3 / 1.2 / 0.06 / 0.375)MINIMAX_API_HIGHSPEED_COST: extracted (highspeed rates preserved: 0.6 / 2.4 / 0.06 / 0.375)resolveMinimaxApiCost(modelId): new helper that returns the correct cost table per modelMINIMAX_M3_CONTEXT_WINDOW = 1_000_000: M3-specific 1M-token context window constantbuildMinimaxApiModelDefinitionnow usesresolveMinimaxApiCost(modelId)so per-model rates applyOnboarding
[portalModelRef("MiniMax-M3")]: { alias: "minimax-m3" }increateOAuthHandlerM2.7 (recommended)→M3 (recommended)for both Global and CN endpointsopenclaw.plugin.json(root) andextensions/minimax/openclaw.plugin.jsonTests
model-definitions.test.ts: update assertion to expectMiniMax-M3as default hosted model and M3 cost ratesmodels-config.providers.minimax.test.ts: update expected model order to includeMiniMax-M3minimax.live.test.ts: update default test model toMiniMax-M3Docs
docs/providers/minimax.md: rewrite summary and Model overview section to reflect M3 default, M2.7/M2.7-highspeed retaineddocs/zh-CN/providers/minimax.md: same updates in ChineseWhy M3
Migration
No breaking change for users currently on M2.7 —
MiniMax-M2.7andMiniMax-M2.7-highspeedremain selectable in the catalog. Only the default flips to M3 for fresh onboardings.API docs: https://platform.minimax.io/docs/api-reference/text-anthropic-api
Summary by CodeRabbit
发布说明
新功能
改进
文档
测试