feat(auth): add Kimi (Moonshot AI) as a built-in third-party provider - #9814
Conversation
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 and no change to the provider type. Model metadata follows Moonshot's published capabilities. K3 is marked thinking-mandatory: its API exposes a reasoning-effort knob but no way to turn thinking off, so a disable shape must never reach the wire. The two code models and K2.6 keep thinking toggleable, and all four accept image and video input, which the K2.6 guide states explicitly. 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, both by env key and by request hostname so Kimi traffic is attributed rather than reported as unknown. The three first-run docs that enumerate built-in providers are brought back into agreement, which also picks up entries that were already stale. Closes QwenLM#9197
|
✅ Qwen Triage finished — CI landed green on ✅ Qwen Triage 已完成 —— |
|
Thanks for the PR — this is a clean re-submission of #9756 with the history tidied up, and it lands exactly on the sketch we left on #9197.
Moving on to code review. 🔍 中文说明感谢贡献 —— 这是 #9756 清理提交历史后的重新提交,且与我们在 #9197 中给出的实现要点完全一致。
进入代码审查。🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewRead against
No critical findings, no convention violations. Not verified: the rendered Testing — the PR's own CI, read via API (unattended run; no PR code executed here). Security and desktop checks are green; the core unit suite on Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Sandboxed verification would settle the remaining surface claim: 中文说明代码审查基于
无阻塞问题,无规范违规。未验证: 测试 —— 读取 PR 自身 CI(API)(无人值守运行,此处未执行任何 PR 代码)。安全与桌面检查已通过; 沙箱验证可以补齐剩余的表面论断: — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 4/5 — a textbook provider preset that does exactly what the accepted issue asked; the one reservation is a merge-order call against an open sibling PR, which is a maintainer's to make, not a defect here. Stepping back: this is the narrow slice #9197 asked for, implemented almost line-for-line along the sketch that issue-triage left there. I proposed the same approach independently before reading the diff — a The honest reservations, neither of which I think blocks: (1) #8368 is still open and ships this same provider inside a larger change — its MiMo half already landed separately, so this reads as the intended minimal slice, but the merge order is a human call and I've flagged it; (2) no live Moonshot request was made (no paid credential to test with), which is inherent to a preset — the install-plan and pipeline coverage is the substitute and it's solid. If I'm maintaining this in six months it's a flat data file that's trivial to update as Kimi's catalog moves, which is the right shape. Approving, with the unit suite still in flight — the approval lands pinned to the reviewed commit once CI is green on it, not before. 中文说明置信度:4/5 —— 一个教科书式的 provider 预设,恰好实现了已被接受的 issue 所要求的内容;唯一保留意见是与一个仍 open 的同源 PR 的合入顺序,那是维护者的决定,而非本 PR 的缺陷。 退一步看:这是 #9197 所要求的最小切片,几乎逐行沿着 issue 评审留下的要点实现。我在读 diff 之前独立提出了同样的方案 —— 带双端点选择与逐模型元数据的 两点诚实的保留意见,我认为均不阻塞:(1)#8368 仍 open,且在一个更大的改动中包含同一 provider —— 其 MiMo 部分已单独合入,因此本 PR 读起来正是预期的最小切片,但合入顺序是人类决定,我已标记;(2)未发起真实 Moonshot 请求(无付费凭据可测),这是预设类改动的固有情况 —— install-plan 与管线覆盖是其替代,且扎实。若六个月后由我维护,这是一个随 Kimi 目录演进而极易更新的扁平数据文件,形态正确。 予以批准;鉴于单元测试仍在进行,批准将在 CI 于被审提交上转绿后、钉住该提交落地,而非在此之前。 — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship — CI landed green after the review. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
Not linted (tool limitation, not a blocker): the executable-script lint — .github/workflows/ci.yml: actionlint embedded-shell source mapping is not yet supported — not linted.
中文说明
未发现问题。LGTM!✅
未检查(工具限制,非阻断):the executable-script lint — .github/workflows/ci.yml: actionlint embedded-shell source mapping is not yet supported — not linted。
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
Released in v0.22.2. |
What this PR does
Adds Kimi (Moonshot AI) as a built-in entry under
/auth→ Third-party Providers, so connecting to Kimi takes an API key instead of a hand-rolled Custom Provider setup. Selecting it offers a choice between the international and China endpoints, then seeds the current Kimi model catalog — the flagship K3, the two dedicated code models, and K2.6 — with the context window and capability metadata each one needs. The model list stays editable, so users can add newer IDs without waiting for a release.Moonshot's API speaks the OpenAI protocol, so this is a declarative provider preset with no new mechanism and no change to the provider type. One piece of model metadata is worth calling out: K3 is registered as thinking-mandatory, because its API exposes a reasoning-effort knob but no way to turn thinking off, so the request pipeline must never put a thinking-disabled shape on the wire — that would be a guaranteed failure. The other three models keep thinking toggleable, and all four are registered as accepting image and video input, which Moonshot's model guides state directly.
The new credential environment variable is registered everywhere a provider key has to appear: the no-API-key CI gate that clears provider credentials before the unauthenticated integration run, the pinned assertion list that guards that gate against silent drift, and the telemetry provider mapping — both by environment key and by request hostname, so Kimi traffic is attributed rather than reported as unknown. The three first-run docs that enumerate built-in providers are brought back into agreement with the registry, which also picks up entries that were already stale beforehand.
Why it's needed
Kimi is one of the more popular model families for coding, and Moonshot is a provider of comparable standing to DeepSeek, MiniMax, and Z.AI — all of which already have one-click entries in the Third-party Providers menu. Today, anyone wanting to use Kimi has to either hand-edit settings or walk through Custom Provider, while peers of similar popularity get a guided setup. The product already acknowledges Kimi models through the Alibaba Cloud plans and the Idealab provider, which makes the absence of a first-party Moonshot entry an obvious gap rather than a missing capability.
Reviewer Test Plan
How to verify
/auth→ Third-party Providers. Kimi should appear in the list alongside the other direct-API providers, with the footer still visible and no entries clipped./modelthat the installed entries carry the expected context windows.Evidence (Before & After)
Before: Kimi had no entry in Third-party Providers; reaching a Moonshot endpoint required Custom Provider or hand-edited settings.
After: the provider list and the endpoint step, captured from the rendered dialog:
The model step, reached after choosing an endpoint and entering a key:
Automated validation: the provider and telemetry suites pass (216 tests across 16 files), as do the CI-gate guard test, lint, formatting, and the core typecheck. The full core suite was also run: its single failure is an extension update-policy test that reproduces identically on a clean main and is unrelated to this change.
Each model entry is covered by an install-plan assertion, including negative assertions pinning the absence of the thinking-mandatory flag on the toggleable models — mutation probes confirm that corrupting any entry's context window, thinking metadata, or modalities turns the suite red.
Tested on
Environment (optional)
macOS, Node.js 22, tests run from the package directories; the dialog evidence was captured by rendering the auth dialog headlessly rather than from a live terminal session.
Risk & Scope
Linked Issues
Closes #9197
Overlaps with #8368, which adds the same provider as part of a larger change that also introduces a second provider, endpoint-scoped model metadata across every surface, and a provider-list pagination fix. This PR is deliberately the narrow slice the issue asks for and does not attempt to replace that work; see the note posted there. Supersedes #9756, which was closed and reopened here with a clean history.
中文说明
这个 PR 做了什么
在
/auth→ Third-party Providers 中加入 Kimi(Moonshot AI)内置入口,用户只需一个 API key 即可接入 Kimi,而不必再手动配置 Custom Provider。选中后先选择国际或中国端点,随后自动填入当前的 Kimi 模型目录 —— 旗舰 K3、两个专用代码模型,以及 K2.6,并为每个模型带上所需的上下文长度与能力元数据。模型列表保持可编辑,用户无需等待发版即可自行添加更新的模型 ID。Moonshot 的 API 兼容 OpenAI 协议,因此这是一个声明式的 provider 预设,没有引入新机制,也没有改动 provider 类型定义。有一处模型元数据值得说明:K3 被标记为 thinking 强制开启,因为其 API 提供 reasoning effort 调节,但没有关闭 thinking 的方式,因此请求管线绝不能在链路上发出"关闭 thinking"的形状 —— 那必然导致失败。其余三个模型的 thinking 保持可开关,且四个模型均登记为支持图像与视频输入,这一点 Moonshot 的模型指南有明确说明。
新的凭据环境变量已在所有需要登记 provider key 的位置注册:在无凭据集成测试运行前清空 provider 凭据的 no-AK CI 门禁、防止该门禁被悄然改动的固定断言列表,以及遥测的 provider 映射 —— 同时覆盖环境变量与请求域名两条路径,使 Kimi 流量能被正确归因而非记为未知。三处枚举内置 provider 的入门文档也重新与注册表保持一致,并顺带修正了此前已经过期的条目。
为什么需要
Kimi 是编码场景中较受欢迎的模型家族之一,Moonshot 的地位与 DeepSeek、MiniMax、Z.AI 相当,而后三者在 Third-party Providers 菜单中均已有一键入口。目前想使用 Kimi 的用户只能手动编辑配置或走 Custom Provider 流程,而同等热度的同行却有引导式配置。产品中已经通过阿里云各计划与 Idealab provider 承认了 Kimi 模型的存在,这让缺少一方 Moonshot 入口更像是一个明显的空缺,而非能力缺失。
Reviewer 测试计划
如何验证
/auth→ Third-party Providers。Kimi 应与其他直连 API 的 provider 一同出现在列表中,页脚仍然可见,且没有条目被裁剪。/model确认已安装条目的上下文长度符合预期。证据(Before & After)
Before: Kimi 在 Third-party Providers 中没有入口;接入 Moonshot 端点需要走 Custom Provider 或手改配置。
After: provider 列表、端点选择步骤与模型步骤,均取自实际渲染的对话框,见上方英文正文中的终端输出。
自动化验证:provider 与遥测测试套件通过(16 个文件共 216 项),CI 门禁守卫测试、lint、格式化与 core 类型检查亦均通过。core 全量测试也已运行:其唯一失败为扩展更新策略测试,在干净的 main 上同样复现,与本次改动无关。
每个模型条目都有 install plan 断言覆盖,其中包含针对可开关 thinking 模型钉住"无 thinking 强制标志"的负向断言 —— 变异探测确认,破坏任一条目的上下文长度、thinking 元数据或模态都会使测试变红。
测试环境
环境(可选)
macOS,Node.js 22,测试从各 package 目录执行;对话框证据通过无头渲染 auth 对话框获得,而非实际终端会话截图。
风险与范围
关联 Issue
Closes #9197
与 #8368 存在重叠:该 PR 在一个更大的改动中加入了同一 provider,同时还引入了第二个 provider、贯穿各端的 endpoint 级模型元数据,以及 provider 列表分页修复。本 PR 有意只做 issue 所要求的最小切片,并不试图取代那项工作;详见已在该 PR 中留下的说明。本 PR 取代 #9756,后者已关闭并在此以干净的提交历史重新提交。