Skip to content

feat: add built-in tool settings and mode availability - #5351

Merged
liruifengv merged 19 commits into
mainfrom
feat/default-tool-settings
Nov 25, 2026
Merged

liruifengv merged 19 commits into
mainfrom
feat/default-tool-settings

Conversation

@liruifengv

@liruifengv liruifengv commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

桌面端需要在设置中提供内置工具开关,保存后对当前及新会话生效;同时当 Plan、Swarm、Tower、Goal 所需的工具不可用时,应隐藏对应的模式入口。

本 PR 将旧仓库未合入的 MoonshotAI/kimi-code-app#1239 与配套服务端 MoonshotAI/kimi-code#4797 迁移到单仓。此前对应 custom-desktop 分支的版本(kimi-code-app#1251 与 kimi-code#4807)只合入了已废弃的定制分支,从未进入 main。

截图

image image

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路

设置页保存开关时直接写入现有的全局 [tools] 策略,不引入按会话冻结的工具快照。引擎现有的动态工具策略会对已加载的 Agent 和新会话即时生效;服务端在 agent 帧中报告当前模式可用性,并在全局 [tools] 或会话级工具策略变化时主动刷新该帧;桌面端据此隐藏不可用的模式入口。

flowchart LR
    Draft[设置页内置工具草稿] -->|保存| Config[全局 tools 配置]
    Catalog[GET /api/v1/tools/catalog] --> Draft
    Config --> Policy[当前及新会话工具策略]
    SessionPolicy[会话级 disabled_tools] --> Policy
    Policy --> Guards[服务端模式入口守卫]
    Policy --> Frames[agent 帧模式可用性]
    Config -->|onDidSectionChange tools| Frames
    SessionPolicy -->|onDidChange| Frames
    Frames --> Availability[当前会话模式可用性]
    Config --> DraftAvailability[无会话草稿与旧服务端回退]
    Availability --> Desktop[桌面端模式入口]
    DraftAvailability --> Desktop
Loading

关键决策

决策 选择 未选择 理由
工具配置作用范围 复用全局 [tools],对已加载和新 Agent 动态生效 按会话保存默认工具快照及恢复迁移 保持 TUI、桌面端、Web、ACP、SDK 现有 [tools] 语义一致
工具变更后的帧刷新 全局 [tools] 或会话级策略变化时主动刷新 agent 帧 等待下一次无关的轮次或状态事件再刷新 在设置页保存开关后,当前打开的会话入口立即可见地更新
旧服务端兼容 缺少 *_mode_available 字段时回退到全局 [tools],HOST_API_LEVEL 保持 1 缺失字段视为不可用,或提升宿主 API 级别 新版桌面端连接旧版远程宿主或 kimi web 时不会误隐藏模式入口
设置子页结构 复用共享设置样式、系统 toast、吸底保存栏,并在返回、切换 Tab、关闭弹窗时统一拦截未保存修改 依赖侧边栏固定宽度的 Teleport 底栏,仅在点击返回时确认 与 main 上 GlobalAgentsMdSetting 的模式一致,避免切换 Tab 或关闭设置时静默丢失草稿

服务端改动

  • 新增 GET /api/v1/tools/catalog(无需会话即可调用,不恢复会话、不连接 MCP 服务),标记用户可配置的内置工具贡献,并与运行时媒体工具按名称去重。合入 fix(agent-core-v2): initialize loop after profile and mode selection #5141 后,6 个 Tower 模式专用工具(TowerInit、TowerPlan、TowerSpawn、TowerMerge、TowerRebase、TowerTeardown)改为进入 Tower 时动态注册,不再经过 AgentToolContribution;因此由 USER_CONFIGURABLE_TOWER_MODE_TOOLS 导出其目录元数据,仅在 isTowerFeatureAssembled 为真时并入目录,保证 Tower 开关仍受实验开关门控。
  • 通过共用的 toolsConfigSchema 在配置 REST schema 中映射全局 tools.enabled / tools.disabled。
  • 在 agent 帧和会话 profile 响应中新增 plan_mode_available、swarm_mode_available、tower_mode_available、goal_mode_available。Plan、Tower、Goal 仅主 Agent 可用;Tower 还要求实验开关开启且特性已装配。
  • SessionAgentFeed 订阅 ISessionToolPolicy.onDidChange 与 IConfigService.onDidSectionChange(tools),策略变更时立即推送可用性帧(无变化时自动去重)。
  • 模式入口守卫:Plan 依赖 ExitPlanMode,Swarm 依赖 AgentSwarm,Tower 依赖实验开关、特性装配、主 Agent 及完整的 13 个 Tower 工具,Goal 的创建/恢复依赖 UpdateGoal。ExitPlanMode 不可用时,defaultPlanMode 跳过自动进入。退出已开启的模式、暂停/取消 Goal 均不受影响。
  • 运行 pnpm qa:refresh schema 刷新 packages/kap-server/schema/,并更新 HOST_CONTRACT 哈希(apiLevel 保持 1,全部为增量字段)。

