fix(catalog): pinned MiniMax-M3 contextWindow to 1M on minimax-code(-cn) providers

The MiniMax-M3 long-context policy in generated-policies.ts only
covered the anthropic-messages providers `minimax` and `minimax-cn`.
The MiniMax Coding/Token Plan (international and China) endpoints
serve the same model through `minimax-code` and `minimax-code-cn`
on openai-completions, and shipped with the upstream 512K pricing
boundary baked into models.json. Switching to MiniMax-M3 under the
Coding Plan therefore still showed a 512K context window in the
status bar.

Broadens the policy carve-out to all four providers, re-bakes both
affected entries in the bundled models.json, and extends the
generated-policies / bundled-catalog tests to assert 1M for the two
newly covered providers.

Fixes #3097
This commit is contained in:
roboomp
2026-06-20 03:07:50 +00:00
parent 73065ea431
commit 02bd026d5e
5 changed files with 29 additions and 5 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed MiniMax-M3 catalog context for the MiniMax Coding/Token Plan providers `minimax-code` and `minimax-code-cn` to report the documented 1M long-context tier instead of the upstream 512K pricing boundary; the previous patch only covered `minimax`/`minimax-cn`, so the Coding Plan picker still showed 512K in the status bar ([#3097](https://github.com/can1357/oh-my-pi/issues/3097)).
## [16.1.4] - 2026-06-19
### Fixed
+11 -2
View File
@@ -219,8 +219,17 @@ function applyGeneratedModelPolicy(model: ModelSpec<Api>): void {
model.maxTokens = 131_072;
}
// MiniMax-M3: 512K is the standard pricing tier boundary, not the
// model ceiling. Pin the long-context providers to the documented 1M tier.
if ((model.provider === "minimax" || model.provider === "minimax-cn") && model.id === "MiniMax-M3") {
// model ceiling. Pin every long-context provider that serves the model
// (anthropic-messages `minimax`/`minimax-cn` and the openai-completions
// MiniMax Coding/Token Plan endpoints `minimax-code`/`minimax-code-cn`)
// to the documented 1M tier.
if (
model.id === "MiniMax-M3" &&
(model.provider === "minimax" ||
model.provider === "minimax-cn" ||
model.provider === "minimax-code" ||
model.provider === "minimax-code-cn")
) {
model.contextWindow = 1_000_000;
}
+2 -2
View File
@@ -32139,7 +32139,7 @@
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 512000,
"contextWindow": 1000000,
"maxTokens": 128000,
"compat": {
"supportsStore": false,
@@ -32448,7 +32448,7 @@
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 512000,
"contextWindow": 1000000,
"maxTokens": 128000,
"compat": {
"supportsStore": false,
@@ -149,6 +149,13 @@ describe("generated model policies", () => {
contextWindow: 512_000,
maxTokens: 128_000,
}),
createSpec({
id: "MiniMax-M3",
api: "openai-completions",
provider: "minimax-code-cn",
contextWindow: 512_000,
maxTokens: 128_000,
}),
];
applyGeneratedModelPolicies(models);
@@ -157,8 +164,10 @@ describe("generated model policies", () => {
expect(models[0]?.maxTokens).toBe(128_000);
expect(models[1]?.contextWindow).toBe(1_000_000);
expect(models[1]?.maxTokens).toBe(128_000);
expect(models[2]?.contextWindow).toBe(512_000);
expect(models[2]?.contextWindow).toBe(1_000_000);
expect(models[2]?.maxTokens).toBe(128_000);
expect(models[3]?.contextWindow).toBe(1_000_000);
expect(models[3]?.maxTokens).toBe(128_000);
});
it("normalizes Copilot generated fallback limits", () => {
@@ -6,6 +6,8 @@ describe("minimax bundled catalog", () => {
const providers = [
{ id: "minimax", models: modelsJson.minimax },
{ id: "minimax-cn", models: modelsJson["minimax-cn"] },
{ id: "minimax-code", models: modelsJson["minimax-code"] },
{ id: "minimax-code-cn", models: modelsJson["minimax-code-cn"] },
];
for (const provider of providers) {