Skip to content

Add MiniMax M3 provider defaults#273

Open
octo-patch wants to merge 2 commits into
linuxhsj:mainfrom
octo-patch:octo/20260708-add-target-provider-model-to-existing-provider-registry-recvoNmj63a7U8
Open

Add MiniMax M3 provider defaults#273
octo-patch wants to merge 2 commits into
linuxhsj:mainfrom
octo-patch:octo/20260708-add-target-provider-model-to-existing-provider-registry-recvoNmj63a7U8

Conversation

@octo-patch

@octo-patch octo-patch commented Jul 9, 2026

Copy link
Copy Markdown

Reason: add target provider/model to existing provider registry

Summary

  • Add MiniMax-M3 to the MiniMax provider catalog and make it the default model.
  • Update MiniMax Anthropic-compatible endpoints to the documented /anthropic paths for global and CN regions.
  • Refresh MiniMax M3 context and pricing defaults in provider model definitions and tests.

Test plan

  • git diff --check
  • Secret scan with the configured Octopatch regex
  • pnpm install --frozen-lockfile (failed: environment has Node v20.20.2 but package requires >=22.12.0, then disk filled during install with ENOSPC)
  • pnpm exec vitest run minimax/model-definitions.test.ts minimax/onboard.test.ts extensions/minimax/model-definitions.test.ts extensions/minimax/onboard.test.ts (not run successfully: vitest unavailable because install failed)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 新功能

    • 默认模型升级为 MiniMax-M3,并加入模型目录。
    • 保留对 MiniMax-M2.7 及高速版本的支持。
    • MiniMax-M3 支持推理能力。
  • 改进

    • 上下文窗口提升至 1,000,000 tokens。
    • 更新输入、输出及缓存读取计费配置。
    • 国内与国际配置入口均默认使用 MiniMax-M3。

Reason: add target provider/model to existing provider registry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

MiniMax 默认模型从 MiniMax-M2.7 切换为 MiniMax-M3,并同步更新模型目录、现代模型匹配、上下文窗口、API 计费配置、onboard 默认值及相关测试。

Changes

MiniMax M3 模型配置更新

Layer / File(s) Summary
默认模型目录切换为 M3
minimax/provider-models.ts, extensions/minimax/provider-models.ts
默认模型、文本模型顺序、目录条目及现代模型匹配器支持 MiniMax-M3,并保留现有模型。
上下文窗口与计费配置更新
minimax/model-definitions.ts, minimax/provider-catalog.ts, extensions/minimax/model-definitions.ts, extensions/minimax/provider-catalog.ts, minimax/model-definitions.test.ts, extensions/minimax/model-definitions.test.ts
默认上下文窗口更新为 1000000,计费值调整并移除 cacheWrite;模型定义测试改用 MiniMax-M3
onboard 默认模型与测试同步
minimax/onboard.ts, extensions/minimax/onboard.ts, minimax/onboard.test.ts, extensions/minimax/onboard.test.ts
四个 onboard 函数默认使用 MiniMax-M3,并同步推理、别名、参数保留及模型合并测试。

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
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.
Description check ⚠️ Warning 描述仅包含简短摘要和测试计划,缺少模板要求的多数必填区块与字段。 按模板补全 Summary、Change Type、Scope、User-visible/Behavior、Security Impact、Verification、Evidence、Human Verification 等部分。
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed 标题准确概括了将 MiniMax M3 设为默认 provider 配置的主要变更。
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
minimax/provider-models.ts (1)

3-22: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

更新 Minimax 默认模型对应的测试断言

MINIMAX_DEFAULT_MODEL_ID 已切到 "MiniMax-M3"src/commands/onboard-auth.test.ts:420-435 里这条合并测试仍断言最后一个模型是 "MiniMax-M2.7";把它改成 "MiniMax-M3",否则这条测试会和默认配置不一致。

