Skip to content

feat(minimax): upgrade default model to MiniMax-M3#241

Open
octo-patch wants to merge 6 commits into
linuxhsj:mainfrom
octo-patch:feature/upgrade-minimax-m3
Open

feat(minimax): upgrade default model to MiniMax-M3#241
octo-patch wants to merge 6 commits into
linuxhsj:mainfrom
octo-patch:feature/upgrade-minimax-m3

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Jun 3, 2026

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.7MiniMax-M3
  • MINIMAX_TEXT_MODEL_ORDER: prepend MiniMax-M3, keep MiniMax-M2.7 and MiniMax-M2.7-highspeed
  • MINIMAX_TEXT_MODEL_CATALOG: add MiniMax-M3 entry (name: "MiniMax M3", reasoning: true)
  • MINIMAX_MODERN_MODEL_MATCHERS: extend to match minimax-m3 and minimax-m2.7

Cost 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 model
  • MINIMAX_M3_CONTEXT_WINDOW = 1_000_000: M3-specific 1M-token context window constant
  • buildMinimaxApiModelDefinition now uses resolveMinimaxApiCost(modelId) so per-model rates apply

Onboarding

  • OAuth alias mapping: add [portalModelRef("MiniMax-M3")]: { alias: "minimax-m3" } in createOAuthHandler
  • Onboarding group hints: M2.7 (recommended)M3 (recommended) for both Global and CN endpoints
  • Mirrored in both openclaw.plugin.json (root) and extensions/minimax/openclaw.plugin.json

Tests

  • model-definitions.test.ts: update assertion to expect MiniMax-M3 as default hosted model and M3 cost rates
  • models-config.providers.minimax.test.ts: update expected model order to include MiniMax-M3
  • minimax.live.test.ts: update default test model to MiniMax-M3

Docs

  • docs/providers/minimax.md: rewrite summary and Model overview section to reflect M3 default, M2.7/M2.7-highspeed retained
  • docs/zh-CN/providers/minimax.md: same updates in Chinese

Why M3

  • 1M-token context window vs. M2.7's 200K — substantially more headroom for long-context agent workflows
  • Native image input support
  • Reasoning model improvements

Migration

No breaking change for users currently on M2.7 — MiniMax-M2.7 and MiniMax-M2.7-highspeed remain 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

发布说明

  • 新功能

    • 将 MiniMax 默认模型切换为 M3,新增/保留 M2.7 与 M2.7-highspeed 选项
  • 改进

    • 为不同 MiniMax 型号提供细化的计费/成本配置
    • 向导与认证提示默认推荐改为 M3
  • 文档

    • 更新中/英文 MiniMax 配置指南、示例(含 CLI、LM Studio、本地示例)并同步示例模型 ID
  • 测试

    • 同步更新相关测试用例的默认模型与成本断言

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

走查概览

本PR将MiniMax推荐模型从M2.7升级到M3,引入模型级成本解析函数,并更新所有配置、文档和测试以适配新的模型默认值及成本结构。

变更

MiniMax M3 模型升级和成本解析

图层 / 文件(s) 摘要
模型定义和动态成本解析
extensions/minimax/model-definitions.ts, minimax/model-definitions.ts
新增 MINIMAX_M3_CONTEXT_WINDOW 常量;重构成本配置为包含 input/output/cacheRead/cacheWrite 的细粒度结构;引入导出函数 resolveMinimaxApiCost(modelId) 根据模型ID动态返回成本对象;在 buildMinimaxApiModelDefinition 中替换为动态成本查询。
提供商模型目录和现代模型匹配
extensions/minimax/provider-models.ts, minimax/provider-models.ts
MINIMAX_DEFAULT_MODEL_ID 从M2.7改为M3;扩展 MINIMAX_TEXT_MODEL_ORDERMINIMAX_TEXT_MODEL_CATALOG 以包含M3(reasoning: true);更新 MINIMAX_MODERN_MODEL_MATCHERS 以识别 minimax-m3 前缀。
认证配置和向导提示
extensions/minimax/index.ts, minimax/index.ts, extensions/minimax/openclaw.plugin.json, minimax/openclaw.plugin.json
在OAuth configPatch 中新增M3的portal模型别名映射;在Global/CN API key和OAuth device_code的四个认证选项中,将 groupHint 从"M2.7 (recommended)"更新为"M3 (recommended)"。
用户文档(英文和中文)
docs/providers/minimax.md, docs/zh-CN/providers/minimax.md
更新文档摘要、模型概览、API密钥配置示例、LM Studio本地推理示例、openclaw configure 向导步骤、Notes与故障排除章节,将默认模型从M2.5/M2.1升级到M3,新增M2.7/M2.7-highspeed描述。
测试验证
extensions/minimax/model-definitions.test.ts, minimax/model-definitions.test.ts, src/agents/minimax.live.test.ts, src/agents/models-config.providers.minimax.test.ts
将默认托管模型断言从M2.7改为M3;同步更新 MINIMAX_API_COST 的成本期望值;更新live test默认模型;更新配置test中minimaxminimax-portal的模型列表期望。

