Skip to content

Commit 712bb66

Browse files
author
Zoo (VP)
committed
fix(types,e2e): allow any valid URL for mimoBaseUrl to support local stubs and custom endpoints
1 parent 17d2c14 commit 712bb66

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

‎apps/vscode-e2e/src/suite/provider-cost.test.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,7 @@ suite("Provider Cost Metrics (B17)", function () {
171171
await api.setConfiguration({
172172
apiProvider: "mimo" as const,
173173
mimoApiKey: "stub-key",
174-
// The zod schema restricts mimoBaseUrl to Xiaomi's hosted endpoints,
175-
// but the runtime provider accepts any OpenAI-compatible base URL
176-
// (options.mimoBaseUrl || default). A local stub URL is required to
177-
// exercise the streaming/usage path without network access, so this
178-
// test intentionally widens the type.
179-
mimoBaseUrl: baseUrl as "https://api.xiaomimimo.com/v1",
174+
mimoBaseUrl: baseUrl,
180175
apiModelId: MIMO_MODEL_ID,
181176
})
182177

‎packages/types/src/provider-settings.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,7 @@ const minimaxSchema = apiModelIdProviderModelSchema.extend({
336336
})
337337

338338
const mimoSchema = apiModelIdProviderModelSchema.extend({
339-
mimoBaseUrl: z
340-
.union([
341-
z.literal("https://api.xiaomimimo.com/v1"),
342-
z.literal("https://token-plan-cn.xiaomimimo.com/v1"),
343-
z.literal("https://token-plan-sgp.xiaomimimo.com/v1"),
344-
z.literal("https://token-plan-ams.xiaomimimo.com/v1"),
345-
])
346-
.optional(),
339+
mimoBaseUrl: z.string().url().optional(),
347340
mimoApiKey: z.string().optional(),
348341
})
349342

0 commit comments

Comments
 (0)