🤖 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/provider-models.ts` around lines 3 - 22, The Minimax default model
has changed to MiniMax-M3, so the onboarding auth test in onboard-auth.test.ts
still asserting MiniMax-M2.7 is now out of sync. Update the affected test
expectation to match MINIMAX_DEFAULT_MODEL_ID and the default model selection
logic used by the Minimax provider model constants, so the merged-model
assertion reflects MiniMax-M3.
🤖 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 `@extensions/minimax/model-definitions.ts`:
- Around line 5-15: `MINIMAX_API_COST` in
`MINIMAX_API_BASE_URL`/`MINIMAX_API_COST` definitions is missing the
`cacheWrite` entry, which makes it incompatible with places expecting a full
`ModelDefinitionConfig["cost"]`. Add the missing `cacheWrite` field to
`MINIMAX_API_COST` alongside `input`, `output`, and `cacheRead`, keeping the
existing naming and structure in `model-definitions.ts`.

In `@minimax/index.ts`:
- Around line 32-33: The MiniMax default base URL has changed, so the onboard
auth test is still asserting the old value. Update the `applyMinimaxApiConfig`
expectation in `src/commands/onboard-auth.test.ts` to match the new
`DEFAULT_BASE_URL_GLOBAL` value used by `minimax/index.ts`, so the baseUrl
assertion checks `https://api.minimax.io/anthropic/v1` instead of the outdated
URL.

In `@minimax/model-definitions.ts`:
- Around line 5-15: `MINIMAX_API_COST` is missing the `cacheWrite` field, which
is used by `buildMinimaxApiModelDefinition`, `provider-catalog.ts`, and
`estimateUsageCost` when computing usage cost. Update the `MINIMAX_API_COST`
object in `model-definitions` to include `cacheWrite` with a default value of 0
so cost estimation remains valid and does not produce undefined/NaN results.

In `@minimax/provider-catalog.ts`:
- Around line 11-17: The Minimax config behavior has changed, but the onboarding
auth test still asserts the old values. Update the assertions in
onboard-auth.test.ts to match applyMinimaxApiConfig and the Minimax provider
behavior now using https://api.minimax.io/anthropic/v1 and the new model value
instead of the old baseUrl and "MiniMax-M2.7". Keep the test expectations
aligned with the relevant Minimax symbols so the suite reflects the current
provider catalog behavior.

---

Outside diff comments:
In `@minimax/provider-models.ts`:
- Around line 3-22: The Minimax default model has changed to MiniMax-M3, so the
onboarding auth test in onboard-auth.test.ts still asserting MiniMax-M2.7 is now
out of sync. Update the affected test expectation to match
MINIMAX_DEFAULT_MODEL_ID and the default model selection logic used by the
Minimax provider model constants, so the merged-model assertion reflects
MiniMax-M3.
🪄 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: 62a82df7-d54a-46ff-bcbb-9141744b37cb

📥 Commits

Reviewing files that changed from the base of the PR and between a654bcf and 5f431e5.

📒 Files selected for processing (14)
  • extensions/minimax/index.ts
  • extensions/minimax/model-definitions.test.ts
  • extensions/minimax/model-definitions.ts
  • extensions/minimax/onboard.test.ts
  • extensions/minimax/onboard.ts
  • extensions/minimax/provider-catalog.ts
  • extensions/minimax/provider-models.ts
  • minimax/index.ts
  • minimax/model-definitions.test.ts
  • minimax/model-definitions.ts
  • minimax/onboard.test.ts
  • minimax/onboard.ts
  • minimax/provider-catalog.ts
  • minimax/provider-models.ts

Comment thread extensions/minimax/model-definitions.ts Outdated
Comment on lines +5 to +15
export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic/v1";
export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic/v1";
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 DEFAULT_MINIMAX_CONTEXT_WINDOW = 1000000;
export const DEFAULT_MINIMAX_MAX_TOKENS = 131072;

export const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 查找 MINIMAX_API_COST 的类型定义,确认 cacheWrite 是否为可选字段
rg -n "cacheWrite" extensions/minimax/ --type=ts -C3
rg -n "interface.*cost\|type.*cost\|cacheWrite\?:" extensions/minimax/ src/ --type=ts -C3

Repository: linuxhsj/openclaw-zero-token

Length of output: 1497


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant source file and shared type definitions for cost typing.
sed -n '1,120p' extensions/minimax/model-definitions.ts