桌面端与客户端改动

  • 新增「设置 → 智能体与会话 → 内置工具」(DefaultToolsPanel 与 DefaultToolsRow),支持分组开关、草稿编辑、显式保存、目录加载失败重试、保存失败提示、成功系统 toast 及未保存放弃确认。由于 Web 与桌面端共用 apps/desktop/src/renderer,Web 设置页同样可以看到这一全局配置入口。
  • 桌面端与 Web 端统一按 ExitPlanMode 门控 Plan、AgentSwarm 门控 Swarm、UpdateGoal 门控 Goal 创建/恢复、实验开关加完整 Tower 工具集门控 Tower。不可用入口会从 + 菜单、斜杠补全、移动端设置页中隐藏;手动输入被禁用的 /plan、/swarm、/goal、/tower 进入类命令会提示「已在工具设置中禁用」,不会落入无关参数错误或当作提示词发给模型,同时保留 /swarm off、/tower off、/goal pause 和 /goal cancel 等退出/控制命令。
  • 无会话草稿以及未下发 *_mode_available 字段的旧服务端,均回退使用全局 [tools] 判断可用性。
  • 适配 main 近期重构:MCP 路由与 schema 从 tools.ts 拆出、IAgentProfileService 并入 IAgentLoopService、Swarm 批处理钩子、extraBuiltins 斜杠扩展、submitCommandContext()、refactor(ui): consolidate duplicated UI components, tokens and styles #5314 共享设置样式,以及 hostRouting.ts 多 Host 路由表(listToolCatalog: 'local')。main 上尚不存在的自定义 Subagent 设置(CustomSubagentsPanel)未纳入本 PR。

一并修复的旧评审遗留问题

