Skip to content

feat(agent-core-v2): limit subagents to the configured model pool - #4418

Merged
7Sageer merged 8 commits into
mainfrom
feat/secondary-model-explicit-pool
Oct 28, 2026
Merged

7Sageer merged 8 commits into
mainfrom
feat/secondary-model-explicit-pool

Conversation

@7Sageer

@7Sageer 7Sageer commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

配置了 [secondary_model] 之后,Agent / AgentSwarm 会把主模型作为隐式的 primary 选项一起提供给主 agent,子 agent 可能悄悄跑回主模型,和"副模型用来省钱"的预期不符;改为只提供模型池里显式列出的模型,并顺带删掉因此变得多余的 force。

同一节里还有 9 个模型调参字段(max_context_size、capabilities 等):v2 引擎按 [models] 条目原样绑定,从不读取它们,写了也不生效;一并移除并在加载时提示。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

模型选择规则(Agent / AgentSwarm):

 resolveSubagentBinding(config, own, requested)
-  if force: bind default_model, reject any requested model
-  if requested == "primary": bind caller model + caller thinking
   if no pool: inherit caller model (reject any requested model)
   bind requested ?? default_model, must be a pool key
-  error lists: pool keys + "primary"
+  error lists: pool keys only

model 参数何时出现:

-exposesSubagentModelChoice = pool configured && !force
+exposesSubagentModelChoice = pool has more than one entry

Tower 保留 primary 选择,移除 force 例外(接受实验性功能的这项行为变化):

 TowerSpawn
-  resolveSubagentBinding(model ?? (reviewer && !force ? "primary" : undefined))
+  resolveSubagentBindingWithPrimary(model ?? (reviewer ? "primary" : undefined))
-  model param shown when exposesSubagentModelChoice (pool && !force)
+  model param shown when a pool is configured
   description = pool lines + "primary (= <alias>)" line

force 的去留:

 [secondary_model] schema
-  force: boolean
+  collectDiagnostics: warn when the raw section still has `force`
 session startup validation
-  force without default_model → CONFIG_INVALID
-  force + models table        → CONFIG_INVALID

[secondary_model] 模型调参字段:

 SecondaryModelConfigSchema (agent-core-v2 + node-sdk)
-  max_context_size / max_input_size / max_output_size / capabilities / display_name
-  reasoning_key / adaptive_thinking / support_efforts / off_effort
+  collectDiagnostics: warn when the raw section still sets any of them (merged with the force warning)
 node-sdk loadRuntimeConfig(Safe) / writeConfigFile
-  synthesize / strip the __secondary__ model alias (v1 engine recipe), incl. KIMI_SECONDARY_MODEL / KIMI_SECONDARY_EFFORT
 TUI /model, /secondary-model, provider pickers
-  filter out __secondary__

其他:

  • Agent 工具普通派生类型列表中的 ReadMediaFile / select_tools 只按实际可绑定的模型判断:无模型池时看调用方模型,配置了模型池时只看池内模型;fork flag 不再把主模型能力混入普通类型列表。fork 提示只说明继承当前类型、模型和工具集,不展开能力列表。
  • fork 的 model 只接受调用方自己的别名,不再接受 primary。
  • 遥测 model_source 去掉 forced;primary_override 只剩 Tower 会产生。
  • node-sdk 配置 schema 去掉 force;PRIMARY_SUBAGENT_MODEL_CHOICE 导出保留(Tower 仍在用)。
  • 重新生成 config-manifest.toml;更新中英文 config-files / tools / tower 文档与内置 update-config skill。
  • kap-server /api/v1/config 新增 secondary_model: null:仅该域走 IConfigService.replace 删除整个配置节,对象仍按 merge 更新;用于 desktop/web 的“跟随默认模型”设置。

Behavior Changes and Affected Users