printf '\n--- SEARCH ModelDefinitionConfig / cost typing ---\n'
rg -n "type ModelDefinitionConfig|interface ModelDefinitionConfig|cost:" src extensions -g '*.ts' -C 3

printf '\n--- SEARCH cost references in minimax ---\n'
rg -n "MINIMAX_API_COST|MINIMAX_.*COST|cacheWrite" extensions/minimax -g '*.ts' -C 2

Repository: linuxhsj/openclaw-zero-token

Length of output: 50385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- extensions/minimax/model-definitions.ts ---'
sed -n '1,120p' extensions/minimax/model-definitions.ts

printf '\n%s\n' '--- cost type definitions ---'
rg -n "type ModelDefinitionConfig|interface ModelDefinitionConfig|cost\s*:\s*\{" src extensions -g '*.ts' -C 3 | sed -n '1,220p'

printf '\n%s\n' '--- direct MINIMAX_API_COST usages ---'
rg -n "MINIMAX_API_COST" extensions src -g '*.ts' -C 3

Repository: linuxhsj/openclaw-zero-token

Length of output: 23693


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the shared ModelDefinitionConfig type and the cost shape.
rg -n "export (type|interface) ModelDefinitionConfig|cost\s*[:?]" src extensions packages openclaw -g '*.ts' -C 4

printf '\n--- provider-model-shared files ---\n'
fd -a "provider-model-shared" . -t f

printf '\n--- files that define cacheWrite in model cost types ---\n'
rg -n "cacheWrite.*\?" src extensions packages openclaw -g '*.ts' -C 2

Repository: linuxhsj/openclaw-zero-token

Length of output: 50385


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the shared model-definition type file, then inspect the cost shape directly.
fd -a "provider-model-shared*.ts" src extensions packages openclaw -t f
printf '\n--- possible matches for ModelDefinitionConfig ---\n'
rg -n "export (type|interface) ModelDefinitionConfig|type ModelDefinitionConfig|interface ModelDefinitionConfig" src extensions packages openclaw -g '*.ts' -C 4 | sed -n '1,200p'

printf '\n--- cacheWrite optional/required in shared types ---\n'
rg -n "cacheWrite\??:" src extensions packages openclaw -g '*.ts' -C 4 | sed -n '1,220p'

Repository: linuxhsj/openclaw-zero-token

Length of output: 1273


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- src/config/types.models.ts (ModelDefinitionConfig) ---'
sed -n '1,180p' src/config/types.models.ts

printf '\n%s\n' '--- src/plugin-sdk/provider-model-shared.ts ---'
sed -n '1,220p' src/plugin-sdk/provider-model-shared.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 4117


补回 cacheWrite 字段 extensions/minimax/model-definitions.ts:12-15 里的 MINIMAX_API_COST 少了 cacheWrite,但它会被传给要求完整 ModelDefinitionConfig["cost"] 的位置,当前会产生类型不匹配。

🤖 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 5 - 15,
`MINIMAX_API_COST` in `MINIMAX_API_BASE_URL`/`MINIMAX_API_COST` definitions is
missing the `cacheWrite` entry, which makes it incompatible with places
expecting a full `ModelDefinitionConfig["cost"]`. Add the missing `cacheWrite`
field to `MINIMAX_API_COST` alongside `input`, `output`, and `cacheRead`,
keeping the existing naming and structure in `model-definitions.ts`.

Comment thread minimax/index.ts Outdated
Comment on lines +32 to +33
const DEFAULT_BASE_URL_CN = "https://api.minimaxi.com/anthropic/v1";
const DEFAULT_BASE_URL_GLOBAL = "https://api.minimax.io/anthropic/v1";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 检查下游测试文件中是否仍有旧的 baseUrl 断言
rg -n 'api\.minimax\.io/anthropic"' src/commands/onboard-auth.test.ts
# 检查下游测试文件中是否仍有旧的 MiniMax-M2.7 默认模型断言
rg -n 'MiniMax-M2\.7' src/commands/onboard-auth.test.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 888


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) 定位实现与测试,确认 baseUrl 的实际生成逻辑和相关断言
rg -n 'DEFAULT_BASE_URL_(CN|GLOBAL)|applyMinimaxApiConfig|baseUrl' minimax/index.ts src/commands/onboard-auth.test.ts

