From f5b20199e7c124436a4dc79b7981c4c67cd07e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A0=D0=BE=D0=B4=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Mon, 6 Apr 2026 19:43:21 +0300 Subject: [PATCH 1/3] feat(minimax): add new models and update descriptions with pricing info - Add MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5-highspeed, MiniMax-M2.1-highspeed models - Update contextWindow for MiniMax-M2 and MiniMax-M2.1 from 192000 to 204800 - Add pricing links and TokenPlan billing notes to model descriptions - Add highspeed subscription note to -highspeed models - Update tests for new models and corrected contextWindow values --- packages/types/src/providers/minimax.ts | 80 ++++++++++++++++--- src/api/providers/__tests__/minimax.spec.ts | 66 ++++++++++++++- .../hooks/__tests__/useSelectedModel.spec.ts | 49 ++++++++++++ 3 files changed, 181 insertions(+), 14 deletions(-) diff --git a/packages/types/src/providers/minimax.ts b/packages/types/src/providers/minimax.ts index a47907168d6..ed449ae09b6 100644 --- a/packages/types/src/providers/minimax.ts +++ b/packages/types/src/providers/minimax.ts @@ -1,9 +1,9 @@ import type { ModelInfo } from "../model.js" // Minimax -// https://platform.minimax.io/docs/guides/pricing -// https://platform.minimax.io/docs/api-reference/text-openai-api -// https://platform.minimax.io/docs/api-reference/text-anthropic-api +// https://platform.minimax.io/docs/guides/models-intro +// https://platform.minimax.io/docs/guides/pricing-paygo +// https://platform.minimax.io/docs/guides/pricing-tokenplan export type MinimaxModelId = keyof typeof minimaxModels export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.5" @@ -21,11 +21,56 @@ export const minimaxModels = { cacheWritesPrice: 0.375, cacheReadsPrice: 0.03, description: - "MiniMax M2.5, the latest MiniMax model with enhanced coding and agentic capabilities, building on the strengths of the M2 series.", + "MiniMax M2.5, the latest MiniMax model with enhanced coding and agentic capabilities, building on the strengths of the M2 series. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.", + }, + "MiniMax-M2.5-highspeed": { + maxTokens: 16_384, + contextWindow: 204_800, + supportsImages: false, + supportsPromptCache: true, + includedTools: ["search_and_replace"], + excludedTools: ["apply_diff"], + preserveReasoning: true, + inputPrice: 0.6, + outputPrice: 2.4, + cacheWritesPrice: 0.375, + cacheReadsPrice: 0.03, + description: + "MiniMax M2.5 highspeed: same performance as M2.5 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.", + }, + "MiniMax-M2.7": { + maxTokens: 16_384, + contextWindow: 204_800, + supportsImages: false, + supportsPromptCache: true, + includedTools: ["search_and_replace"], + excludedTools: ["apply_diff"], + preserveReasoning: true, + inputPrice: 0.3, + outputPrice: 1.2, + cacheWritesPrice: 0.375, + cacheReadsPrice: 0.06, + description: + "MiniMax M2.7, the latest MiniMax model with recursive self-improvement capabilities. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.", + }, + "MiniMax-M2.7-highspeed": { + maxTokens: 16_384, + contextWindow: 204_800, + supportsImages: false, + supportsPromptCache: true, + includedTools: ["search_and_replace"], + excludedTools: ["apply_diff"], + preserveReasoning: true, + inputPrice: 0.6, + outputPrice: 2.4, + cacheWritesPrice: 0.375, + cacheReadsPrice: 0.06, + description: + "MiniMax M2.7 highspeed: same performance as M2.7 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.", }, "MiniMax-M2": { maxTokens: 16_384, - contextWindow: 192_000, + contextWindow: 204_800, supportsImages: false, supportsPromptCache: true, includedTools: ["search_and_replace"], @@ -36,11 +81,11 @@ export const minimaxModels = { cacheWritesPrice: 0.375, cacheReadsPrice: 0.03, description: - "MiniMax M2, a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed.", + "MiniMax M2, a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.", }, "MiniMax-M2-Stable": { maxTokens: 16_384, - contextWindow: 192_000, + contextWindow: 204_800, supportsImages: false, supportsPromptCache: true, includedTools: ["search_and_replace"], @@ -51,11 +96,11 @@ export const minimaxModels = { cacheWritesPrice: 0.375, cacheReadsPrice: 0.03, description: - "MiniMax M2 Stable (High Concurrency, Commercial Use), a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed.", + "MiniMax M2 Stable (High Concurrency, Commercial Use), a model born for Agents and code, featuring Top-tier Coding Capabilities, Powerful Agentic Performance, and Ultimate Cost-Effectiveness & Speed. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.", }, "MiniMax-M2.1": { maxTokens: 16_384, - contextWindow: 192_000, + contextWindow: 204_800, supportsImages: false, supportsPromptCache: true, includedTools: ["search_and_replace"], @@ -66,7 +111,22 @@ export const minimaxModels = { cacheWritesPrice: 0.375, cacheReadsPrice: 0.03, description: - "MiniMax M2.1 builds on M2 with improved overall performance for agentic coding tasks and significantly faster response times.", + "MiniMax M2.1 builds on M2 with improved overall performance for agentic coding tasks and significantly faster response times. See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Note: When using TokenPlan, usage is billed per request, not per token.", + }, + "MiniMax-M2.1-highspeed": { + maxTokens: 16_384, + contextWindow: 204_800, + supportsImages: false, + supportsPromptCache: true, + includedTools: ["search_and_replace"], + excludedTools: ["apply_diff"], + preserveReasoning: true, + inputPrice: 0.6, + outputPrice: 2.4, + cacheWritesPrice: 0.375, + cacheReadsPrice: 0.03, + description: + "MiniMax M2.1 highspeed: same performance as M2.1 but with faster response (approximately 100 tps vs 60 tps). See pricing at https://platform.minimax.io/docs/guides/pricing-paygo. Requires TokenPlan High-Speed subscription for use with TokenPlan keys. Note: When using TokenPlan, usage is billed per request, not per token.", }, } as const satisfies Record diff --git a/src/api/providers/__tests__/minimax.spec.ts b/src/api/providers/__tests__/minimax.spec.ts index e5df368f50d..8072f6f73b0 100644 --- a/src/api/providers/__tests__/minimax.spec.ts +++ b/src/api/providers/__tests__/minimax.spec.ts @@ -112,7 +112,7 @@ describe("MiniMaxHandler", () => { const model = handlerWithModel.getModel() expect(model.id).toBe(testModelId) expect(model.info).toEqual(minimaxModels[testModelId]) - expect(model.info.contextWindow).toBe(192_000) + expect(model.info.contextWindow).toBe(204_800) expect(model.info.maxTokens).toBe(16_384) expect(model.info.supportsPromptCache).toBe(true) expect(model.info.cacheWritesPrice).toBe(0.375) @@ -128,7 +128,7 @@ describe("MiniMaxHandler", () => { const model = handlerWithModel.getModel() expect(model.id).toBe(testModelId) expect(model.info).toEqual(minimaxModels[testModelId]) - expect(model.info.contextWindow).toBe(192_000) + expect(model.info.contextWindow).toBe(204_800) expect(model.info.maxTokens).toBe(16_384) expect(model.info.supportsPromptCache).toBe(true) expect(model.info.cacheWritesPrice).toBe(0.375) @@ -399,7 +399,7 @@ describe("MiniMaxHandler", () => { it("should correctly configure MiniMax-M2 model properties", () => { const model = minimaxModels["MiniMax-M2"] expect(model.maxTokens).toBe(16_384) - expect(model.contextWindow).toBe(192_000) + expect(model.contextWindow).toBe(204_800) expect(model.supportsImages).toBe(false) expect(model.supportsPromptCache).toBe(true) expect(model.inputPrice).toBe(0.3) @@ -411,7 +411,7 @@ describe("MiniMaxHandler", () => { it("should correctly configure MiniMax-M2-Stable model properties", () => { const model = minimaxModels["MiniMax-M2-Stable"] expect(model.maxTokens).toBe(16_384) - expect(model.contextWindow).toBe(192_000) + expect(model.contextWindow).toBe(204_800) expect(model.supportsImages).toBe(false) expect(model.supportsPromptCache).toBe(true) expect(model.inputPrice).toBe(0.3) @@ -419,5 +419,63 @@ describe("MiniMaxHandler", () => { expect(model.cacheWritesPrice).toBe(0.375) expect(model.cacheReadsPrice).toBe(0.03) }) + + it("should correctly configure MiniMax-M2.7 model properties", () => { + const model = minimaxModels["MiniMax-M2.7"] + expect(model.maxTokens).toBe(16_384) + expect(model.contextWindow).toBe(204_800) + expect(model.supportsImages).toBe(false) + expect(model.supportsPromptCache).toBe(true) + expect(model.inputPrice).toBe(0.3) + expect(model.outputPrice).toBe(1.2) + expect(model.cacheWritesPrice).toBe(0.375) + expect(model.cacheReadsPrice).toBe(0.06) + }) + + it("should correctly configure MiniMax-M2.7-highspeed model properties", () => { + const model = minimaxModels["MiniMax-M2.7-highspeed"] + expect(model.maxTokens).toBe(16_384) + expect(model.contextWindow).toBe(204_800) + expect(model.supportsImages).toBe(false) + expect(model.supportsPromptCache).toBe(true) + expect(model.inputPrice).toBe(0.6) + expect(model.outputPrice).toBe(2.4) + expect(model.cacheWritesPrice).toBe(0.375) + expect(model.cacheReadsPrice).toBe(0.06) + }) + + it("should correctly configure MiniMax-M2.5-highspeed model properties", () => { + const model = minimaxModels["MiniMax-M2.5-highspeed"] + expect(model.maxTokens).toBe(16_384) + expect(model.contextWindow).toBe(204_800) + expect(model.supportsImages).toBe(false) + expect(model.supportsPromptCache).toBe(true) + expect(model.inputPrice).toBe(0.6) + expect(model.outputPrice).toBe(2.4) + expect(model.cacheWritesPrice).toBe(0.375) + expect(model.cacheReadsPrice).toBe(0.03) + }) + + it("should correctly configure MiniMax-M2.1-highspeed model properties", () => { + const model = minimaxModels["MiniMax-M2.1-highspeed"] + expect(model.maxTokens).toBe(16_384) + expect(model.contextWindow).toBe(204_800) + expect(model.supportsImages).toBe(false) + expect(model.supportsPromptCache).toBe(true) + expect(model.inputPrice).toBe(0.6) + expect(model.outputPrice).toBe(2.4) + expect(model.cacheWritesPrice).toBe(0.375) + expect(model.cacheReadsPrice).toBe(0.03) + }) + + it("should correctly configure MiniMax-M2.1 model properties with updated context window", () => { + const model = minimaxModels["MiniMax-M2.1"] + expect(model.contextWindow).toBe(204_800) + }) + + it("should correctly configure MiniMax-M2 model properties with updated context window", () => { + const model = minimaxModels["MiniMax-M2"] + expect(model.contextWindow).toBe(204_800) + }) }) }) diff --git a/webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts b/webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts index 2c24e4b565f..ed408d4e597 100644 --- a/webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts +++ b/webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts @@ -11,6 +11,8 @@ import { BEDROCK_1M_CONTEXT_MODEL_IDS, litellmDefaultModelInfo, openAiModelInfoSaneDefaults, + minimaxDefaultModelId, + minimaxModels, } from "@roo-code/types" import { useSelectedModel } from "../useSelectedModel" @@ -725,4 +727,51 @@ describe("useSelectedModel", () => { expect(result.current.info).toEqual(customModelInfo) }) }) + + describe("minimax provider", () => { + beforeEach(() => { + mockUseRouterModels.mockReturnValue({ + data: { + openrouter: {}, + requesty: {}, + litellm: {}, + }, + isLoading: false, + isError: false, + } as any) + + mockUseOpenRouterModelProviders.mockReturnValue({ + data: {}, + isLoading: false, + isError: false, + } as any) + }) + + it("should return default minimax model when no custom model is specified", () => { + const apiConfiguration: ProviderSettings = { + apiProvider: "minimax", + } + + const wrapper = createWrapper() + const { result } = renderHook(() => useSelectedModel(apiConfiguration), { wrapper }) + + expect(result.current.provider).toBe("minimax") + expect(result.current.id).toBe(minimaxDefaultModelId) + expect(result.current.info).toEqual(minimaxModels[minimaxDefaultModelId]) + }) + + it("should use custom model ID and info when model exists in minimaxModels", () => { + const apiConfiguration: ProviderSettings = { + apiProvider: "minimax", + apiModelId: "MiniMax-M2.7", + } + + const wrapper = createWrapper() + const { result } = renderHook(() => useSelectedModel(apiConfiguration), { wrapper }) + + expect(result.current.provider).toBe("minimax") + expect(result.current.id).toBe("MiniMax-M2.7") + expect(result.current.info).toEqual(minimaxModels["MiniMax-M2.7"]) + }) + }) }) From 00d50de236a9c8d5e1725b0ab79d5769c5643329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A0=D0=BE=D0=B4=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Mon, 6 Apr 2026 21:50:13 +0300 Subject: [PATCH 2/3] feat(minimax): set MiniMax-M2.7 as default model --- packages/types/src/providers/minimax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/providers/minimax.ts b/packages/types/src/providers/minimax.ts index ed449ae09b6..2ac02cf9af5 100644 --- a/packages/types/src/providers/minimax.ts +++ b/packages/types/src/providers/minimax.ts @@ -5,7 +5,7 @@ import type { ModelInfo } from "../model.js" // https://platform.minimax.io/docs/guides/pricing-paygo // https://platform.minimax.io/docs/guides/pricing-tokenplan export type MinimaxModelId = keyof typeof minimaxModels -export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.5" +export const minimaxDefaultModelId: MinimaxModelId = "MiniMax-M2.7" export const minimaxModels = { "MiniMax-M2.5": { From b19f2eed99d0cc4d6dcd951db37e18a69cb281a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A0=D0=BE=D0=B4=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Tue, 7 Apr 2026 01:32:24 +0300 Subject: [PATCH 3/3] test(minimax): update default model test to M2.7 --- src/api/providers/__tests__/minimax.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/providers/__tests__/minimax.spec.ts b/src/api/providers/__tests__/minimax.spec.ts index 8072f6f73b0..37f6f127982 100644 --- a/src/api/providers/__tests__/minimax.spec.ts +++ b/src/api/providers/__tests__/minimax.spec.ts @@ -191,10 +191,10 @@ describe("MiniMaxHandler", () => { expect(model.info).toEqual(minimaxModels[minimaxDefaultModelId]) }) - it("should default to MiniMax-M2.5 model", () => { + it("should default to MiniMax-M2.7 model", () => { const handlerDefault = new MiniMaxHandler({ minimaxApiKey: "test-minimax-api-key" }) const model = handlerDefault.getModel() - expect(model.id).toBe("MiniMax-M2.5") + expect(model.id).toBe("MiniMax-M2.7") }) })