Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
test(models): align catalog contracts with Kimi and MiniMax updates
Chris4c3e33c0ca10
diff --git a/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts b/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.tsindex f5d13851fc..5d0c0cce5d 100644--- a/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts+++ b/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts@@ -250,7 +250,7 @@ describe('buildProbeRequest', () => {});expect(url).toBe(expectedUrl);expect(JSON.parse(String(init.body))).toMatchObject({- model: 'MiniMax-M3',+ model: runtime!.models[0]!.id,stream: false,store: false,});diff --git a/packages/model-providers/src/__tests__/modelDefaultEffort.test.ts b/packages/model-providers/src/__tests__/modelDefaultEffort.test.tsindex 6bd743c609..48e68a6b32 100644--- a/packages/model-providers/src/__tests__/modelDefaultEffort.test.ts+++ b/packages/model-providers/src/__tests__/modelDefaultEffort.test.ts@@ -77,10 +77,12 @@ describe("medium-first defaults", () => {rawRegistry as unknown as ModelRegistry,)) {if (!model.efforts?.length) continue;- // Grok 4.7 (including Build Fast) uses official high; Kimi Code uses max, unlike our- // medium-first fallback for models without this official default.+ // Preserve the configured Kimi K2.8/K3.1 max defaults and Grok 4.7 high;+ // other entries use the medium-first fallback over their supported efforts.expect(model.defaultEffort, model.id).toBe(- model.id === "moonshotai/kimi-k2.8-preview"+ ["moonshotai/kimi-k2.8-preview", "moonshotai/kimi-k3.1-pro",+ "moonshot-kimi-code/k3.1-pro", "moonshotai/kimi-k3.1-pro-highspeed",+ "moonshot-kimi-code/k3.1-pro-highspeed"].includes(model.id)? "max": ["xai/grok-4.7", "xai/grok-4.7-build-fast"].includes(model.id) ? "high": defaultEffortForCapabilities(model.efforts),diff --git a/packages/model-providers/src/__tests__/presets.test.ts b/packages/model-providers/src/__tests__/presets.test.tsindex b697f95362..c05586e5dd 100644--- a/packages/model-providers/src/__tests__/presets.test.ts+++ b/packages/model-providers/src/__tests__/presets.test.ts@@ -907,15 +907,18 @@ describe('MiniMax OpenAI Responses 预设契约 (issue #345)', () => {const preset = BUNDLED_CATALOG.presets?.find((candidate) => candidate.id === id);expect(preset?.docsUrl).toBe(docsUrl);expect(preset?.runtimes['claude-code']?.baseUrl).toMatch(/\/anthropic$/);- // 以线上服务端推荐清单为准(M2 系列仍在官方文档中)。+ // Match the complete ordered recommendation list and its capabilities. V6 adds+ // resolved interface metadata; route selection is covered by providerInterfaceRoutes.+ // toMatchObject on arrays still rejects missing/extra entries and reordered models.const expected = [+ { id: 'MiniMax-M3.1-Flash', name: 'MiniMax M3.1 Flash', contextWindow: 1_000_000, supportsImageInput: true },{ id: 'MiniMax-M3', name: 'MiniMax-M3', contextWindow: 1_000_000, supportsImageInput: true },...['MiniMax-M2.7', 'MiniMax-M2.7-highspeed', 'MiniMax-M2.5', 'MiniMax-M2.5-highspeed','MiniMax-M2.1', 'MiniMax-M2.1-highspeed', 'MiniMax-M2'].map((id) => ({ id, name: id, contextWindow: 204_800, supportsImageInput: false })),];- expect(preset?.runtimes['claude-code']?.models.filter(model => model.defaultEnabled !== false)).toEqual(expected);- expect({ ...preset?.runtimes.codex, models: preset?.runtimes.codex?.models.filter(model => model.defaultEnabled !== false) }).toEqual({+ expect(preset?.runtimes['claude-code']?.models.filter(model => model.defaultEnabled !== false)).toMatchObject(expected);+ expect({ ...preset?.runtimes.codex, models: preset?.runtimes.codex?.models.filter(model => model.defaultEnabled !== false) }).toMatchObject({baseUrl: codexBaseUrl,models: expected,});@@ -982,7 +985,7 @@ describe('官方渠道预设契约', () => {});it('LongCat 同时提供 Anthropic Messages、Codex 与 Pi Chat 端点', () => {- expect(preset('longcat')?.runtimes).toEqual({+ expect(preset('longcat')?.runtimes).toMatchObject({'claude-code': {baseUrl: 'https://api.longcat.chat/anthropic',modelsUrl: 'https://api.longcat.chat/openai/v1/models',@@ -1145,7 +1148,7 @@ describe('官方渠道预设契约', () => {docsUrl: 'https://help.aliyun.com/zh/model-studio/token-plan-team-overview',regionHint: 'cn',}));- expect(codingPlan?.runtimes['claude-code']).toEqual({+ expect(codingPlan?.runtimes['claude-code']).toMatchObject({baseUrl: 'https://coding.dashscope.aliyuncs.com/apps/anthropic',modelsUrl: 'https://coding.dashscope.aliyuncs.com/v1/models',models: codingPlanModels,@@ -1153,7 +1156,7 @@ describe('官方渠道预设契约', () => {// Codex 走 openai-chat 桥接:桥接未验证图片格式的型号在 Codex 下不声明图片输入。const codexChatImages = (models: readonly { id: string; supportsImageInput?: boolean }[], unverified: string[]) =>models.map((model) => (unverified.includes(model.id) ? { ...model, supportsImageInput: false } : model));- expect(codingPlan?.runtimes.codex).toEqual({+ expect(codingPlan?.runtimes.codex).toMatchObject({baseUrl: 'https://coding.dashscope.aliyuncs.com/v1',wireProtocol: 'openai-chat',models: codexChatImages(codingPlanModels, ['kimi-k2.5']),@@ -1162,12 +1165,12 @@ describe('官方渠道预设契约', () => {[personalTokenPlan, personalTokenPlanModels],[teamTokenPlan, teamTokenPlanModels],] as const) {- expect({ ...tokenPlan?.runtimes['claude-code'], models: tokenPlan?.runtimes['claude-code']?.models.filter(model => model.defaultEnabled !== false) }).toEqual({+ expect({ ...tokenPlan?.runtimes['claude-code'], models: tokenPlan?.runtimes['claude-code']?.models.filter(model => model.defaultEnabled !== false) }).toMatchObject({baseUrl: 'https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic',modelsUrl: tokenPlanModelsUrl,models,});- expect({ ...tokenPlan?.runtimes.codex, models: tokenPlan?.runtimes.codex?.models.filter(model => model.defaultEnabled !== false) }).toEqual({+ expect({ ...tokenPlan?.runtimes.codex, models: tokenPlan?.runtimes.codex?.models.filter(model => model.defaultEnabled !== false) }).toMatchObject({baseUrl: 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',wireProtocol: 'openai-chat',modelsUrl: tokenPlanModelsUrl,@@ -1193,7 +1196,7 @@ describe('官方渠道预设契约', () => {'%s 的 Claude Code 使用官方 [1m] 入口,与 Pi 的 glm-5.3 窗口一致 (#3883)',(id) => {const claudeModels = preset(id)?.runtimes['claude-code']?.models ?? [];- expect(claudeModels.find((model) => model.id === 'glm-5.3[1m]')).toEqual({+ expect(claudeModels.find((model) => model.id === 'glm-5.3[1m]')).toMatchObject({id: 'glm-5.3[1m]',name: 'GLM-5.3 (1M)',contextWindow: 1_000_000,