# 2) 只读取相关小片段,避免整文件过大输出
sed -n '1,120p' minimax/index.ts
printf '\n--- onboard-auth.test.ts excerpt ---\n'
sed -n '370,440p' src/commands/onboard-auth.test.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 10325


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 找出 applyMinimaxApiConfig 的实现和它默认写入 baseUrl 的位置
rg -n 'function applyMinimaxApiConfig|export .*applyMinimaxApiConfig|baseUrl: .*anthropic|DEFAULT_BASE_URL_GLOBAL|DEFAULT_BASE_URL_CN' -S .

# 只读相关实现片段
printf '\n--- plugin-sdk/minimax.js / onboard.ts candidates ---\n'
fd -a 'minimax.*' .
fd -a 'onboard.*' .

Repository: linuxhsj/openclaw-zero-token

Length of output: 22472


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 读取 applyMinimaxApiConfig 的实现,确认它是否使用了新的 /v1 默认值
sed -n '1,180p' minimax/onboard.ts

printf '\n--- src/commands/onboard-auth.test.ts excerpt ---\n'
sed -n '380,435p' src/commands/onboard-auth.test.ts

printf '\n--- extensions/minimax/onboard.test.ts excerpt ---\n'
sed -n '1,120p' extensions/minimax/onboard.test.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 9171


同步更新 src/commands/onboard-auth.test.ts 的 MiniMax baseUrl 断言

applyMinimaxApiConfig({}) 现在写入的是 https://api.minimax.io/anthropic/v1,但这里仍在断言旧值 https://api.minimax.io/anthropic,会导致这条测试失败。把断言改成新默认值即可。

🤖 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/index.ts` around lines 32 - 33, The MiniMax default base URL has
changed, so the onboard auth test is still asserting the old value. Update the
`applyMinimaxApiConfig` expectation in `src/commands/onboard-auth.test.ts` to
match the new `DEFAULT_BASE_URL_GLOBAL` value used by `minimax/index.ts`, so the
baseUrl assertion checks `https://api.minimax.io/anthropic/v1` instead of the
outdated URL.

Comment thread minimax/model-definitions.ts Outdated
Comment on lines +5 to +15
export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic/v1";
export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic/v1";
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 DEFAULT_MINIMAX_CONTEXT_WINDOW = 1000000;
export const DEFAULT_MINIMAX_MAX_TOKENS = 131072;

export const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 搜索下游代码中对 MINIMAX_API_COST.cacheWrite 的引用
rg -n 'cacheWrite' minimax/ src/ --type=ts -g '!**/*.test.ts' -g '!**/node_modules/**'
# 搜索 MINIMAX_API_COST 的所有使用点
rg -n 'MINIMAX_API_COST' minimax/ src/ --type=ts -g '!**/node_modules/**'

Repository: linuxhsj/openclaw-zero-token

Length of output: 32636


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## minimax/model-definitions.ts\n'
cat -n minimax/model-definitions.ts | sed -n '1,120p'

printf '\n## minimax/provider-catalog.ts\n'
cat -n minimax/provider-catalog.ts | sed -n '1,120p'

printf '\n## minimax/api.ts\n'
cat -n minimax/api.ts | sed -n '1,120p'

printf '\n## minimax/model-definitions.test.ts\n'
cat -n minimax/model-definitions.test.ts | sed -n '1,120p'

printf '\n## minimax files outline\n'
ast-grep outline minimax/model-definitions.ts --view expanded
ast-grep outline minimax/provider-catalog.ts --view expanded

Repository: linuxhsj/openclaw-zero-token

Length of output: 9212


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## ModelDefinitionConfig / cost types\n'
rg -n 'interface ModelDefinitionConfig|type ModelDefinitionConfig|cost:' src minimax -g '!**/*.test.ts' -g '!**/node_modules/**'

