Skip to content

Commit 3decc86

Browse files
committed
Remove retired MiMo V2.5 catalog entries
What: delete the mimo-v2.5-pro and mimo-v2.5 entries from the MiMo catalog (packages/types/src/providers/mimo.ts) and rewrite the header comment that promised they would stay "until the EOL date passes". Migrate the test pins that used the retired IDs as their fixture model, and add saved-user coverage for the runtime and webview fallback paths. Why: the EOL date (2026-10-21 10:00 GMT+8) has passed and Xiaomi's model names stopped working, so the header's own contract expired. Keeping the entries left dead IDs selectable in the picker; a deprecated banner would only decorate a selection whose name no longer resolves. Impact: MimoModelId narrows to the three V2.6 entries. A saved configuration that still names a retired ID is unaffected at the type level (apiModelId is z.string().optional()) and keeps working: getModel() falls back to mimoDefaultModelInfo for pricing and limits while sending the stored ID unchanged, and the webview preserves the ID with undefined info until the router catalog settles. Both paths are spec-pinned.
1 parent 556cea2 commit 3decc86

6 files changed

Lines changed: 116 additions & 58 deletions

File tree

‎packages/types/src/providers/lite-llm.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export const LITELLM_PRESERVE_REASONING_MODEL_IDS = [
3737
"deepseek-v4-pro",
3838
"deepseek-reasoner",
3939

40-
// mimo.ts, opencode-go.ts
40+
// opencode-go.ts (MiMo V2.5 is retired from mimo.ts; the gateway can still
41+
// front opencode-go's V2.5 routes)
4142
"mimo-v2.5",
4243
"mimo-v2.5-pro",
4344

‎packages/types/src/providers/mimo.ts‎

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ import {
1313
// https://mimo.mi.com/docs/en-US/quick-start/usage-guide/text-generation/deep-thinking
1414
// https://mimo.mi.com/docs/en-US/price/pay-as-you-go
1515
//
16-
// mimo-v2.5-pro and mimo-v2.5 are deprecated on 2026-10-21 10:00 (GMT+8) and
17-
// their model names will stop working. They stay in the catalog as a fallback
18-
// until the EOL date passes; mimo-v2.6-* entries carry the V2.6 series.
16+
// mimo-v2.5-pro and mimo-v2.5 were retired on 2026-10-21 10:00 (GMT+8) and their
17+
// model names stopped working, so they are gone from this catalog: keeping them
18+
// would leave dead IDs selectable. The V2.6 series below replaces them. A saved
19+
// selection that still names a retired ID keeps working through the documented
20+
// runtime fallback -- getMimoModelInfo(id) ?? mimoDefaultModelInfo in
21+
// src/api/providers/mimo.ts -- which prices and limits the request as the
22+
// default model while sending the stored ID through unchanged.
1923
//
2024
// NOTE: mimo-v2-flash is not included here. Its thinking mode defaults to
2125
// disabled and it doesn't reliably handle reasoning_content passthrough
@@ -67,32 +71,6 @@ export const mimoModels = {
6771
description:
6872
"MiMo V2.6 Pro Ultraspeed - V2.6-Pro performance at up to 20x speed for real-time, latency-sensitive workloads.",
6973
},
70-
"mimo-v2.5-pro": {
71-
maxTokens: 131_072,
72-
contextWindow: 1_048_576,
73-
supportsImages: false, // Pro series is text-only
74-
supportsPromptCache: false,
75-
preserveReasoning: true,
76-
inputPrice: 0.435, // $0.435/1M tokens (cache miss)
77-
outputPrice: 0.87, // $0.87/1M tokens
78-
cacheReadsPrice: 0.0036, // $0.0036/1M tokens (cache hit)
79-
cacheWritesPrice: 0, // Free for limited time
80-
description:
81-
"MiMo V2.5 Pro - Deprecated on 2026-10-21. Xiaomi's flagship reasoning model with 1M context, deep thinking, tool calling, and structured output.",
82-
},
83-
"mimo-v2.5": {
84-
maxTokens: 131_072,
85-
contextWindow: 1_048_576,
86-
supportsImages: true, // Full-modal: text, image, audio, video input
87-
supportsPromptCache: false,
88-
preserveReasoning: true,
89-
inputPrice: 0.14, // $0.14/1M tokens (cache miss)
90-
outputPrice: 0.28, // $0.28/1M tokens
91-
cacheReadsPrice: 0.0028, // $0.0028/1M tokens (cache hit)
92-
cacheWritesPrice: 0, // Free for limited time
93-
description:
94-
"MiMo V2.5 - Deprecated on 2026-10-21. Full-modal understanding model (text, image, audio, video) with 1M context, deep thinking, tool calling, and structured output.",
95-
},
9674
} as const satisfies Record<string, ModelInfo>
9775

9876
export const mimoDefaultModelInfo: ModelInfo = mimoModels[mimoDefaultModelId]

‎src/api/providers/__tests__/mimo.spec.ts‎

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ vi.mock("openai", () => {
3434

3535
import type { Anthropic } from "@anthropic-ai/sdk"
3636
import OpenAI from "openai"
37-
import { mimoDefaultModelId, mimoModels } from "@roo-code/types"
37+
import { mimoDefaultModelId, mimoDefaultModelInfo, mimoModels } from "@roo-code/types"
3838
import type { ApiHandlerOptions } from "../../../shared/api"
3939
import { MimoHandler } from "../mimo"
4040
import { ALLOWED_BASE_URLS } from "../fetchers/mimo"
@@ -48,7 +48,7 @@ describe("MimoHandler", () => {
4848
beforeEach(() => {
4949
mockOptions = {
5050
mimoApiKey: "test-api-key",
51-
apiModelId: "mimo-v2.5-pro",
51+
apiModelId: "mimo-v2.6-pro",
5252
mimoBaseUrl: "https://token-plan-sgp.xiaomimimo.com/v1",
5353
}
5454
handler = new MimoHandler(mockOptions)
@@ -58,7 +58,7 @@ describe("MimoHandler", () => {
5858
describe("constructor", () => {
5959
it("should initialize with provided options", () => {
6060
expect(handler).toBeInstanceOf(MimoHandler)
61-
expect(handler.getModel().id).toBe("mimo-v2.5-pro")
61+
expect(handler.getModel().id).toBe("mimo-v2.6-pro")
6262
})
6363

6464
it("should use default model ID if not provided", () => {
@@ -139,22 +139,24 @@ describe("MimoHandler", () => {
139139
})
140140

141141
describe("getModel", () => {
142-
it("should return correct model info for mimo-v2.5-pro", () => {
143-
const model = handler.getModel()
144-
expect(model.id).toBe("mimo-v2.5-pro")
145-
expect(model.info.contextWindow).toBe(1_048_576)
146-
expect(model.info.maxTokens).toBe(131_072)
147-
expect(model.info.inputPrice).toBe(0.435)
148-
expect(model.info.outputPrice).toBe(0.87)
149-
})
150-
151-
it("should return correct model info for mimo-v2.5", () => {
152-
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.5" })
153-
const model = h.getModel()
154-
expect(model.id).toBe("mimo-v2.5")
155-
expect(model.info.inputPrice).toBe(0.14)
156-
expect(model.info.outputPrice).toBe(0.28)
157-
})
142+
// Saved users: a configuration persisted before the V2.5 retirement still carries
143+
// a retired ID, and `apiModelId` is `z.string().optional()`, so nothing rejects it.
144+
// The handler must keep constructing and must price the request as the family
145+
// default -- `getMimoModelInfo` returns undefined for a retired ID, and the
146+
// `?? mimoDefaultModelInfo` fallback supplies the spec. The ID itself is passed
147+
// through unchanged, which is what makes the provider error visible instead of
148+
// silently switching the user's model.
149+
it.each(["mimo-v2.5-pro", "mimo-v2.5"])(
150+
"should fall back to the default spec for the retired model ID %s",
151+
(retiredModelId) => {
152+
const h = new MimoHandler({ ...mockOptions, apiModelId: retiredModelId })
153+
const model = h.getModel()
154+
expect(model.id).toBe(retiredModelId)
155+
expect(model.info).toBe(mimoDefaultModelInfo)
156+
expect(model.info).toBe(mimoModels[mimoDefaultModelId])
157+
expect(model.maxTokens).toBe(mimoDefaultModelInfo.maxTokens)
158+
},
159+
)
158160

159161
it("should return correct model info for mimo-v2.6-pro", () => {
160162
const h = new MimoHandler({ ...mockOptions, apiModelId: "mimo-v2.6-pro" })
@@ -991,7 +993,7 @@ describe("MimoHandler", () => {
991993
await handler.completePrompt("What is 2+2?")
992994

993995
const params = mockCreate.mock.calls[0][0]
994-
expect(params.model).toBe("mimo-v2.5-pro")
996+
expect(params.model).toBe("mimo-v2.6-pro")
995997
expect(params.messages).toHaveLength(1)
996998
expect(params.messages[0].role).toBe("user")
997999
expect(params.messages[0].content).toBe("What is 2+2?")
@@ -1031,8 +1033,28 @@ describe("MimoHandler", () => {
10311033
await expect(handler.completePrompt("Test prompt")).rejects.toThrow("OpenAI completion error:")
10321034
})
10331035

1034-
it("should use correct model ID for mimo-v2.5 variant", async () => {
1035-
const v25Handler = new MimoHandler({
1036+
it("should use correct model ID for mimo-v2.6-flash variant", async () => {
1037+
const flashHandler = new MimoHandler({
1038+
...mockOptions,
1039+
apiModelId: "mimo-v2.6-flash",
1040+
})
1041+
1042+
mockCreate.mockResolvedValueOnce({
1043+
choices: [{ message: { content: "Response" } }],
1044+
})
1045+
1046+
await flashHandler.completePrompt("Test")
1047+
1048+
const params = mockCreate.mock.calls[0][0]
1049+
expect(params.model).toBe("mimo-v2.6-flash")
1050+
})
1051+
1052+
// Saved users: a retired ID is not rewritten on the wire. The spec falls back to
1053+
// the family default (see getModel), but the request still names the ID the user
1054+
// has stored, so the provider's own error reaches the user instead of the
1055+
// extension silently answering as a model they did not pick.
1056+
it("should pass a retired model ID through unchanged on the wire", async () => {
1057+
const retiredHandler = new MimoHandler({
10361058
...mockOptions,
10371059
apiModelId: "mimo-v2.5",
10381060
})
@@ -1041,7 +1063,7 @@ describe("MimoHandler", () => {
10411063
choices: [{ message: { content: "Response" } }],
10421064
})
10431065

1044-
await v25Handler.completePrompt("Test")
1066+
await retiredHandler.completePrompt("Test")
10451067

10461068
const params = mockCreate.mock.calls[0][0]
10471069
expect(params.model).toBe("mimo-v2.5")

‎src/api/providers/fetchers/__tests__/mimo.spec.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ describe("getMimoModels", () => {
4141
description: "MiMo model: mimo-v3-future",
4242
})
4343

44-
// mimo-v2.5-pro is still served today, but this mock response omits it
45-
// (post-EOL world): a model absent from the API response must stay absent
46-
// from the result, guarding against a wholesale-static-map regression.
47-
expect(models["mimo-v2.5-pro"]).toBeUndefined()
44+
// A model that IS in the static catalog but absent from the API response must
45+
// stay absent from the result: a mutation that returned the static map
46+
// wholesale would surface it here. (mimo-v2.6-pro-ultraspeed is the current
47+
// catalog entry this response omits.)
48+
expect(models["mimo-v2.6-pro-ultraspeed"]).toBeUndefined()
4849
})
4950

5051
it("provides MiMo-family defaults for unknown model IDs without pricing", async () => {

‎src/api/providers/mimo.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class MimoHandler extends OpenAiHandler {
135135
const tools = metadata?.tools
136136

137137
// Build request per MiMo's OpenAI-compatible API
138-
// https://developer.puter.com/ai/xiaomi/mimo-v2.5-pro/
138+
// https://mimo.mi.com/docs/en-US/quick-start/usage-guide/text-generation/deep-thinking
139139
// Note: temperature is omitted because MiMo forces it to 1.0 when thinking mode
140140
// is enabled, regardless of what is passed (see model-hyperparameters docs).
141141
const params: Record<string, any> = {

‎webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,5 +2521,61 @@ describe("useSelectedModel", () => {
25212521
expect(result.current.id).toBe(mimoDefaultModelId)
25222522
expect(result.current.info).toEqual(mimoModels[mimoDefaultModelId])
25232523
})
2524+
2525+
// Saved users: a configuration persisted before the V2.5 retirement still names
2526+
// a retired ID, and the static catalog no longer describes it. While the router
2527+
// catalog is unsettled, the selection is PRESERVED with `info: undefined` -- the
2528+
// documented fallback contract of getStaticCatalogSelection. Capability UI falls
2529+
// back to its own defaults for that turn instead of showing the default model's
2530+
// numbers, and the saved ID is never rewritten behind the user's back. Once the
2531+
// router catalog settles, validation takes over (see the populated-catalog test
2532+
// below), which is why the ID is not silently migrated here.
2533+
it("mimo: preserves a retired V2.5 ID with undefined info while the router catalog is unsettled", () => {
2534+
const retiredModelId = "mimo-v2.5"
2535+
2536+
// Guard the premise: the ID must be absent from the static catalog, which is
2537+
// what routes it through the undefined-info path under test.
2538+
expect(Object.hasOwn(mimoModels, retiredModelId)).toBe(false)
2539+
2540+
mockUseRouterModels.mockReturnValue(createRouterModelsResult(undefined, { isLoading: true }))
2541+
mockUseOpenRouterModelProviders.mockReturnValue(createOpenRouterModelProvidersResult({}))
2542+
2543+
const { result } = renderHook(
2544+
() => useSelectedModel({ apiProvider: providerIdentifiers.mimo, apiModelId: retiredModelId }),
2545+
{ wrapper: createWrapper() },
2546+
)
2547+
2548+
expect(result.current.id).toBe(retiredModelId)
2549+
expect(result.current.info).toBeUndefined()
2550+
})
2551+
2552+
// The settled half of the same saved-user path: once the router catalog answers
2553+
// with other IDs, the retired ID is provably not served, so validation resets the
2554+
// selection to the family default and capability UI renders the default's real
2555+
// numbers. This is what the user sees in the picker and the context-window
2556+
// display; the stored ID is only rewritten by ApiOptions' sync effect, and the
2557+
// handler still falls back to the same default spec for requests.
2558+
it("mimo: resets a retired V2.5 ID to the default once the router catalog lists other models", () => {
2559+
const retiredModelId = "mimo-v2.5-pro"
2560+
2561+
expect(Object.hasOwn(mimoModels, retiredModelId)).toBe(false)
2562+
2563+
mockUseRouterModels.mockReturnValue(
2564+
createRouterModelsResult({
2565+
[providerIdentifiers.mimo]: {
2566+
"mimo-v2.6-flash": { contextWindow: 1_048_576, supportsPromptCache: false, maxTokens: 131_072 },
2567+
},
2568+
}),
2569+
)
2570+
mockUseOpenRouterModelProviders.mockReturnValue(createOpenRouterModelProvidersResult({}))
2571+
2572+
const { result } = renderHook(
2573+
() => useSelectedModel({ apiProvider: providerIdentifiers.mimo, apiModelId: retiredModelId }),
2574+
{ wrapper: createWrapper() },
2575+
)
2576+
2577+
expect(result.current.id).toBe(mimoDefaultModelId)
2578+
expect(result.current.info).toEqual(mimoModels[mimoDefaultModelId])
2579+
})
25242580
})
25252581
})

0 commit comments

Comments
 (0)