行为 之前 之后 谁依赖旧行为 退路
配了模型池时 Agent / AgentSwarm 的 model: "primary" 绑定调用方模型 + 调用方 thinking level 报错 Invalid model "primary". Available models: … 配了模型池、希望主 agent 在难任务上自动升级到主模型的用户(TUI、print、desktop/web、SDK 全部客户端) 把主模型别名写进 [secondary_model.models];区别是不继承 thinking level、不跟随 /model 切换
只配 default_model(/secondary-model 写的就是这个)时的 model 参数 出现,可选 <default> 或 primary 不出现,所有子 agent 固定用 default_model 同上,且只用 /secondary-model 配置过的用户 同上(写成两项及以上的模型池)
只有一项的 [secondary_model.models] 表 出现 model 参数(该项 + primary) 不出现 同上 同上
force = true + default_model 固定子 agent;Tower reviewer 也用 default_model Agent/AgentSwarm 行为不变(固定 default_model);Tower reviewer 回到 Tower 自身模型;加载时出警告 开启 Tower 并用 force 让 reviewer 省钱的用户 可逐次显式指定池中模型;Tower 为实验性功能,本 PR 明确接受不再保留配置级硬约束
force = true 但没有 default_model 会话创建 / resume / fork 报 CONFIG_INVALID 正常启动,出警告,子 agent 继承调用方模型 无(之前就无法启动) —
force = true + [secondary_model.models] 表 会话启动报 CONFIG_INVALID 正常启动,出警告,按模型池选择 无(之前就无法启动) —
Tower 配了 force 时的 model 参数 不出现,显式选择一律拒绝 出现,可选模型池 + primary 同 force 行 同上
无模型池时传 model 的报错文案 no [secondary_model.models] pool … (pass "primary" or omit …) no [secondary_model] pool … (omit the model parameter) 无 —
Agent 工具描述里普通派生类型的工具列表(ReadMediaFile、select_tools) 配了非 force 的模型池时把调用方模型能力计入 仅无模型池时计入调用方能力;有池时只看池内模型,与 fork flag 无关 主模型支持媒体或动态工具、池内模型不支持的用户,含开启 fork 的会话 把支持对应能力的模型加入池;fork 仍继承调用方工具集
fork 时 model: "primary" 接受 拒绝(FORK_WITH_MODEL_UNAVAILABLE) 开启了 fork 实验 flag 的会话 传自己的模型别名或不传
[secondary_model] 里的 max_context_size 等 9 个调参字段 能写进配置但 v2 不读取,静默无效 仍被忽略,加载时出警告;写配置时原样保留在文件里 无(之前就不生效) 写到对应的 [models.<alias>] 条目上
KIMI_SECONDARY_MODEL / KIMI_SECONDARY_EFFORT 只影响 node-sdk 本地读配置(遥测开关、区域判断),v2 引擎从不读取 不再处理 无(对子 agent 一直无效) —
遥测 subagent 事件 model_source 可能为 forced 不再出现 forced 遥测看板 —
POST /api/v1/config 的 secondary_model: null 按 merge patch 处理,配置保持不变 删除整个 [secondary_model] 节,之后派生的 subagent 继承调用方模型与 thinking level 直接调用配置 API 的 desktop/web 与外部脚本 传对象继续 merge;省略该字段保持不变

Prompt / 工具描述文本改动(逐句):

  • Agent / AgentSwarm 工具描述末尾的模型列表:删除 - primary (= <alias>): your current model and thinking level 与 Pool entries don't inherit your thinking level. 两行,AgentSwarm 的单行摘要删除 primary (…)。影响所有配置了 ≥2 项模型池的会话。之前它向模型宣告可以升级到主模型;现在由 resolveSubagentBinding 拒绝 primary 来约束。
  • agent.ts / agent-swarm.ts 的 model 参数描述:删除 or "primary" for your current model and thinking level。人群同上。
  • agent.ts / agent-fork.md 的 fork 快照说明:收敛为一句“从已完成对话的快照开始,继承当前类型、模型和工具集”,不再建议用 fork 替代重新 briefing。仅影响开启 fork 实验 flag 的会话;快照与继承仍由 planSpawn / spawn 实现。
  • agent-swarm.ts / agent-swarm-fork.md 的 fork 快照说明:同样只说明每个 item 子 agent 继承当前类型、模型和工具集,不展开工具列表。人群同上。
  • fork 文本中的“非空 resume / resume_agent_ids 会被拒绝”句子删除;运行时的 forkIncompatibility 与 swarm resume 检查保留。
  • fork 文本中的“subagent_type 必须匹配调用方类型”句子删除;forkIncompatibility 仍拒绝不同类型。
  • fork 文本中的“model 必须是调用方模型或 primary”句子删除;forkIncompatibility 现在只接受自己的模型别名,不再接受 primary。
  • fork 文本中重复的“不同类型和模型覆盖会被拒绝”句子删除;执行校验保持不变。
  • Swarm fork 文本中的“默认零上下文、通过模板 briefing”句子删除;未传 fork 时仍走普通派生。
  • Swarm fork 文本中的“仅当所有 item 依赖当前对话时使用;独立任务保持零上下文”建议删除,参数只陈述继承语义;不新增执行限制。
  • Tower spawn.md:删除 If [secondary_model].force = true, the forced model is mandatory and every explicit choice, including primary, is rejected.。只影响 Tower 会话;该约束随 force 一起移除。
  • 内置 update-config skill:[secondary_model] 说明去掉 force,改为说明子 agent 只用模型池、单独 default_model 即固定、force 已废弃被忽略。影响调用该 skill 的会话;避免它再帮用户写出 force。