printf '\n## config defaults / merge logic around cost\n'
rg -n 'DEFAULT_MODEL_COST|cacheWrite.*cost|raw\.cost|cost\.cacheWrite|merge.*cost' src minimax -g '!**/*.test.ts' -g '!**/node_modules/**'

printf '\n## minimax-specific cost references\n'
rg -n 'MINIMAX_API_COST|MINIMAX_HOSTED_COST|MINIMAX_LM_STUDIO_COST|cacheWrite' minimax -g '!**/*.test.ts' -g '!**/node_modules/**'

Repository: linuxhsj/openclaw-zero-token

Length of output: 23160


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## src/config/types.models.ts\n'
cat -n src/config/types.models.ts | sed -n '58,90p'

printf '\n## src/config/defaults.ts\n'
cat -n src/config/defaults.ts | sed -n '30,90p'
printf '\n--\n'
cat -n src/config/defaults.ts | sed -n '260,285p'

printf '\n## src/utils/usage-format.ts\n'
cat -n src/utils/usage-format.ts | sed -n '235,265p'

printf '\n## minimax/model-definitions.ts references\n'
rg -n 'MINIMAX_API_COST|MINIMAX_HOSTED_COST|MINIMAX_LM_STUDIO_COST' minimax src -g '!**/*.test.ts' -g '!**/node_modules/**'

Repository: linuxhsj/openclaw-zero-token

Length of output: 6265


补上 MINIMAX_API_COST.cacheWrite

buildMinimaxApiModelDefinitionprovider-catalog.ts 都直接复用这个成本对象,而 estimateUsageCost 会读取 cost.cacheWrite 参与计算。这里缺少字段会让 Minimax API 的成本估算变成 undefined/NaN;直接补 cacheWrite: 0 即可。

🤖 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` around lines 5 - 15, `MINIMAX_API_COST` is
missing the `cacheWrite` field, which is used by
`buildMinimaxApiModelDefinition`, `provider-catalog.ts`, and `estimateUsageCost`
when computing usage cost. Update the `MINIMAX_API_COST` object in
`model-definitions` to include `cacheWrite` with a default value of 0 so cost
estimation remains valid and does not produce undefined/NaN results.

Comment thread minimax/provider-catalog.ts Outdated
Comment on lines +11 to +17
const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic/v1";
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 1000000;
const MINIMAX_DEFAULT_MAX_TOKENS = 131072;
const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 验证下游测试中的断言是否已更新
rg -n 'api\.minimax\.io/anthropic"' src/commands/onboard-auth.test.ts
rg -n 'MiniMax-M2\.7' src/commands/onboard-auth.test.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 888


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '380,440p' src/commands/onboard-auth.test.ts
printf '\n---\n'
sed -n '1,120p' minimax/provider-catalog.ts

Repository: linuxhsj/openclaw-zero-token

Length of output: 3805


同步 src/commands/onboard-auth.test.ts 中的 Minimax 断言
applyMinimaxApiConfig 现在返回 https://api.minimax.io/anthropic/v1,但 src/commands/onboard-auth.test.ts 里仍有旧的 baseUrl"MiniMax-M2.7" 断言;这些用例需要一起改成新行为,否则测试会继续失败。

🤖 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/provider-catalog.ts` around lines 11 - 17, The Minimax config
behavior has changed, but the onboarding auth test still asserts the old values.
Update the assertions in onboard-auth.test.ts to match applyMinimaxApiConfig and
the Minimax provider behavior now using https://api.minimax.io/anthropic/v1 and
the new model value instead of the old baseUrl and "MiniMax-M2.7". Keep the test
expectations aligned with the relevant Minimax symbols so the suite reflects the
current provider catalog behavior.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
minimax/model-definitions.ts (1)

9-15: 🗄️ Data Integrity & Integration | 🟠 Major

恢复 MINIMAX_API_COST.cacheWrite

ModelDefinitionConfig.costcacheWrite 是必需数字字段,而 buildMinimaxApiModelDefinition 在 Line 55 直接传入该对象。删除字段会破坏模型配置契约,并使下游使用写缓存成本时产生无效结果。请补回 cacheWrite: 0(若该 API 不计写缓存费用)。

