fix: set MiniMax-M3 default context to 1m

MiniMax's official M3 model page and release notes describe M3 as supporting up to a 1M-token context window with a guaranteed minimum of 512K. Keep the built-in MiniMax preset aligned with that official default instead of inheriting the older 204.8K MiniMax generation limit.

Constraint: Official MiniMax M3 docs state the M3 API supports up to 1M tokens context window.
Rejected: Keep 204800 and rely on manual provider overrides | that makes the built-in MiniMax preset wrong for new users.
Confidence: high
Scope-risk: narrow
Directive: Do not copy MiniMax-M2.7's 204.8K window onto MiniMax-M3 without re-checking official M3 docs.
Related: https://www.minimax.io/models/text/m3
Related: https://www.minimax.io/blog/minimax-m3
Tested: git diff --check
Tested: bun test src/server/__tests__/provider-presets.test.ts src/server/__tests__/providers-real.test.ts src/server/__tests__/provider-runtime-env.test.ts src/server/__tests__/providers.test.ts src/utils/__tests__/context.test.ts
Not-tested: bun run check:server blocked before execution by expired quarantine entries: server:cron-scheduler, server:providers-real, server:tasks, server:e2e:business-flow, server:e2e:full-flow
This commit is contained in:
程序员阿江(Relakkes) 2026-06-03 10:05:47 +08:00
parent 247da5072f
commit 950590ca5d
7 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
# MiniMax直连 Anthropic 兼容接口)
# 海外用户: ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic
# 国内用户: ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic
# 可用模型: MiniMax-M3默认、MiniMax-M2.7、MiniMax-M2.7-highspeed更快
# 可用模型: MiniMax-M3默认1M 上下文、MiniMax-M2.7、MiniMax-M2.7-highspeed更快
# ============================================================
# ANTHROPIC_AUTH_TOKEN=your_minimax_api_key_here
# ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic

View File

@ -176,7 +176,7 @@ MiniMax provides an Anthropic-compatible API endpoint and can be connected direc
| Model | Description |
|-------|-------------|
| `MiniMax-M3` | Default recommended, latest generation with excellent overall performance |
| `MiniMax-M3` | Default recommended, latest generation with excellent overall performance and 1M context |
| `MiniMax-M2.7` | Previous stable release |
| `MiniMax-M2.7-highspeed` | Faster responses, suitable for latency-sensitive use cases |

View File

@ -176,7 +176,7 @@ MiniMax 提供 Anthropic 兼容接口,支持直接接入,无需代理。可
| 模型 | 说明 |
|------|------|
| `MiniMax-M3` | 默认推荐,最新一代综合性能优秀 |
| `MiniMax-M3` | 默认推荐,最新一代综合性能优秀,支持 1M 上下文 |
| `MiniMax-M2.7` | 上一代稳定版本 |
| `MiniMax-M2.7-highspeed` | 响应更快,适合对速度有要求的场景 |

View File

@ -98,7 +98,7 @@ describe('provider presets API', () => {
expect(kimi?.defaultEnv?.CC_HAHA_SEND_DISABLED_THINKING).toBe('1')
expect(minimax?.authStrategy).toBe('auth_token')
expect(minimax?.defaultModels.main).toBe('MiniMax-M3')
expect(minimax?.modelContextWindows?.['MiniMax-M3']).toBe(204800)
expect(minimax?.modelContextWindows?.['MiniMax-M3']).toBe(1000000)
expect(jiekouai?.baseUrl).toBe('https://api.jiekou.ai/anthropic')
expect(jiekouai?.authStrategy).toBe('auth_token')
expect(jiekouai?.defaultModels.main).toBe('claude-sonnet-4-6')

View File

@ -70,7 +70,7 @@ describe('Real Provider Configs', () => {
expect((settings.env as Record<string, string>).ANTHROPIC_API_KEY).toBe('')
expect((settings.env as Record<string, string>).ANTHROPIC_MODEL).toBe('MiniMax-M3')
expect(JSON.parse((settings.env as Record<string, string>).CLAUDE_CODE_MODEL_CONTEXT_WINDOWS)).toMatchObject({
'MiniMax-M3': 204800,
'MiniMax-M3': 1000000,
'MiniMax-M2.7': 204800,
'MiniMax-M2.7-highspeed': 204800,
})
@ -108,7 +108,7 @@ describe('Real Provider Configs', () => {
let settings = await readCcHahaSettings()
expect((settings.env as Record<string, string>).ANTHROPIC_BASE_URL).toBe('https://api.minimaxi.com/anthropic')
expect(JSON.parse((settings.env as Record<string, string>).CLAUDE_CODE_MODEL_CONTEXT_WINDOWS)).toMatchObject({
'MiniMax-M3': 204800,
'MiniMax-M3': 1000000,
'MiniMax-M2.7': 204800,
'MiniMax-M2.7-highspeed': 204800,
})

View File

@ -108,7 +108,7 @@
"apiKeyUrl": "https://platform.minimaxi.com/subscribe/token-plan?code=1TG2Cseab2&source=link",
"authStrategy": "auth_token",
"modelContextWindows": {
"MiniMax-M3": 204800,
"MiniMax-M3": 1000000,
"MiniMax-M2.7": 204800,
"MiniMax-M2.7-highspeed": 204800
}

View File

@ -16,7 +16,7 @@ const DIRECT_MODEL_CONTEXT_WINDOWS: Record<string, number> = {
'kimi-k2-turbo-preview': 262_144,
'kimi-k2-thinking': 262_144,
'kimi-k2-thinking-turbo': 262_144,
'minimax-m3': 204_800,
'minimax-m3': 1_000_000,
'minimax-m2.7': 204_800,
'minimax-m2.7-highspeed': 204_800,
'glm-5.1': 200_000,