代码审查工作量估计

🎯 3 (中等) | ⏱️ ~20 分钟

🐰 小白兔此刻欢快地蹦跳,
M3 新模型闪闪在召唤,
成本细粒度,向导新文案,
文档已调整,配置齐完善,
测试都更新,升级真漂亮!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR 描述虽然内容充分且结构合理,但未完整遵循仓库规定的描述模板,缺少多个必填部分。 按照模板补充以下必填项:Change Type、Scope、Linked Issue/PR、User-visible Changes、Security Impact、Repro + Verification、Human Verification、Compatibility/Migration、Failure Recovery 和 Risks and Mitigations。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 标题简洁明确,准确反映了此次变更的核心内容——升级 MiniMax 提供商的默认模型至 M3。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 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 `@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

📥 Commits

Reviewing files that changed from the base of the PR and between 4537162 and 267e566.

📒 Files selected for processing (14)
  • docs/providers/minimax.md
  • docs/zh-CN/providers/minimax.md
  • extensions/minimax/index.ts
  • extensions/minimax/model-definitions.test.ts
  • extensions/minimax/model-definitions.ts
  • extensions/minimax/openclaw.plugin.json
  • extensions/minimax/provider-models.ts
  • minimax/index.ts
  • minimax/model-definitions.test.ts
  • minimax/model-definitions.ts
  • minimax/openclaw.plugin.json
  • minimax/provider-models.ts
  • src/agents/minimax.live.test.ts
  • src/agents/models-config.providers.minimax.test.ts

- 你想在 OpenClaw 中使用 MiniMax 模型
- 你需要 MiniMax 设置指南
summary: 在 OpenClaw 中使用 MiniMax M2.1
summary: 在 OpenClaw 中使用 MiniMax M3
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

请改为走 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.

Comment thread extensions/minimax/model-definitions.ts Outdated
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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Comment thread minimax/model-definitions.ts Outdated
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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

主包同样遗漏了 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 win

M3 上下文窗口常量已更正但仍未生效

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

📥 Commits

Reviewing files that changed from the base of the PR and between 267e566 and 6113c73.

📒 Files selected for processing (4)
  • docs/providers/minimax.md
  • docs/zh-CN/providers/minimax.md
  • extensions/minimax/model-definitions.ts
  • minimax/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

Comment thread docs/providers/minimax.md
Comment on lines +21 to +22
- **`MiniMax-M2.7`** — previous generation, 200K-token context, text input.
- **`MiniMax-M2.7-highspeed`** — faster M2.7 tier, 200K-token context, text input.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 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:


🏁 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 extensions

Repository: 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 extensions

Repository: 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 extensions

Repository: 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 || true

Repository: linuxhsj/openclaw-zero-token

Length of output: 10394


统一 MiniMax-M2.7 上下文窗口文档与代码口径

  • 代码口径:DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800minimax/model-definitions.ts / minimax/provider-catalog.tsextensions/minimax 同样为 204800)
  • 文档口径:docs/providers/minimax.md 标注 MiniMax-M2.7 / MiniMax-M2.7-highspeed 为 “200K-token context”,且示例配置使用 contextWindow: 200000docs/zh-CN/providers/minimax.md 同样为 “20 万 token/200000”
  • 仓库内未检索到 “192K” 相关字样;当前主要不一致是 “200K(200000)” vs “204800”

建议将 docs/providers/minimax.mddocs/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.

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.

1 participant