受影响模块与测试覆盖:

  • session/subagent/configSection.ts:test/app/config/config.test.ts(模型池默认、显式别名、无模型池继承、primary 被拒、单项模型池、legacy model 键、force 被忽略且出警告、报错文案),test/session/subagent/subagentModelsValidation.test.ts(force 不再导致启动失败;单独 default_model 的 default_effort 校验),test/session/subagent/spawn.test.ts。
  • Agent / AgentSwarm 工具:test/tool/tool.test.ts(≥2 项才出现 model 参数且描述无 primary;单项模型池 / 单独 default_model 隐藏参数;primary 被拒;主模型写进模型池时可选且不继承 thinking;fork 接受自身别名、拒绝 primary;ReadMediaFile / select_tools 在 fork 开关两种状态下都只描述池内能力;无池继承调用方能力;Agent / AgentSwarm fork 提示保持一句继承说明),test/features/swarm/swarm.test.ts(主模型显式写入模型池时可用——即退路)。
  • Tower:test/features/tower/tools/spawnTool.test.ts(reviewer 默认仍用 Tower 模型——钉住未变人群的旧行为;显式 primary 仍可用;越界别名报错仍列出 primary;单独 default_model 时出现 model 参数)。
  • [secondary_model] 调参字段:test/app/config/config.test.ts(字段被忽略、出警告、config.set 后仍保留在磁盘上),apps/kimi-code/test/tui/commands/secondary-model.test.ts(去掉 __secondary__ 用例)。
  • 契约文件:packages/agent-core-v2/docs/config-manifest.toml 删除 force 及 9 个调参字段(消费方:code-app desktop/web、VS Code 扩展的配置编辑);旧版本写出的含 force 的 config.toml 仍能加载,仅出警告。packages/node-sdk/src/index.ts 未改动:SECONDARY_DERIVED_MODEL_ALIAS 导出保留并标为 @deprecated,避免 SDK 破坏性变更;node-sdk 的 SecondaryModelConfig 类型去掉这些字段。
  • kap-server 配置清除:packages/kap-server/src/routes/config.ts 仅对 secondaryModel: null 调用 replace;packages/kap-server/test/config.test.ts 验证整节删除、其他配置域保留,以及 reload 后仍然生效。

验证(本次增量):

  • 相关 7 个测试文件:415 passed / 1 skipped;跳过的 foreground timeout 用例已在 base 和原 head 单独复现本地超时。
  • agent-core-v2 类型检查、无注释检查通过;类型感知 lint 无错误,告警均在本次未修改的代码行。
  • 调参字段清理:agent-core-v2 相关 5 个测试文件 463 passed,node-sdk 181 passed,CLI 相关 3 个文件 38 passed;三个包类型检查、oxlint、无注释检查通过。新增 changeset warn-secondary-model-tuning-keys。现有中英文用户文档已说明模型能力约束,本次无需额外扩展文档。
  • 配置清除增量:kap-server 全量 76 个测试文件 1518 passed / 1 skipped;完整 typecheck、lint 和中英文文档构建通过。另用真实 Electron + kap-server 验证取消清除保留模型池、确认后删除磁盘配置,以及不同调用方模型与 thinking level 的动态继承。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Agent and AgentSwarm no longer offer an implicit "primary" choice once
[secondary_model] is configured: subagents only bind pool entries, and a
pool with a single entry (or a lone default_model) hides the model
parameter and pins every spawn. List the main model's alias in
[secondary_model.models] to offer it explicitly.

[secondary_model] force is removed. A lone default_model already pins
every subagent, so a leftover force key is ignored with a config
warning instead of failing session startup.

