From a39605ede3a291435b7ef4944f870239a4d1ba74 Mon Sep 17 00:00:00 2001 From: tianyuan <2720711917@qq.com> Date: Sun, 23 Aug 2026 07:21:43 +0800 Subject: [PATCH 1/3] feat(auth): add Kimi (Moonshot AI) as a built-in third-party provider Adds a Moonshot preset to the /auth Third-party Providers menu, offering the international and China API endpoints and seeding the current Kimi model catalog. Moonshot speaks the OpenAI protocol, so this is a declarative preset with no new mechanism. K3 is registered as thinking-mandatory: the API exposes reasoning_effort but no way to turn thinking off, so a disable shape must never reach the wire. K2.6 stays text-only, matching the modality metadata the Token Plan and Idealab presets already carry for that model. Registers the new credential env key everywhere a provider key has to appear: the no-AK CI gate and its pinned assertion list, and the telemetry provider mapping (by env key and by hostname). Closes #9197 --- .github/workflows/ci.yml | 1 + docs/users/configuration/auth.md | 2 +- docs/users/overview.md | 2 +- .../__tests__/presets/moonshot.test.ts | 125 ++++++++++++++++++ packages/core/src/providers/all-providers.ts | 3 + packages/core/src/providers/index.ts | 1 + .../core/src/providers/presets/moonshot.ts | 60 +++++++++ .../src/telemetry/gen-ai-provider.test.ts | 3 + .../core/src/telemetry/gen-ai-provider.ts | 7 + scripts/tests/no-ak-integration-ci.test.js | 1 + 10 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 packages/core/src/providers/__tests__/presets/moonshot.test.ts create mode 100644 packages/core/src/providers/presets/moonshot.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c3e0f329bf..53d817b3c2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -583,6 +583,7 @@ jobs: IDEALAB_API_KEY: '' MINIMAX_API_KEY: '' MODELSCOPE_API_KEY: '' + MOONSHOT_API_KEY: '' OPENROUTER_API_KEY: '' REQUESTY_API_KEY: '' XAI_API_KEY: '' diff --git a/docs/users/configuration/auth.md b/docs/users/configuration/auth.md index 158d6c48e7c..e8b58d3045b 100644 --- a/docs/users/configuration/auth.md +++ b/docs/users/configuration/auth.md @@ -3,7 +3,7 @@ Qwen Code's first-run `/auth` menu has three top-level options. Pick the one that matches how you want to run the CLI: - **Alibaba ModelStudio**: official recommended setup. Opens a sub-menu with **Coding Plan** (for individual developers · weekly quota included), **Token Plan** (for teams and companies · usage-based billing with a dedicated endpoint), or **Standard API Key** (connect with an existing ModelStudio API key). -- **Third-party Providers**: choose a built-in provider and connect with an API key (DeepSeek, MiniMax, Z.AI, Idealab, ModelScope, OpenRouter, Requesty). +- **Third-party Providers**: choose a built-in provider and connect with an API key (DeepSeek, Grok, MiniMax, Z.AI, Kimi, Idealab, ModelScope, OpenRouter, Requesty). - **Custom Provider**: manually connect a local server, proxy, or unsupported provider — supports OpenAI, Anthropic, Gemini, and other compatible endpoints. > [!note] diff --git a/docs/users/overview.md b/docs/users/overview.md index 367cef2b6ef..ff9042e0958 100644 --- a/docs/users/overview.md +++ b/docs/users/overview.md @@ -40,7 +40,7 @@ cd your-project qwen ``` -On first launch you'll be prompted to connect a model provider. The menu offers **Alibaba ModelStudio** (Coding Plan, Token Plan, or Standard API Key), **Third-party Providers** (built-in providers such as DeepSeek, MiniMax, Z.AI, and OpenRouter, connected with an API key), and **Custom Provider** (a local server, proxy, or unsupported provider). For the [Alibaba Cloud Coding Plan](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)), choose **Alibaba ModelStudio → Coding Plan**; to use a ModelStudio API key, choose **Alibaba ModelStudio → Standard API Key** and follow the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)). Then let's start with understanding your codebase. Try one of these commands: +On first launch you'll be prompted to connect a model provider. The menu offers **Alibaba ModelStudio** (Coding Plan, Token Plan, or Standard API Key), **Third-party Providers** (built-in providers such as DeepSeek, MiniMax, Z.AI, Kimi, and OpenRouter, connected with an API key), and **Custom Provider** (a local server, proxy, or unsupported provider). For the [Alibaba Cloud Coding Plan](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)), choose **Alibaba ModelStudio → Coding Plan**; to use a ModelStudio API key, choose **Alibaba ModelStudio → Standard API Key** and follow the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)). Then let's start with understanding your codebase. Try one of these commands: ``` what does this project do? diff --git a/packages/core/src/providers/__tests__/presets/moonshot.test.ts b/packages/core/src/providers/__tests__/presets/moonshot.test.ts new file mode 100644 index 00000000000..e0664ab7db6 --- /dev/null +++ b/packages/core/src/providers/__tests__/presets/moonshot.test.ts @@ -0,0 +1,125 @@ +/** + * @license + * Copyright 2026 Qwen Team + * SPDX-License-Identifier: Apache-2.0 + */ + +import { describe, expect, it } from 'vitest'; +import { AuthType } from '../../../core/contentGenerator.js'; +import { moonshotProvider } from '../../presets/moonshot.js'; +import { + ALL_PROVIDERS, + THIRD_PARTY_PROVIDERS, + findProviderByCredentials, + findProviderById, + getAllProviderBaseUrls, +} from '../../all-providers.js'; +import { buildInstallPlan } from '../../provider-config.js'; + +const INTL_BASE_URL = 'https://api.moonshot.ai/v1'; +const CHINA_BASE_URL = 'https://api.moonshot.cn/v1'; + +describe('moonshotProvider', () => { + it('has correct provider config', () => { + expect(moonshotProvider).toMatchObject({ + id: 'moonshot', + label: 'Kimi (Moonshot AI) API Key', + protocol: AuthType.USE_OPENAI, + envKey: 'MOONSHOT_API_KEY', + modelNamePrefix: 'Kimi', + modelsEditable: true, + uiGroup: 'third-party', + }); + }); + + it('offers international and China endpoints', () => { + expect(Array.isArray(moonshotProvider.baseUrl)).toBe(true); + const urls = (moonshotProvider.baseUrl as Array<{ url: string }>).map( + (o) => o.url, + ); + expect(urls).toEqual([INTL_BASE_URL, CHINA_BASE_URL]); + }); + + it('is registered and discoverable in the provider registry', () => { + expect(findProviderById('moonshot')).toBe(moonshotProvider); + expect(ALL_PROVIDERS).toContain(moonshotProvider); + expect(THIRD_PARTY_PROVIDERS).toContain(moonshotProvider); + expect(getAllProviderBaseUrls()).toContain(INTL_BASE_URL); + expect(getAllProviderBaseUrls()).toContain(CHINA_BASE_URL); + }); + + it('is found by its env key + base URL credentials', () => { + expect( + findProviderByCredentials(INTL_BASE_URL, 'MOONSHOT_API_KEY')?.id, + ).toBe('moonshot'); + expect( + findProviderByCredentials(CHINA_BASE_URL, 'MOONSHOT_API_KEY')?.id, + ).toBe('moonshot'); + // Wrong base URL for the right key must not match. + expect( + findProviderByCredentials( + 'https://wrong.example.com/v1', + 'MOONSHOT_API_KEY', + ), + ).toBeUndefined(); + }); + + it('creates an install plan with per-model metadata for known IDs', () => { + const plan = buildInstallPlan(moonshotProvider, { + baseUrl: INTL_BASE_URL, + apiKey: 'sk-moonshot', + modelIds: ['kimi-k3', 'kimi-k2.7-code', 'kimi-k2.6'], + }); + + const models = plan.modelProviders?.[0]?.models; + expect(models).toHaveLength(3); + + // K3 always thinks: mandatory, never a plain enable_thinking toggle. + expect(models?.[0]).toMatchObject({ + id: 'kimi-k3', + name: '[Kimi] kimi-k3', + generationConfig: { + contextWindowSize: 1000000, + thinkingMandatory: true, + modalities: { image: true, video: true }, + }, + }); + expect(models?.[0]?.generationConfig?.extra_body).toBeUndefined(); + + expect(models?.[1]).toMatchObject({ + id: 'kimi-k2.7-code', + name: '[Kimi] kimi-k2.7-code', + generationConfig: { + contextWindowSize: 262144, + extra_body: { enable_thinking: true }, + modalities: { image: true, video: true }, + }, + }); + + // K2.6 is text-only, matching modalityDefaults for that ID. + expect(models?.[2]).toMatchObject({ + id: 'kimi-k2.6', + name: '[Kimi] kimi-k2.6', + generationConfig: { + contextWindowSize: 262144, + extra_body: { enable_thinking: true }, + }, + }); + expect(models?.[2]?.generationConfig?.modalities).toBeUndefined(); + }); + + it('falls back gracefully for unknown model IDs', () => { + const plan = buildInstallPlan(moonshotProvider, { + baseUrl: CHINA_BASE_URL, + apiKey: 'sk-moonshot', + modelIds: ['kimi-k4-preview'], + }); + + const models = plan.modelProviders?.[0]?.models; + expect(models?.[0]).toMatchObject({ + id: 'kimi-k4-preview', + name: '[Kimi] kimi-k4-preview', + }); + expect(models?.[0]?.generationConfig).toBeUndefined(); + }); +}); diff --git a/packages/core/src/providers/all-providers.ts b/packages/core/src/providers/all-providers.ts index aa5aad3dba6..d2df5813c7e 100644 --- a/packages/core/src/providers/all-providers.ts +++ b/packages/core/src/providers/all-providers.ts @@ -18,6 +18,7 @@ import { deepseekProvider } from './presets/deepseek.js'; import { grokProvider } from './presets/grok.js'; import { minimaxProvider } from './presets/minimax.js'; import { zaiProvider } from './presets/zai.js'; +import { moonshotProvider } from './presets/moonshot.js'; import { idealabProvider } from './presets/idealab.js'; import { modelscopeProvider } from './presets/modelscope.js'; import { customProvider } from './presets/custom-provider.js'; @@ -33,6 +34,7 @@ export { grokProvider, minimaxProvider, zaiProvider, + moonshotProvider, idealabProvider, modelscopeProvider, customProvider, @@ -58,6 +60,7 @@ export const ALL_PROVIDERS: readonly ProviderConfig[] = [ grokProvider, minimaxProvider, zaiProvider, + moonshotProvider, idealabProvider, modelscopeProvider, openRouterProvider, diff --git a/packages/core/src/providers/index.ts b/packages/core/src/providers/index.ts index fbe784bae52..1ec27bddcab 100644 --- a/packages/core/src/providers/index.ts +++ b/packages/core/src/providers/index.ts @@ -51,6 +51,7 @@ export { idealabProvider, minimaxProvider, modelscopeProvider, + moonshotProvider, openRouterProvider, requestyProvider, THIRD_PARTY_PROVIDERS, diff --git a/packages/core/src/providers/presets/moonshot.ts b/packages/core/src/providers/presets/moonshot.ts new file mode 100644 index 00000000000..7d5f4ddb541 --- /dev/null +++ b/packages/core/src/providers/presets/moonshot.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2026 Qwen Team + * SPDX-License-Identifier: Apache-2.0 + */ + +import { AuthType } from '../../core/contentGenerator.js'; +import type { ProviderConfig } from '../types.js'; + +export const moonshotProvider: ProviderConfig = { + id: 'moonshot', + label: 'Kimi (Moonshot AI) API Key', + description: 'Quick setup for Kimi models', + protocol: AuthType.USE_OPENAI, + baseUrl: [ + { + id: 'international', + label: 'International', + url: 'https://api.moonshot.ai/v1', + documentationUrl: 'https://platform.kimi.ai/docs', + }, + { + id: 'china', + label: 'China', + url: 'https://api.moonshot.cn/v1', + documentationUrl: 'https://platform.moonshot.cn/docs', + }, + ], + envKey: 'MOONSHOT_API_KEY', + models: [ + { + id: 'kimi-k3', + contextWindowSize: 1000000, + // K3 always thinks: the API exposes `reasoning_effort` but no way to + // turn thinking off, so never emit a disable shape on the wire. + thinkingMandatory: true, + modalities: { image: true, video: true }, + }, + { + id: 'kimi-k2.7-code', + contextWindowSize: 262144, + enableThinking: true, + modalities: { image: true, video: true }, + }, + { + id: 'kimi-k2.7-code-highspeed', + contextWindowSize: 262144, + enableThinking: true, + modalities: { image: true, video: true }, + }, + { + id: 'kimi-k2.6', + contextWindowSize: 262144, + enableThinking: true, + }, + ], + modelsEditable: true, + modelNamePrefix: 'Kimi', + uiGroup: 'third-party', +}; diff --git a/packages/core/src/telemetry/gen-ai-provider.test.ts b/packages/core/src/telemetry/gen-ai-provider.test.ts index bd8c94bfe44..b48d1e5762b 100644 --- a/packages/core/src/telemetry/gen-ai-provider.test.ts +++ b/packages/core/src/telemetry/gen-ai-provider.test.ts @@ -39,6 +39,8 @@ describe('GenAI provider resolution', () => { ['https://api.deepseek.com/v1', 'deepseek'], ['https://api.x.ai/v1', 'x_ai'], ['https://api.mistral.ai/v1', 'mistral_ai'], + ['https://api.moonshot.ai/v1', 'moonshot'], + ['https://api.moonshot.cn/v1', 'moonshot'], ['https://api.minimax.io/v1', 'minimax'], ['https://api.minimaxi.com/v1', 'minimax'], ['https://api.z.ai/api/paas/v4', 'z_ai'], @@ -126,6 +128,7 @@ describe('GenAI provider resolution', () => { ['MIMO_API_KEY', 'mimo'], ['ZAI_API_KEY', 'z_ai'], ['MODELSCOPE_API_KEY', 'modelscope'], + ['MOONSHOT_API_KEY', 'moonshot'], ['OPENAI_API_KEY', 'openai'], ['XIAOMI_MIMO_API_KEY', 'mimo'], ['OPENROUTER_API_KEY', 'openrouter'], diff --git a/packages/core/src/telemetry/gen-ai-provider.ts b/packages/core/src/telemetry/gen-ai-provider.ts index e699d8dbee4..2d40d34108e 100644 --- a/packages/core/src/telemetry/gen-ai-provider.ts +++ b/packages/core/src/telemetry/gen-ai-provider.ts @@ -30,6 +30,7 @@ const PROVIDER_BY_ENV_KEY: Readonly> = { MIMO_API_KEY: 'mimo', MISTRAL_API_KEY: 'mistral_ai', MODELSCOPE_API_KEY: 'modelscope', + MOONSHOT_API_KEY: 'moonshot', OPENAI_API_KEY: 'openai', OPENROUTER_API_KEY: 'openrouter', REQUESTY_API_KEY: 'requesty', @@ -63,6 +64,12 @@ function providerFromHostname(hostname: string): string | undefined { if (isHostOrSubdomain(hostname, 'deepseek.com')) return 'deepseek'; if (isHostOrSubdomain(hostname, 'x.ai')) return 'x_ai'; if (isHostOrSubdomain(hostname, 'mistral.ai')) return 'mistral_ai'; + if ( + isHostOrSubdomain(hostname, 'moonshot.ai') || + isHostOrSubdomain(hostname, 'moonshot.cn') + ) { + return 'moonshot'; + } if ( isHostOrSubdomain(hostname, 'minimax.io') || isHostOrSubdomain(hostname, 'minimaxi.com') diff --git a/scripts/tests/no-ak-integration-ci.test.js b/scripts/tests/no-ak-integration-ci.test.js index 0756b0236e9..b122dfdbbe5 100644 --- a/scripts/tests/no-ak-integration-ci.test.js +++ b/scripts/tests/no-ak-integration-ci.test.js @@ -213,6 +213,7 @@ describe('no-AK integration CI wiring', () => { 'IDEALAB_API_KEY', 'MINIMAX_API_KEY', 'MODELSCOPE_API_KEY', + 'MOONSHOT_API_KEY', 'OPENAI_API_KEY', 'OPENAI_BASE_URL', 'OPENAI_MODEL', From 7c7f4fcd8700062136a5de579ecdbf0b79aaaa91 Mon Sep 17 00:00:00 2001 From: tianyuan <2720711917@qq.com> Date: Sun, 23 Aug 2026 14:30:38 +0800 Subject: [PATCH 2/3] fix(providers): cover the highspeed code model and sync the quickstart list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review round 1 on #9756 raised two suggestions, both addressed here. The highspeed code model was declared in the preset but asserted nowhere, so its metadata could be corrupted or the entry deleted without CI noticing — and since the default install path ships every preset model, that would silently install a wrong context window or drop the thinking flag from the wire. It now goes through the install plan alongside its sibling with the same assertions; the reviewer's mutation probe turns the suite red instead of green. The quickstart's provider list was the one first-run doc left unsynced, which would have made the three of them disagree about what ships built in. It now matches the registry, picking up the entries that were already stale before this branch. --- docs/users/quickstart.md | 2 +- .../__tests__/presets/moonshot.test.ts | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/users/quickstart.md b/docs/users/quickstart.md index 83896f5f36f..ad5d7538294 100644 --- a/docs/users/quickstart.md +++ b/docs/users/quickstart.md @@ -72,7 +72,7 @@ The first-run menu lets you connect a model provider. Choose one of: - **Coding Plan**: for individual developers, with an included weekly quota and diverse model options. See the [Coding Plan guide](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) for setup instructions. - **Token Plan**: usage-based billing with a dedicated endpoint, aimed at teams and companies. - **Standard API Key**: connect with an existing API key from Alibaba Cloud ModelStudio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)). See the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)) for details. -- **Third-party Providers** — choose a built-in provider (DeepSeek, MiniMax, Z.AI, ModelScope, OpenRouter, Requesty, and more) and connect with an API key. +- **Third-party Providers** — choose a built-in provider (DeepSeek, Grok, MiniMax, Z.AI, Kimi, Idealab, ModelScope, OpenRouter, Requesty, and more) and connect with an API key. - **Custom Provider** — manually connect a local server, proxy, or unsupported provider. > ⚠️ **Note**: Qwen OAuth was discontinued on April 15, 2026. If you were previously using Qwen OAuth, please switch to one of the methods above. diff --git a/packages/core/src/providers/__tests__/presets/moonshot.test.ts b/packages/core/src/providers/__tests__/presets/moonshot.test.ts index e0664ab7db6..e851128a089 100644 --- a/packages/core/src/providers/__tests__/presets/moonshot.test.ts +++ b/packages/core/src/providers/__tests__/presets/moonshot.test.ts @@ -68,11 +68,16 @@ describe('moonshotProvider', () => { const plan = buildInstallPlan(moonshotProvider, { baseUrl: INTL_BASE_URL, apiKey: 'sk-moonshot', - modelIds: ['kimi-k3', 'kimi-k2.7-code', 'kimi-k2.6'], + modelIds: [ + 'kimi-k3', + 'kimi-k2.7-code', + 'kimi-k2.7-code-highspeed', + 'kimi-k2.6', + ], }); const models = plan.modelProviders?.[0]?.models; - expect(models).toHaveLength(3); + expect(models).toHaveLength(4); // K3 always thinks: mandatory, never a plain enable_thinking toggle. expect(models?.[0]).toMatchObject({ @@ -96,8 +101,18 @@ describe('moonshotProvider', () => { }, }); - // K2.6 is text-only, matching modalityDefaults for that ID. expect(models?.[2]).toMatchObject({ + id: 'kimi-k2.7-code-highspeed', + name: '[Kimi] kimi-k2.7-code-highspeed', + generationConfig: { + contextWindowSize: 262144, + extra_body: { enable_thinking: true }, + modalities: { image: true, video: true }, + }, + }); + + // K2.6 is text-only, matching modalityDefaults for that ID. + expect(models?.[3]).toMatchObject({ id: 'kimi-k2.6', name: '[Kimi] kimi-k2.6', generationConfig: { @@ -105,7 +120,7 @@ describe('moonshotProvider', () => { extra_body: { enable_thinking: true }, }, }); - expect(models?.[2]?.generationConfig?.modalities).toBeUndefined(); + expect(models?.[3]?.generationConfig?.modalities).toBeUndefined(); }); it('falls back gracefully for unknown model IDs', () => { From c3e21ad65b65bd508df40bed26ec34dac60e5137 Mon Sep 17 00:00:00 2001 From: tianyuan <2720711917@qq.com> Date: Sun, 23 Aug 2026 18:45:25 +0800 Subject: [PATCH 3/3] fix(providers): correct kimi-k2.6 to multimodal and pin thinking metadata Review round 2 on #9756 caught that the text-only claim for K2.6 was wrong, and checking Moonshot's own documentation confirms it: the K2.6 guide states the model supports text, image, and video input, and ships working image and video examples. The earlier reasoning leaned on #5328 as precedent, but that change only dropped a redundant field from two Alibaba-hosted entries. Because the resolver fills modalities from the shared heuristic table whenever the installed config omits them, and that table already treats the K2.x family as multimodal, the omission never produced a text-only model at runtime. There was no precedent to follow. K2.6 now declares image and video explicitly, so the preset states the capability rather than leaning on a heuristic that could be retuned for other members of the family. Also pins the absence of the thinking-mandatory flag on both code models. Only K3 rejects a thinking-disable shape; marking a toggleable model that way would silently stop the disable from reaching the wire and take away the user's ability to turn thinking off, which the previous assertions would not have caught. --- .../core/src/providers/__tests__/presets/moonshot.test.ts | 6 ++++-- packages/core/src/providers/presets/moonshot.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/providers/__tests__/presets/moonshot.test.ts b/packages/core/src/providers/__tests__/presets/moonshot.test.ts index e851128a089..98ca14edb57 100644 --- a/packages/core/src/providers/__tests__/presets/moonshot.test.ts +++ b/packages/core/src/providers/__tests__/presets/moonshot.test.ts @@ -100,6 +100,7 @@ describe('moonshotProvider', () => { modalities: { image: true, video: true }, }, }); + expect(models?.[1]?.generationConfig?.thinkingMandatory).toBeUndefined(); expect(models?.[2]).toMatchObject({ id: 'kimi-k2.7-code-highspeed', @@ -110,17 +111,18 @@ describe('moonshotProvider', () => { modalities: { image: true, video: true }, }, }); + expect(models?.[2]?.generationConfig?.thinkingMandatory).toBeUndefined(); - // K2.6 is text-only, matching modalityDefaults for that ID. expect(models?.[3]).toMatchObject({ id: 'kimi-k2.6', name: '[Kimi] kimi-k2.6', generationConfig: { contextWindowSize: 262144, extra_body: { enable_thinking: true }, + modalities: { image: true, video: true }, }, }); - expect(models?.[3]?.generationConfig?.modalities).toBeUndefined(); + expect(models?.[3]?.generationConfig?.thinkingMandatory).toBeUndefined(); }); it('falls back gracefully for unknown model IDs', () => { diff --git a/packages/core/src/providers/presets/moonshot.ts b/packages/core/src/providers/presets/moonshot.ts index 7d5f4ddb541..c3dc3cd436c 100644 --- a/packages/core/src/providers/presets/moonshot.ts +++ b/packages/core/src/providers/presets/moonshot.ts @@ -52,6 +52,7 @@ export const moonshotProvider: ProviderConfig = { id: 'kimi-k2.6', contextWindowSize: 262144, enableThinking: true, + modalities: { image: true, video: true }, }, ], modelsEditable: true,