From 11572b1337999a53eb6be6e657e2b17fd72f49d3 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 13 Jun 2026 23:47:27 +0800 Subject: [PATCH] feat(codex): restore Kimi For Coding preset with thinking on by default The Kimi For Coding preset was removed (74104946) because the coding endpoint (api.kimi.com/coding/v1) enforces a User-Agent whitelist that rejects Codex's default codex-cli UA with 403. The provider-level custom User-Agent feature now lets users override the UA (to claude-cli/*) under proxy takeover, so the preset can be restored. - Re-add the Codex Kimi For Coding preset (openai_chat, kimi-for-coding, 256K context) in the same position it was removed from. - Enable thinking mode by default via codexChatReasoning (supportsThinking true, thinkingParam "thinking"), mirroring the general Kimi preset since both target the same Moonshot model family. The proxy injects thinking:{type:enabled} when Codex requests reasoning. - Restore the trilingual user-manual row to "Kimi / Kimi For Coding". Note: this preset requires proxy takeover and a whitelisted custom User-Agent to work; the default codex-cli UA still gets 403. --- docs/user-manual/en/2-providers/2.1-add.md | 2 +- docs/user-manual/ja/2-providers/2.1-add.md | 2 +- docs/user-manual/zh/2-providers/2.1-add.md | 2 +- src/config/codexProviderPresets.ts | 30 ++++++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/user-manual/en/2-providers/2.1-add.md b/docs/user-manual/en/2-providers/2.1-add.md index 2e1102461..972f9fa75 100644 --- a/docs/user-manual/en/2-providers/2.1-add.md +++ b/docs/user-manual/en/2-providers/2.1-add.md @@ -88,7 +88,7 @@ Codex presets fall into two groups by upstream protocol. |-------------|-------------| | DeepSeek | DeepSeek models | | Zhipu GLM / GLM en | Zhipu AI GLM models | -| Kimi | Moonshot Kimi models | +| Kimi / Kimi For Coding | Moonshot Kimi models | | MiniMax / MiniMax en | MiniMax models | | StepFun / StepFun en | StepFun Step models | | Baidu Qianfan Coding Plan | Baidu Qianfan coding plan | diff --git a/docs/user-manual/ja/2-providers/2.1-add.md b/docs/user-manual/ja/2-providers/2.1-add.md index b913e89fd..b3bce48e2 100644 --- a/docs/user-manual/ja/2-providers/2.1-add.md +++ b/docs/user-manual/ja/2-providers/2.1-add.md @@ -88,7 +88,7 @@ Codex プリセットは上流プロトコルにより 2 種類に分かれま |----------|------| | DeepSeek | DeepSeek モデル | | Zhipu GLM / GLM en | Zhipu AI の GLM モデル | -| Kimi | Moonshot Kimi モデル | +| Kimi / Kimi For Coding | Moonshot Kimi モデル | | MiniMax / MiniMax en | MiniMax モデル | | StepFun / StepFun en | StepFun Step モデル | | Baidu Qianfan Coding Plan | 百度千帆コーディングプラン | diff --git a/docs/user-manual/zh/2-providers/2.1-add.md b/docs/user-manual/zh/2-providers/2.1-add.md index 8147997c1..710dddd5f 100644 --- a/docs/user-manual/zh/2-providers/2.1-add.md +++ b/docs/user-manual/zh/2-providers/2.1-add.md @@ -88,7 +88,7 @@ Codex 预设按上游协议分两类。 |----------|------| | DeepSeek | DeepSeek 模型 | | 智谱 GLM / GLM en | 智谱 AI 的 GLM 模型 | -| Kimi | Moonshot Kimi 模型 | +| Kimi / Kimi For Coding | Moonshot Kimi 模型 | | MiniMax / MiniMax en | MiniMax 模型 | | StepFun / StepFun en | 阶跃星辰 Step 模型 | | 百度千帆 Coding Plan | 百度千帆编程套餐 | diff --git a/src/config/codexProviderPresets.ts b/src/config/codexProviderPresets.ts index 72c77df87..016ce1cf7 100644 --- a/src/config/codexProviderPresets.ts +++ b/src/config/codexProviderPresets.ts @@ -448,6 +448,36 @@ requires_openai_auth = true`, icon: "kimi", iconColor: "#6366F1", }, + { + name: "Kimi For Coding", + websiteUrl: "https://www.kimi.com/code/docs/", + apiKeyUrl: "https://www.kimi.com/code/", + auth: generateThirdPartyAuth(""), + config: generateThirdPartyConfig( + "kimi_coding", + "https://api.kimi.com/coding/v1", + "kimi-for-coding", + ), + endpointCandidates: ["https://api.kimi.com/coding/v1"], + apiFormat: "openai_chat", + modelCatalog: modelCatalog([ + { + model: "kimi-for-coding", + displayName: "Kimi For Coding", + contextWindow: 262144, + }, + ]), + codexChatReasoning: { + supportsThinking: true, + supportsEffort: false, + thinkingParam: "thinking", + effortParam: "none", + outputFormat: "reasoning_content", + }, + category: "cn_official", + icon: "kimi", + iconColor: "#6366F1", + }, { name: "StepFun", websiteUrl: "https://platform.stepfun.com/step-plan",