Tower keeps its behavior: reviewers default to the tower's own model and
an explicitly requested "primary" stays valid.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 07:57
@changeset-bot

changeset-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e8bbab9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@7Hanrui

7Hanrui commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T11:09:48.374341Z e8bbab9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 879b184865

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"@moonshot-ai/kimi-code": patch
---

Stop letting the main agent run Agent and AgentSwarm subagents on its own model through an implicit `primary` choice when a subagent model pool is configured; add the main model's alias to `[secondary_model.models]` to offer it again.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge State that the replacement no longer inherits caller settings

For users who selected model: "primary" to follow the caller's current model and thinking level, adding that model's alias to the pool does not restore the advertised behavior: pool binding uses only [secondary_model].default_effort, does not inherit the caller's thinking level, and will not follow later main-model switches. The changeset should name these losses rather than presenting the fixed pool alias as an equivalent replacement.

AGENTS.md reference: AGENTS.md:L115-L117

Useful? React with 👍 / 👎.

The v2 engine binds the [models] entry as configured, so max_context_size,
capabilities and the other recipe keys under [secondary_model] never took
effect. Remove them from the schema, warn when a config still sets them, and
drop the node-sdk __secondary__ alias synthesis that only fed the removed v1
engine.
…sages

The reserved primary pool key now only serves Tower spawn, and a lone default_model no longer pins Tower reviewers. Name the losses of the removed primary choice in its changeset.
@7Sageer
7Sageer marked this pull request as ready for review October 26, 2026 09:59
@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@e8bbab9
npx https://pkg.pr.new/@moonshot-ai/kimi-code@e8bbab9

commit: e8bbab9

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec93dfc277

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"@moonshot-ai/kimi-code": patch
---

Remove `[secondary_model] force`, which is now ignored with a warning: a lone `default_model` still pins every subagent to that model.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the claim that the default pins every subagent

When Tower users have force = true and a default_model, this claim is incorrect: workers still use the pool default, but reviewers now default to the current primary model (TowerSpawnTool, spawnTool.ts:223; see also docs/en/guides/tower.md:106). The release note should name this loss and note that reviewers can still be assigned a pool alias per spawn.

AGENTS.md reference: AGENTS.md:L115-L117

Useful? React with 👍 / 👎.

@7Hanrui

7Hanrui commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4e9460140a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@7Hanrui

7Hanrui commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8bbab96e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1 +1 @@
Context forking: by default, each spawned subagent starts with zero context — brief it through the template. When every item builds on the current conversation, pass `fork: true` instead: each item-spawned subagent then starts with a snapshot of your completed history (inheriting your own agent type, tool set, and model), so the template only needs the task itself. A non-empty `resume_agent_ids` map is rejected with `fork`. If `subagent_type` is provided, it must match your own agent type; if `model` is provided, it must be your own model or `primary`. Different types and model overrides are rejected. Keep `fork` off for independent tasks — it copies the full history into every subagent. No newline at end of file
Context forking: pass `fork: true` so every item-spawned subagent starts with a snapshot of your completed conversation history, inheriting your current agent type, model, and tool set. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the zero-context guidance for independent swarm items

When subagent_fork is enabled, this prompt no longer says to use zero context by default and fork only when every item builds on the current conversation; it now simply tells the model to pass fork: true. AgentSwarm forwards that choice to each spawn, where forking copies the caller's conversation history, so unrelated items can each receive a full, irrelevant transcript and consume extra context and tokens. Restore the dependency criterion here and in the matching Agent prompt.

AGENTS.md reference: AGENTS.md:L119-L121

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8bbab96e4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