🤖 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` around lines 9 - 15, Restore the required
cacheWrite field in MINIMAX_API_COST with a value of 0, preserving the cost
object consumed by buildMinimaxApiModelDefinition and its
ModelDefinitionConfig.cost contract.
minimax/provider-catalog.ts (1)

12-17: 🗄️ Data Integrity & Integration | 🟠 Major

保留完整的成本配置结构

当前 MINIMAX_API_COST 删除了必需的 cacheWrite 字段,但该对象会被直接写入模型定义的 cost。请保留该字段,并在没有对应费用时使用 cacheWrite: 0,避免类型不匹配和成本计算异常。

🤖 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/provider-catalog.ts` around lines 12 - 17, Restore the required
cacheWrite property in MINIMAX_API_COST with a value of 0, preserving the
complete cost configuration structure used by the model definition and avoiding
type or cost-calculation issues.
extensions/minimax/model-definitions.ts (1)

9-15: 🗄️ Data Integrity & Integration | 🟠 Major

保留必需的 cacheWrite 字段

ModelDefinitionConfig.cost 要求 cacheWrite 为数字,但这里删除后,MINIMAX_API_COST 会直接传入模型定义并供下游计费使用,可能导致类型错误或 undefined/NaN 成本计算。若 MiniMax 不收取写缓存费用,请显式设置 cacheWrite: 0

 const MINIMAX_API_COST = {
   input: ...,
   output: ...,
   cacheRead: ...,
+  cacheWrite: 0,
 };
🤖 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 9 - 15,
MINIMAX_API_COST is missing the required numeric cacheWrite field. Add
cacheWrite with a value of 0 to the cost configuration, preserving the existing
input, output, and cacheRead values for downstream model definitions and
billing.
extensions/minimax/provider-catalog.ts (1)

12-17: 🗄️ Data Integrity & Integration | 🟠 Major

不要删除 cacheWrite

这里的 MINIMAX_API_COST 会在 buildMinimaxModel 中直接作为完整模型成本配置使用。共享类型要求 cacheWrite 必须存在;没有该字段会造成模型配置契约不完整,并可能使成本估算得到 undefined/NaN。请在无写缓存费用时设置 cacheWrite: 0

🤖 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/provider-catalog.ts` around lines 12 - 17, 保留并补充
MINIMAX_API_COST 中必需的 cacheWrite 字段;由于当前没有写缓存费用,将其设置为 0,确保 buildMinimaxModel
使用的完整成本配置符合共享类型要求。
🤖 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.

Outside diff comments:
In `@extensions/minimax/model-definitions.ts`:
- Around line 9-15: MINIMAX_API_COST is missing the required numeric cacheWrite
field. Add cacheWrite with a value of 0 to the cost configuration, preserving
the existing input, output, and cacheRead values for downstream model
definitions and billing.

In `@extensions/minimax/provider-catalog.ts`:
- Around line 12-17: 保留并补充 MINIMAX_API_COST 中必需的 cacheWrite 字段;由于当前没有写缓存费用,将其设置为
0,确保 buildMinimaxModel 使用的完整成本配置符合共享类型要求。

In `@minimax/model-definitions.ts`:
- Around line 9-15: Restore the required cacheWrite field in MINIMAX_API_COST
with a value of 0, preserving the cost object consumed by
buildMinimaxApiModelDefinition and its ModelDefinitionConfig.cost contract.

In `@minimax/provider-catalog.ts`:
- Around line 12-17: Restore the required cacheWrite property in
MINIMAX_API_COST with a value of 0, preserving the complete cost configuration
structure used by the model definition and avoiding type or cost-calculation
issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5dba2f1f-42c6-45d2-9ee0-84c5f7eb67b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5f431e5 and 8c6531b.

📒 Files selected for processing (6)
  • extensions/minimax/model-definitions.ts
  • extensions/minimax/onboard.test.ts
  • extensions/minimax/provider-catalog.ts
  • minimax/model-definitions.ts
  • minimax/onboard.test.ts
  • minimax/provider-catalog.ts

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