Skip to content

Commit e372b43

Browse files
authored
feat(model): add MiniMax provider prefix for cross-platform model normalization (EveryInc#463)
1 parent 1962f54 commit e372b43

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

src/utils/model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function resolveClaudeFamilyAlias(model: string): string {
3434
* "claude-sonnet-4-6" -> "anthropic/claude-sonnet-4-6"
3535
* "gpt-5.4" -> "openai/gpt-5.4"
3636
* "gemini-2.0" -> "google/gemini-2.0"
37+
* "minimax-m2.7" -> "minimax/minimax-m2.7"
3738
* "anthropic/foo" -> "anthropic/foo" (unchanged)
3839
*/
3940
export function addProviderPrefix(model: string): string {
@@ -42,6 +43,7 @@ export function addProviderPrefix(model: string): string {
4243
if (/^(gpt-|o1-|o3-)/.test(model)) return `openai/${model}`
4344
if (/^gemini-/.test(model)) return `google/${model}`
4445
if (/^qwen-/.test(model)) return `qwen/${model}`
46+
if (/^minimax-/i.test(model)) return `minimax/${model}`
4547
return `anthropic/${model}`
4648
}
4749

tests/model-utils.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ describe("addProviderPrefix", () => {
4040
expect(addProviderPrefix("qwen-3.5-plus")).toBe("qwen/qwen-3.5-plus")
4141
})
4242

43+
test("prefixes MiniMax models with minimax/", () => {
44+
expect(addProviderPrefix("minimax-m2.7")).toBe("minimax/minimax-m2.7")
45+
expect(addProviderPrefix("minimax-m2.5-highspeed")).toBe("minimax/minimax-m2.5-highspeed")
46+
expect(addProviderPrefix("MiniMax-M2.7")).toBe("minimax/MiniMax-M2.7")
47+
})
48+
4349
test("defaults unknown models to anthropic/ prefix", () => {
4450
expect(addProviderPrefix("some-model")).toBe("anthropic/some-model")
4551
})

tests/openclaw-converter.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,26 @@ describe("convertClaudeToOpenClaw", () => {
9191
expect(parsed.data.model).toBe("anthropic/claude-sonnet-4-6")
9292
})
9393

94+
test("prefixes minimax models with minimax/ provider", () => {
95+
const plugin: ClaudePlugin = {
96+
...fixturePlugin,
97+
agents: [
98+
{
99+
name: "minimax-agent",
100+
description: "MiniMax agent",
101+
model: "minimax-m2.7",
102+
body: "Use MiniMax model.",
103+
sourcePath: "/tmp/plugin/agents/minimax.md",
104+
},
105+
],
106+
}
107+
108+
const bundle = convertClaudeToOpenClaw(plugin, defaultOptions)
109+
const skill = bundle.skills.find((s) => s.name === "minimax-agent")
110+
const parsed = parseFrontmatter(skill!.content)
111+
expect(parsed.data.model).toBe("minimax/minimax-m2.7")
112+
})
113+
94114
test("converts commands to skill files (excluding disableModelInvocation)", () => {
95115
const bundle = convertClaudeToOpenClaw(fixturePlugin, defaultOptions)
96116

tests/qwen-converter.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,16 @@ describe("convertClaudeToQwen", () => {
246246
expect(parsed.data.model).toBe("qwen/qwen-max")
247247
})
248248

249+
test("prefixes minimax models with minimax/ provider", () => {
250+
const plugin: ClaudePlugin = {
251+
...fixturePlugin,
252+
agents: [{ name: "a", description: "d", model: "minimax-m2.7", body: "b", sourcePath: "/tmp/a.md" }],
253+
}
254+
const bundle = convertClaudeToQwen(plugin, defaultOptions)
255+
const parsed = parseFrontmatter(bundle.agents[0].content)
256+
expect(parsed.data.model).toBe("minimax/minimax-m2.7")
257+
})
258+
249259
test("passes through already-namespaced models unchanged", () => {
250260
const plugin: ClaudePlugin = {
251261
...fixturePlugin,

0 commit comments

Comments
 (0)