处理了 kimi-code#4807 与 kimi-code-app#1251 当时因先于机器人评审完成合入而未修复的 Codex 意见:

  • 实验开关关闭或特性未装配时,Tower 可用性不再错误地返回 true。
  • 子 Agent 帧中,仅主 Agent 可用的 Plan、Tower、Goal 均返回 false。
  • MobileSettingsSheet 不再因 v-else 在 UpdateGoal 禁用且无进行中目标时渲染 Goal 入口行。
  • 会话级 disabled_tools 变更后会即时刷新 agent 帧(feat: add configurable tool catalog and mode availability #4797 评审指出)。
  • 根据本 PR 首轮 Codex 评审:放行禁用 AgentSwarm 时的 /swarm off;拆分 Tower 实验开关与工具可用性,保证禁用 Tower 工具后 /tower off 仍可退出、进入类命令给出禁用提示而不是发给模型;Web Composer 与桌面端统一按工具可用性过滤入口。
  • 根据本 PR 第二轮 Codex 评审:confirmDiscard() 在保存进行中直接返回 false,避免「放弃」后在途请求仍写入磁盘;/config 未成功加载(config 为 null)时阻断编辑并显示重试,重试同时拉取目录与全局配置,防止以空策略覆盖磁盘上已有的禁用列表。
  • 根据本 PR 后续 Codex 评审:UpdateGoal 不可用时禁用右侧 Goal 面板的「恢复」按钮(暂停/取消保持可用);Tower 降级(部分工具被禁用)时保留 /tower status、/tower teardown 及激活态下的裸 /tower 退出,仅拦截进入类命令;SettingsDialog 暴露 confirmDiscard(),App.vue 在快捷键或菜单再次触发「设置」关闭弹窗前统一走未保存确认(同时覆盖全局 AGENTS.md 编辑与内置工具子页);面板有未保存修改时收到外部 [tools] 更新,通过 rebaseDefaultToolsConfig 仅将本页改动过的开关重放到最新配置上,避免覆盖其他客户端的并发修改;配置 experimental 域变化时同样刷新 agent 帧可用性;存在 SSH 主机时在入口与子页中明确设置仅对本机项目生效;/tower off 在实验开关关闭后仍可识别,以便释放旧会话持久化的 Tower 状态与工作区占用。移动端底部抽屉工具编辑入口按产品决定不在本 PR 中加入。

阅读指南

  1. packages/kap-server/src/routes/tools.ts 与 packages/kap-server/src/protocol/rest-config.ts:工具目录接口与 [tools] 配置映射。
  2. packages/kap-server/src/transport/ws/v1/agentState.ts、sessionAgentFeed.ts、sessionEventBroadcaster.ts:可用性字段计算与策略变更帧刷新。
  3. packages/agent-core-v2/src/features/{plan,swarm,tower,goal} 与 workspace/sessionLifecycle/sessionLifecycleService.ts:各模式入口依赖与守卫。
  4. packages/app-core/src/lib/defaultTools.ts 与 packages/app-client/src/client/useKimiWebClient.ts:允许/禁止列表开关语义,以及会话/草稿/旧服务端可用性判定。
  5. packages/app-components/src/settings/DefaultToolsPanel.vue、DefaultToolsRow.vue 与 apps/desktop/src/renderer/components/settings/SettingsDialog.vue:设置界面与未保存拦截。
  6. packages/app-components/src/composer/Composer.vue、packages/app-client/src/lib/composerSubmit.ts 与 apps/desktop/src/renderer/components/mobile/MobileSettingsSheet.vue:入口过滤与禁用命令提示。

Behavior Changes and Affected Users

行为 改动前 改动后 依赖旧行为的人群 恢复方式
内置工具设置入口 无设置界面 在「设置 → 智能体与会话 → 内置工具」新增分组开关与显式保存(桌面端及共用设置的 Web 端) 需要配置内置工具的桌面端与 Web 用户 仍可直接编辑 config.toml 的全局 [tools]
工具配置生效范围 在该设置页之外编辑全局 [tools] 保存设置页后立即应用于当前及新会话,不生成会话快照 有已打开会话的桌面端与 Web 用户 重新开启所需工具
工具目录接口 无独立于会话的可配置工具目录 新增 GET /api/v1/tools/catalog KAP HTTP 调用方与外部脚本 纯增量接口,GET /api/v1/tools 不变
agent 帧字段 仅报告 Plan/Swarm/Tower 是否已开启 额外报告四个模式可用性布尔值(子 Agent 的主模式专属项为 false;实验关闭时 Tower 为 false) KAP WebSocket 消费方、桌面端与 Web 客户端 纯增量字段,不含这些字段的旧录制回放不受影响
工具变更后的帧时机 无可用性字段 全局 [tools] 或会话级 disabled_tools 变更时主动推送可用性帧 已连接的 KAP WebSocket 客户端 自动生效,可用性未变化时不重复推送
Plan 进入与 defaultPlanMode 无 ExitPlanMode 也可进入;defaultPlanMode 总是自动进入 ExitPlanMode 不可用时手动进入被拒绝,defaultPlanMode 跳过自动进入 配置了受限工具的 TUI、桌面端、Web、VS Code、ACP、SDK 用户 启用 ExitPlanMode
Swarm 进入 无 AgentSwarm 也可进入 AgentSwarm 不可用时进入被拒绝 配置了受限工具的 TUI、桌面端、Web、VS Code、ACP、SDK 用户 启用 AgentSwarm
Tower 进入 由主 Agent、实验开关、特性装配、工作区归属门控 额外要求完整的 13 个 Tower 工具 使用部分允许列表的 Tower 实验用户 启用全部 13 个 Tower 工具
Goal 创建/恢复 无 UpdateGoal 也可创建或恢复 创建与恢复被拒绝,暂停与取消仍可用 在受限工具下运行 Goal 的用户 启用 UpdateGoal
桌面端与 Web 模式入口及手输命令 入口始终列出;手输被禁用命令落入无关报错或作为提示词发出 + 菜单、斜杠补全、移动端设置页隐藏不可用入口;手输 /plan、/swarm、/goal、/tower 进入类命令给出禁用提示,保留 /swarm off、/tower off、/goal pause/cancel 配置了受限工具的桌面端与 Web 用户 重新启用对应工具
新客户端连接旧服务端 不适用 缺少 *_mode_available 时回退全局 [tools],不会误隐藏入口 连接旧版远程宿主或 kimi web 的桌面端与 Web 用户 自动回退,HOST_API_LEVEL 保持 1
Web Composer 模式入口 不做工具可用性过滤 与桌面端一致,按服务端上报/全局配置回退的可用性隐藏入口 浏览器 Web 界面用户 在 Web 设置页重新启用对应工具

受影响模块与测试覆盖:

  • kap-server 路由、配置 schema 与 WS 推送:packages/kap-server/test/tools.test.ts(含动态注册 Tower 工具目录)、config.test.ts、sessionEventBroadcaster.test.ts(初始可用性、子 Agent 门控、会话策略刷新、全局配置刷新、无变化去重)、apiSurface.test.ts。
  • agent-core-v2 各模式守卫:plan.test.ts、planGuard.test.ts、swarm.test.ts、goal.test.ts、goalOps.test.ts、goalInjection.test.ts、towerService.test.ts(含 toolsAvailable 实验开关与装配检查)、towerTools.test.ts、towerFeature.test.ts、towerDeferredTools.e2e.test.ts、loop.test.ts。
  • 客户端配置映射、斜杠过滤、提交判定与可用性回退:app-core(defaultTools.test.ts、configClient.test.ts、mappers.test.ts、slashCommands.test.ts、hostRouting.test.ts)、app-client(agentStateFrames.test.ts、composerSubmit.test.ts、slash-menu.test.ts)、app-components(defaultToolsPanel.test.ts、composerUndoDraft.test.ts)、桌面渲染端(settings-dialog-font-page.test.ts)。
验证记录
  • pnpm lint:通过(0 warnings / 0 errors,包含注释检查、类型感知 oxlint、导入边界、守卫、棘轮、测试替身、隔离清单、说明文件与 e2e 边界检查)。
  • 类型检查:pnpm --filter @moonshot-ai/agent-core-v2 typecheck、pnpm --filter @moonshot-ai/kap-server typecheck、pnpm --filter kimi-code-app run typecheck(主进程与渲染进程,覆盖 packages/app-*)全部通过。
  • kap-server 定向测试(tools、config、sessionEventBroadcaster、apiSurface):106 条通过。
  • 前端与桌面渲染端定向测试(工具配置/面板、斜杠菜单、Composer 提交/撤销/运行中发送/视口、Agent 帧、映射、多 Host 路由、daemon 客户端、侧聊快照、回放契约):429 条通过。
  • 合入最新 origin/main(29953c86bb,含 fix(agent-core-v2): initialize loop after profile and mode selection #5141、refactor(core): replace loop.drained/loop.idle with loop end info on turn.ended #5337、fix(kap-server): append new content blocks without rescanning the turn #5344、fix(llm): validate deferred tool arguments against the visible tool view #5231 等)后,agent-core-v2 定向套件(plan、swarm、goal、tower、loop、modeMutex、planSample、resume、undo)共 727 条全部通过。
  • CI 失败修复:AgentPlanService 若在构造函数注入 IAgentToolPolicyService,会改变构造期 DI 实例化与执行器钩子注册时序,导致 plan.test.ts 批量工具在恢复后的日志顺序不一致;改为在 enter() 中通过 IInstantiationService 惰性读取策略后恢复原有顺序。同时为 exitPlanMode.e2e.test.ts 的严格 DI 容器补注册了 IAgentToolPolicyService stub。
  • 合并路径相关测试(towerFeature.test.ts、towerDeferredTools.e2e.test.ts、kap-server 的 context.test.ts 与 sessions.test.ts、桌面主进程浏览器提醒/MCP 注册测试):166 条通过。
  • pnpm qa:refresh schema:重新生成 openapi.json、asyncapi.json、contract.txt,所有契约差异均为增量(non-breaking),HOST_CONTRACT 已在 apiLevel: 1 下更新。
  • pnpm run check:duplication origin/main:通过(0 新增重复)。提取了 rest-config.ts 的公共 configFields(契约哈希不变),并在 defineRoute.ts 中用泛型 RouteMethod<Req> 定义 GetRouteHost / PostRouteHost,供 tools、context、fileHistory、conversation、sessions、sessionList、sessionRating 复用,消除了路由文件中既有的同构接口重复。
  • 评审修复补充验证:Composer 提交判定、共享 Web/Desktop Composer 组件、视口/撤销,以及 kap-server 上述路由与 sessionRating 等相关测试共 424 条通过;defaultToolsPanel.test.ts(新增配置缺失阻断、重试保留禁用规则、无 tools 段配置初始化、保存中拒绝放弃)与 settings-dialog-font-page.test.ts 共 12 条通过。
  • 只读 diff 审查:无内部标识、本机路径、密钥、临时草稿文件或 agent 身份署名。
  • 平台核对:macOS(本地单元与集成测试)。本次未改动路径、子进程、shell 或终端输入处理。
  • 视觉验证:未运行(未执行浏览器自动化或截图)。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (内部功能需求,无关联 issue;迁移自 MoonshotAI/kimi-code-app#1239 与 MoonshotAI/kimi-code#4797).
  • 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.(已添加 kimi-code-app minor 与 @moonshot-ai/kap-server / @moonshot-ai/agent-core-v2 patch;按要求不添加 @moonshot-ai/kimi-code 条目)
  • Ran gen-docs skill, or this PR needs no doc update.(按要求不在本 PR 中修改用户文档,docs/ 无改动)

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 28723d5

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

This PR includes changesets to release 3 packages
Name Type
kimi-code-app Minor
@moonshot-ai/kap-server Patch
@moonshot-ai/agent-core-v2 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T05:25:05.908001Z 28723d5 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: c9c63a9478

ℹ️ 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".

…tings

# Conflicts:
#	packages/agent-core-v2/src/features/tower/towerFeature.ts
@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

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

commit: 28723d5

@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: 05f7d384e5

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: d1efa9c5e7

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8f5327b9e5

ℹ️ 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".

@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: 2a72796d86

ℹ️ 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".

@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: 67dce73f2a

ℹ️ 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".

@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: 82b032ff50

ℹ️ 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".

…tings

# Conflicts:
#	packages/app-components/src/composer/Composer.vue
#	packages/app-components/test/composerRunningSendMode.test.ts
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@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: 1e3ed92923

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: e101dc75a9

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@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: 4fbbd4fc69

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@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: effa8a7dc1

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@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: 28723d528e

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@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: 28723d528e

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@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: 28723d528e

ℹ️ 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".

@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 28723d528e

ℹ️ 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".

@liruifengv
liruifengv merged commit 233b17f into main Nov 25, 2026
25 checks passed
@liruifengv
liruifengv deleted the feat/default-tool-settings branch November 25, 2026 05:46
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 25, 2026
…aries

The 2.8.0 back-sync is metadata-only here for now: docs/notes are in, the
version bump and changeset consumption wait for the open 2.8.0 rows. The
built-in tool settings port needs its layered breakdown because the raw
patch conflicts in 29 files.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
…hotAI#5204)

Port the remaining client half of upstream e6b16c4 on top of the landed
core/KAP/klient work: desktop panel roots and archived-project grouping,
app-core panelRoots, app-client activePanelRoots and unseen-project listing,
app-components FilesPanel session roots, CLI launch-path resolution for skill
dirs, TUI session-directory resume hints, SDK resolveSessionPlacement and
WorkspaceTrustInfo.projectRoot, and project-scoped imported sessions.

Fork adaptations:
- the localized trust prompt keeps the fork's workspace wording and the
  standalone session-directory hint; upstream's session-aware project trust
  and its trust-prompt rewrite are not adopted;
- upstream vitest test files are adapted to the fork's bun:test suites, and
  the UI test for MoonshotAI#5351's confirmDiscard stays with that row;
- migration-legacy keeps its own session-index entry writer while writing
  the new project-scoped session layout, and imported sessions keep the
  localized default title;
- the message-flow temp-dir cleanup retries on Windows EBUSY.

Verified: apps/kimi-code and node-sdk typecheck clean; node-sdk
sdk-rpc-client-v2 100 pass / 11 skip; session-import 13, add-dir 9,
run-shell 23, TUI startup 89, message-flow 489 pass / 1 skip,
run-v2-print 27; migration-legacy import/resume 9; desktop renderer 50;
app-client workspaces-store 90, files-store 60, session-info 13;
app-components FilesPanel 7; app-core panelRoots 7. Pre-existing:
app-client workspace-state 212 pass / 13 fail and session-list-store
35 pass / 2 fail (Bun lacks vi.resetModules).
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
Mark MoonshotAI#5394 ported with its cancel-during-start regression; record MoonshotAI#5359 and MoonshotAI#5351 as blocked on the TUI continuation capability and the tool activation model, and keep MoonshotAI#5432 partial until those rows close.
liruifengv added a commit that referenced this pull request Nov 26, 2026
Keep profile_revision, missing_model, and SessionAgentFeed.refresh() from #5449 so models/providers config changes and model catalog updates still push agent frames, while dropping the reverted #5351 mode availability fields and tool policy subscriptions.
liruifengv added a commit that referenced this pull request Nov 26, 2026
* revert: remove built-in tool settings and mode availability

This reverts commit 233b17f (#5351).

* fix(desktop): confirm before closing settings with unsaved global AGENTS.md edits
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
Built-in tool contributions now declare whether users may configure them,
and every mode that depends on a tool checks it before entering: Plan
needs ExitPlanMode, goals need UpdateGoal, swarm needs AgentSwarm, and
Tower needs its complete tool set. KAP serves GET /tools/catalog, persists
the tools.enabled/disabled config, and reports plan/swarm/tower/goal
availability on the agent state frame. app-core adds the catalog/config
client and default-tools helpers; app-components adds the Default Tools
settings panel, rows and catalog; desktop wires the settings page, ChatDock
goal controls and slash-menu availability.

Fork adaptations: only the catalog/config/agent-state KAP changes are kept,
with the unrelated upstream route refactors reverted; the tower
availability getter tolerates an unbound loop in unit contexts; plan
inline snapshots were refreshed for this fork's rendering.

Verified: KAP tools 8, config 33, contracts 18, sessions 135; engine plan
31, goal 165, swarm 33, new tower availability 2; app-core 100, app-client
composer/slash 122, app-components default tools 19, desktop ChatDock goal
3; root typecheck clean; check:lint, check:no-comments and check:t-coverage
green; frozen install unchanged.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
Compaction (MoonshotAI#5538):
- Send the whole history to the summary request, drop the pre-shrink and
  the drop-oldest retries, shrink a truncated summary only when the window
  squeezed its output, and retry empty or thinking-only summaries with the
  same history. Keep flushReminders, applyCompactionRound and
  historyFromContextPreservingToolNotes.
- Fix two pre-existing 2.7-alignment gaps the suite exposed: recognise the
  serialized { kind: 'context_overflow' } payload in
  shouldRecoverFromContextOverflow, and remove the duplicate
  runWithCredentialRecovery around the requester's own credential recovery
  so a replayed 401 surfaces instead of being retried.
- fullCompaction 124 pass / 0 fail; agent-core-v2 typecheck clean.

Built-in tool settings (MoonshotAI#5489):
- Keep MoonshotAI#5351's KAP catalog/config/agent-state fields, the four mode guards
  and the desktop/Web UI as a fork-only capability.
- Replace the 22 per-tool userConfigurable flags with the central
  USER_CONFIGURABLE_BUILTIN_TOOL_NAMES list in kap-server. The catalog still
  returns the same 39 entries (26 core + 13 Tower), now pinned by
  tools.test.ts.
- Ledger: MoonshotAI#5351 marked fork-only, MoonshotAI#5489 not-applicable with the keep-both
  approval, both in B2; the PLAYBOOK records the invariant.
- kap-server tools 8 pass; agent-core-v2 and kap-server typecheck clean.

Loop baseline:
- max_steps no longer marks a completed step as interrupted.
- Goal creation accepts UpdateGoal when it is loadable through
  isToolActiveForDisclosure.
- Refresh the three loop inline snapshots for the intentional
  continuation, loadable-tools and step.begin shape.
- test/agent/loop 175 pass / 3 fail; the three remaining failures are the
  pre-existing cancelled-partial preservation, recorded as the first
  acceptance of the MoonshotAI#5541 requester migration.

Ledger refresh adds 87 upstream rows; MoonshotAI#5538 and MoonshotAI#5489 are triaged, 85 remain
pending.
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.

2 participants