await config.set(domain, camelPatch[domain]);
const patch = camelPatch[domain];
if (domain === 'secondaryModel' && patch === null) {
await config.replace(domain, null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make multi-domain config patches atomic

When a client sends secondary_model: null before another domain that fails core validation—for example, thinking: { enabled: "bad" }—this call persists the deletion before the later config.set throws. The endpoint then returns VALIDATION_FAILED, but the secondary-model configuration is already gone, so desktop/web clients that batch settings can lose data on a rejected request. Validate and persist the complete patch atomically, such as through replaceSections, rather than deleting domains one at a time.

AGENTS.md reference: AGENTS.md:L131-L133

Useful? React with 👍 / 👎.

Comment on lines +102 to +106
export const SecondaryModelConfigSchema = z.object({
model: z.string().min(1).optional(),
defaultModel: z.string().min(1).optional(),
models: z.record(z.string(), z.string()).optional(),
force: z.boolean().optional(),
defaultEffort: z.string().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve removed fields in the public SDK config type

Because KimiConfig and KimiConfigPatch are re-exported from the SDK root, replacing ModelAliasOverrideSchema.extend(...) with this narrower object removes force and all model-tuning properties from the public secondaryModel type. TypeScript SDK hosts that still construct patches such as { secondaryModel: { force: true } } or set one of those tuning fields will stop compiling on this patch release, even though the runtime migration is designed to load those settings and warn that they are ignored. Keep the old optional properties as deprecated public type fields while stripping them at the engine boundary, or treat the removal as an explicitly approved major change.

AGENTS.md reference: AGENTS.md:L63-L63

Useful? React with 👍 / 👎.

@7Sageer
7Sageer merged commit e3efbb9 into main Oct 28, 2026
17 checks passed
@7Sageer
7Sageer deleted the feat/secondary-model-explicit-pool branch October 28, 2026 05:33
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 3, 2026
Port of upstream MoonshotAI#4418 (e3efbb9).

Agent and AgentSwarm no longer offer an implicit "primary" choice once
[secondary_model] is configured: subagents bind pool entries only, and a
single-entry pool (or a lone default_model) hides the model parameter and
pins every spawn. Tower keeps its own "primary" choice.

[secondary_model] force is removed: a leftover force key is ignored with a
config warning instead of failing session startup, and the never-effective
model-tuning keys (max_context_size, capabilities and friends) drop out of
the schema through the same warning path. node-sdk stops synthesizing the
__secondary__ derived alias that only fed the removed v1 engine, and the
TUI pickers stop filtering it. kap-server accepts secondary_model: null to
clear the section.

Fork adaptations made while applying the port:
- provider.ts keeps the fork's mountProviderModelSelector helper; only the
  __secondary__ filtering was removed inside it.
- kap-server config route keeps the fork's applied/failedDomain
  persistence-split reporting, merged with the new null-clearing branch.
- tool.test.ts keeps bun:test style (mock instead of vi.fn) and the
  fork-local default-WebSearch expectation in one assertion.
- tools.md keeps the fork-parameter documentation (the subagent_fork flag
  still gates it) with the "primary" wording removed from pool text.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
The behaviour of MoonshotAI#4421 has been in the requester since 94397aa, but its
suite still asserted only that the lowered system message lost its
`tools` field, which a message kept in place would also satisfy. Assert
instead that no system message survives and the history keeps its
length, and rename the case after what it protects.

Also settle ten ledger rows that were already implemented here: MoonshotAI#3733,
MoonshotAI#4413, MoonshotAI#4418, MoonshotAI#4421, MoonshotAI#4435, MoonshotAI#4460, MoonshotAI#4465, MoonshotAI#4516, MoonshotAI#4523, MoonshotAI#4532 and the
MoonshotAI#4558 test calibration, each with a probe over the suite that pins it.
Two rows carried a probe without a test-name selector (MoonshotAI#4557, MoonshotAI#4558),
which aborted `--verify` for every other row; MoonshotAI#4557 is a changelog sync
and now carries a manual probe.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 5, 2026
Ports the docs half of upstream MoonshotAI/kimi-code 8b6a003 (MoonshotAI#4673): the
2.5.0 section from the upstream release notes lands in both changelogs, en
and zh, word for word.

Every feature the section names is in this tree - busy /model and /effort
(MoonshotAI#4621), merged project-level skills (MoonshotAI#4520), remote sessions in SSH, Docker
and custom-command environments (MoonshotAI#4062), [workspace] require_trust (MoonshotAI#4517),
web search off by default (MoonshotAI#4516), and the subagent model pool (MoonshotAI#4418) - so
the notes describe what the fork actually does.

Deliberately not touched: apps/kimi-code/CHANGELOG.md still tops out at 2.4.1
and package.json still says 2.4.1. That file is generated by `changeset
version`, this tree has 377 pending changesets, and AGENTS.md forbids running
version or publish from this repository, so the entry is written on the docs
side only. Whoever next cuts a release here should reconcile this section
with what changeset version generates rather than re-deriving it by hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants