Skip to content

feat: split experimental flags into Beta and Experimental tiers - #5333

Merged
wbxl2000 merged 41 commits into
mainfrom
feat/experimental-tiers
Nov 28, 2026
Merged

wbxl2000 merged 41 commits into
mainfrom
feat/experimental-tiers

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Screenshots / Recordings

桌面端与 Web 端 设置 > 实验室(Settings > Lab)拆分为 Beta 功能 与 实验性功能 两档:各档标题旁内联展示阶段说明,Beta 功能 区域右上角提供 全部 总开关(开启后联动并锁定下方的 上下文用量、提示词预测,关闭后恢复各项原有独立配置):

Beta 总开关关闭 Beta 总开关开启
Desktop 实验室(Beta 总开关关闭) Desktop 实验室(Beta 总开关开启)
Desktop / Web English locale (`Settings > Lab`)
All OFF All ON
Desktop Lab (English, Beta master OFF) Desktop Lab (English, Beta master ON)

TUI /lab(保留 /experiments 与 /experimental 别名)在 Beta 与 Experimental 分组标题旁内联展示阶段说明,Enable all Beta features 保持作为 Beta 分组首项,并对需新会话或重启生效的开关标注 new sessions / restart required:

TUI /lab(默认关闭) TUI /lab(开启全部 Beta 功能)
TUI /lab (Beta master OFF) TUI /lab (Beta master ON)
 <SettingsDialog>
   <LabTab>
-    <SidebarTabsSwitch />
-    <NotifyUserSwitch />
-    <SessionMentionsSwitch />
-    <ContextInspectorSwitch />
+    <BetaSectionHeader hint="Coming soon — try them early">
+      <EnableAllBetaSwitch />
+    </BetaSectionHeader>
+    <BetaGroup>
+      <ContextInspectorSwitch />
+      <PromptPredictionSwitch />
+    </BetaGroup>
+    <ExperimentalSectionHeader hint="Agent explorations — still evolving, review and enable as needed" />
+    <ExperimentalGroup>
+      <NotifyUserSwitch />
+      <SessionMentionsSwitch />
+      <SidebarMultiTabSwitch />
+      <TowerSwitch />
+    </ExperimentalGroup>
   </LabTab>
 </SettingsDialog>

Requirement or Bug

此前所有实验性开关混在单一平铺列表中:打磨接近完成的功能与早期探索功能无法区分,同一台机器上 TUI 与 Desktop 共用平铺 [experimental] 表会导致 Beta 总开关与同名实验开关跨端互相覆盖,Desktop 登录 Shell 环境变量探测也会把用户在 ~/.zshrc 中为 CLI 导出的 KIMI_CODE_EXPERIMENTAL_* 带入桌面端并锁定 UI 开关,部分实验室开关散落在浏览器 localStorage 而无法跨端同步,KIMI_CODE_EXPERIMENTAL_FLAG=1 也会把需要改变会话心智或重启生效的探索功能一并打开。

本 PR 引入按客户端表面(tui / desktop / web)声明的 experimental / beta / ga 三阶段生命周期、按宿主档案隔离的 [experimental.cli] + [experimental.desktop] 持久化子表与两档设置界面,将留在实验室内的全部开关统一收敛进 FlagRegistry 与 config.toml,支持按端独立一键开启全部 Beta 功能且保留单个开关的独立配置,并在全端统一暴露开关生效时机。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路

将实验性开关重构为两个正交维度:

  1. 客户端表面(ExperimentalSurface = 'tui' | 'desktop' | 'web'):决定一个开关在哪些界面展示及其生命周期阶段(experimental / beta / ga)与生效时机(immediate / next-session / restart)。
  2. 宿主配置档案(ExperimentalProfile = 'cli' | 'desktop'):决定持久化读写 config.toml 的哪张子表:
    • [experimental.cli]:由 CLI 终端(kimi)、kimi web 与 kimi rc 共享(kimi web 继承 CLI 域配置)。
    • [experimental.desktop]:由 Kimi Code Desktop 及其开启的 Remote Control Web(platform === 'kimi_code_desktop')共享;同时 Desktop 登录 Shell 环境变量探测(shell-env.ts)排除 KIMI_CODE_EXPERIMENTAL_*,避免 ~/.zshrc 中的 CLI 环境变量串扰锁定桌面端开关(显式 KIMI_CODE_EXPERIMENTAL_*=1 pnpm dev:desktop 仍正常生效)。

各子表内的 beta = true 配置键与当前进程的 KIMI_CODE_EXPERIMENTAL_FLAG=1 环境变量收敛为 Beta 总开关,采用非破坏性求值覆盖(开启时令当前表面处于 beta 阶段且未被单开关环境变量锁定的功能生效,关闭时回退到各开关原有的子表配置值);Experimental 阶段功能仅响应自身的配置键或专属环境变量。因为 CLI 与 Desktop 已按子表天然隔离,所有跨端能力均保持单一规范 Flag ID(如统一使用 notify_user / KIMI_CODE_EXPERIMENTAL_NOTIFY_USER,无需拆出 _app 变体)。

当前 7 个注册开关在两档中的分布如下:

  • Beta 档(跟随对应档案的 Enable all Beta features / [experimental.<profile>].beta 与 KIMI_CODE_EXPERIMENTAL_FLAG=1):
    • prompt_prediction(tui / desktop / web,immediate)
    • context_inspector(desktop / web,immediate)
  • Experimental 档(仅响应单开关配置或专属环境变量):
    • notify_user(tui / desktop / web,next-session)
    • session_mentions(desktop / web,immediate)
    • sidebar_multi_tab(desktop / web,immediate)
    • wait_for(tui,immediate)
    • tower(tui / desktop / web,restart)

原存于浏览器 localStorage 的 context_inspector、session_mentions 与 sidebar_multi_tab 统一注册进 FlagRegistry 并持久化到当前宿主档案的 [experimental.<profile>],客户端在首次拉取 /api/v1/meta 时对旧版 localStorage 已开启的值执行一次性迁移并清理旧键。旧版平铺 [experimental] 顶层布尔键在读取时自动归一化(CLI 专属历史键 notify_user / wait_for 仅归入 cli,其余共享键归入未显式覆盖的 cli / desktop)。对升级前已在现有安装中通过 KIMI_CODE_EXPERIMENTAL_FLAG=1 使用 tower 的用户,启动时按宿主档案一次性迁移写入 [experimental.<profile>] tower = true。

概念

概念 回答什么问题 本 PR 之后
ExperimentalProfile 读写 config.toml 的哪张实验子表 'cli'([experimental.cli]:kimi / kimi web / kimi rc)或 'desktop'([experimental.desktop]:Desktop 及其 Remote Control Web)
ExperimentalSurface 同一个开关面向哪些客户端表面暴露与求值 按宿主身份解析为 'tui' | 'desktop' | 'web';未声明某表面的开关不在该表面的实验列表与 exposedIds() 中展示
ExperimentalStage 功能默认是否开启、是否跟随 Beta 总开关 'experimental'(默认关,仅单独开启)、'beta'(默认关,跟随 Beta 总开关或单独开启)、'ga'(默认开且不再作为实验项列出,仅可被单开关环境变量覆盖)
ExperimentalEffectTiming 改完配置后何时在运行态生效 'immediate'(立即热重载)、'next-session'(新会话生效)、'restart'(需重启进程;active 与 enabled 分离以提示待重启)
Beta 总开关([experimental.<profile>].beta / KIMI_CODE_EXPERIMENTAL_FLAG) 如何一键试用接近正式发布的功能而不冲掉单开关配置 求值时插入在单开关环境变量之后、单开关配置之前;不改写其他子开关落盘键值

结构图

flowchart LR
    subgraph Engine["agent-core-v2"]
      Cfg["ConfigService<br/>读写 [experimental.cli / desktop]"]
      Reg["FlagRegistry<br/>stages + effectTiming"]
      Svc["FlagService<br/>按 profile 求值 + 旧 MASTER_ENV 下 tower 迁移"]
    end

    subgraph Facades["SDK & Daemon"]
      SDK["klient + node-sdk<br/>getExperimentalFeatures / BetaState"]
      KAP["kap-server GET /api/v1/meta<br/>experimental_beta(profile) + experimental_features"]
    end

    subgraph Clients["客户端界面"]
      TUI["TUI /lab (/experiments)<br/>写入 [experimental.cli]"]
      App["app-core + app-client + SettingsDialog<br/>按 meta.profile 写入 cli / desktop"]
    end

    Cfg <--> Svc
    Reg --> Svc
    Svc --> SDK --> TUI
    Svc --> KAP --> App
Loading

关键决策

决策 选择 没选 理由
CLI 与 Desktop 配置隔离方式 在 config.toml 中划分为 [experimental.cli](kimi + kimi web + kimi rc)与 [experimental.desktop](Desktop + Desktop Remote Control Web),并在 Desktop shell-env.ts 中排除登录 Shell 的 KIMI_CODE_EXPERIMENTAL_* 共用平铺 [experimental] 表并通过拆出 notify_user_app 等 _app 后缀开关规避冲突 按宿主档案分桶后,beta 总开关与所有同名开关(notify_user、prompt_prediction、tower 等)在 CLI 与 Desktop 之间天然完全隔离,无需为跨端功能复制双份 Flag ID,同时 kimi web 与 TUI、Desktop Remote Control 与 Desktop 各自保持一致的预期继承关系
Beta 总开关的作用方式 求值期非破坏性覆盖(source: 'beta-config' | 'master-env') 切换总开关时批量改写磁盘上每个 Beta 开关的布尔值 用户关闭 Beta 总开关后应恢复此前单独调过的子开关状态,且未来新增 Beta 功能时已开总开关的用户可自动获得新功能
KIMI_CODE_EXPERIMENTAL_FLAG=1 存量 tower 兼容 在现有安装首次启动时按 profile 将 tower = true 落盘到 [experimental.<profile>] 并写入 ~/.kimi-code/experimental-migrations.json 标记;配置或标记文件损坏时临时回退进程级环境变量而不误打标记 让 KIMI_CODE_EXPERIMENTAL_FLAG=1 继续开启 Experimental 档,或直接断掉存量用户的 tower 只在检测到现有安装痕迹时迁移,既保护存量 tower 用户升级不断裂,又让全新安装从一开始遵循“KIMI_CODE_EXPERIMENTAL_FLAG=1 只管 Beta”的新契约

阅读指南

  1. packages/agent-core-v2/src/app/flag/flagRegistry.ts、bootstrap.ts 与 flag.ts:理解 ExperimentalProfile、ExperimentalSurface、ExperimentalStage、ExperimentalEffectTiming 及 [experimental.cli] / [experimental.desktop] Schema 与旧版平铺键归一化逻辑。
  2. packages/agent-core-v2/src/app/flag/flagService.ts:理解单开关环境变量 → ga → Beta 总开关 → 当前 profile 子表配置 → 默认 false 的完整求值顺序、active / exposedIds 计算,以及存量 KIMI_CODE_EXPERIMENTAL_FLAG=1 用户通过 ConfigService.set 执行的一次性 tower = true 迁移与内存回退。
  3. packages/kap-server/src/routes/{registerApiV1Routes,config}.ts、apps/desktop/src/main/system/shell-env.ts 与 packages/app-client/src/stores/config.ts:理解 /api/v1/meta 下发 experimental_beta.profile、/api/v1/config 原样保留嵌套 snake_case flag ID、Desktop 登录 Shell 隔离,以及前端按当前 profile 落盘与旧 localStorage 迁移。
  4. apps/kimi-code/src/tui/components/dialogs/experiments-selector.ts 与 apps/desktop/src/renderer/components/settings/SettingsDialog.vue:理解 TUI 与 Desktop/Web 两端的分组交互和锁定提示。

具体变化大纲

FlagService.evaluate 的求值顺序变化如下:

 evaluate(def, stage)
   if parseBooleanEnv(env[def.env]) is defined
     return { enabled: envOverride, source: 'env', env: def.env }
+  if stage === 'ga'
+    return { enabled: true, source: 'default', env: def.env }
+  if stage === 'beta' && betaState().enabled
+    return { enabled: true, source: betaState().source === 'env' ? 'master-env' : 'beta-config', env: def.env }
-  if config[def.id] is defined
-    return { enabled: config[def.id], source: 'config' }
-  if parseBooleanEnv(env[KIMI_CODE_EXPERIMENTAL_FLAG]) === true
-    return { enabled: true, source: 'master-env' }
-  return { enabled: def.default, source: 'default' }
+  if config[profile][def.id] is defined
+    return { enabled: config[profile][def.id], source: 'config', env: def.env }
+  return { enabled: false, source: 'default', env: def.env }

GET /api/v1/meta 在保留原有 experimental_flags 布尔字典的基础上增量扩展两个字段(HOST_API_LEVEL 仍为 1):

interface MetaResponse {
  // ...existing fields
  experimental_flags: Record<string, boolean>;
  experimental_beta: {
    profile: 'cli' | 'desktop';
    enabled: boolean;
    source: 'env' | 'config' | 'default';
    env: string;
    config_value?: boolean;
  };
  experimental_features: Array<{
    id: string;
    title: string;
    description: string;
    stage: 'experimental' | 'beta' | 'ga';
    effect_timing: 'immediate' | 'next-session' | 'restart';
    env: string;
    enabled: boolean;
    active: boolean;
    source: 'env' | 'master-env' | 'beta-config' | 'config' | 'default';
    config_value?: boolean;
  }>;
}

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
config.toml 实验配置结构与跨端隔离 单一平铺 [experimental] 表,CLI 与 Desktop 互相覆盖;Desktop 会从登录 Shell(如 ~/.zshrc)导入 KIMI_CODE_EXPERIMENTAL_* 拆分为 [experimental.cli](kimi / kimi web / kimi rc)与 [experimental.desktop](Desktop 及其 Remote Control Web);旧版平铺键读取时自动归一化(notify_user / wait_for 仅归入 cli,共享键归入双端);Desktop shell-env 忽略登录 Shell 中的 KIMI_CODE_EXPERIMENTAL_* 手写平铺 [experimental] 配置的用户(读取自动兼容),以及依赖 ~/.zshrc 中 export KIMI_CODE_EXPERIMENTAL_* 控制桌面端的用户 在 Desktop Settings > Lab 或 [experimental.desktop] 中持久化开启,或以显式进程环境变量启动桌面端
WaitFor 工具(wait_for)默认开关状态 default: true,所有入口默认向模型暴露 WaitFor 工具 stages: { tui: 'experimental' },所有入口默认关闭,且不再随 KIMI_CODE_EXPERIMENTAL_FLAG=1 开启 默认配置下的 TUI、kimi -p print 模式、Desktop/Web、ACP、SDK 用户 在 TUI /lab(或 /experiments)开启、在 config.toml 设 [experimental.cli] wait_for = true,或设 KIMI_CODE_EXPERIMENTAL_WAIT_FOR=1
KIMI_CODE_EXPERIMENTAL_FLAG=1 的作用范围 开启全部实验性开关(含 prompt_prediction、wait_for、tower、notify_user) 仅开启当前客户端表面的 Beta 阶段功能(TUI:prompt_prediction;Desktop/Web:context_inspector、prompt_prediction)并锁定 Beta 总开关;不再开启 Experimental 阶段功能。有存量安装痕迹且设了 KIMI_CODE_EXPERIMENTAL_FLAG=1 的用户首次启动自动写入 [experimental.<profile>] tower = true 通过 KIMI_CODE_EXPERIMENTAL_FLAG=1 期望开启 notify_user、wait_for 的环境变量用户,以及在全新空目录安装上仅设 KIMI_CODE_EXPERIMENTAL_FLAG=1 期望开启 tower 的用户 使用各自专属环境变量(KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=1、KIMI_CODE_EXPERIMENTAL_WAIT_FOR=1、KIMI_CODE_EXPERIMENTAL_TOWER=1)或 [experimental.<profile>].<id> = true
Desktop 与 Web 的 context_inspector、session_mentions、sidebar_multi_tab 存储位置 仅存储在浏览器本地 localStorage 统一迁入 config.toml 的 [experimental.<profile>](context_inspector 为 beta,session_mentions 与 sidebar_multi_tab 为 experimental);首次同步 /api/v1/meta 时自动迁移旧 localStorage 并清理旧键 此前在 Desktop 或 Web 开启过这三项开关的用户(自动无感迁移) 通过 Settings > Lab、config.toml 的 [experimental.<profile>] 或对应环境变量控制
TUI 实验功能命令与弹窗 仅 /experiments 命令,平铺展示所有注册开关 主命令升级为 /lab(保留 /experiments 与 /experimental 别名),分为 Beta 与 Experimental 两组并写入 [experimental.cli] 熟悉旧平铺列表的 TUI /experiments 用户 /experiments 与 /experimental 别名继续可用
@moonshot-ai/kimi-code-sdk 与 agent-core-v2 实验开关类型导出 FlagDefinitionInput 含 default / surface;ExperimentalFeatureState 含 surface / defaultEnabled;experimental 为平铺布尔字典 FlagDefinitionInput 改为 stages / effectTiming;ExperimentalFeatureState 改为 stage / effectTiming / active;BetaMasterSwitchState 含 profile: 'cli' | 'desktop';experimental 为 { cli?, desktop? } 直接读取旧字段或写平铺 experimental 对象的 TypeScript SDK 调用方 改用 experimental.cli / experimental.desktop 及 stage、effectTiming、active、getExperimentalBetaState()

存量配置升级与首次运行核对矩阵

针对升级前常见的存量配置与环境变量组合,跨 4 种运行入口(kimi TUI、kimi web/rc、Dock/Finder 启动 Desktop、终端命令启动 Desktop)逐一推演并验证了首次运行表现:

存量配置场景 kimi TUI / kimi web / kimi rc(cli 档案) Desktop(Dock / Finder 启动,desktop 档案) Desktop(终端命令直接启动,如 VAR=1 pnpm dev:desktop)
旧平铺 [experimental](如 tower = true、prompt_prediction = true、notify_user = true、wait_for = false) 只读启动不改盘;experimentalFromToml 将全部键归入 cli,tower 当场组装激活(/tower 立即可用),其余开关原样生效。首次修改落盘时自动转为 [experimental.cli] + [experimental.desktop] 且不丢另一端键值 tower、prompt_prediction 自动归入 desktop 并当场生效;wait_for 与 notify_user 属于 LEGACY_CLI_ONLY_EXPERIMENTAL_KEYS 仅归入 cli(旧版 Desktop 曾开平铺 notify_user = true 的用户桌面端回落关闭,可在设置中重开写入 [experimental.desktop]) 与左列一致
~/.zshrc 设 export KIMI_CODE_EXPERIMENTAL_FLAG=1 检测到存量安装痕迹(config.toml 或 sessions/credentials/user-history)且未配 tower 时,首次启动原子写入 [experimental.cli] tower = true 并记录 experimental-migrations.json(幂等单次,后续手动关闭不反弹;只读文件回退进程级内存 KIMI_CODE_EXPERIMENTAL_TOWER=1;全新安装仅打标记不开启 tower)。Beta 总开关被环境变量锁定开启,prompt_prediction(及 Web 的 context_inspector)生效;notify_user、wait_for 按新契约保持关闭;CLI 更新灰度旁路继续生效 shell-env.ts 拦截登录 Shell 的 /^KIMI_CODE_EXPERIMENTAL_/:.zshrc 的 FLAG=1 不进入进程,Beta「全部」开关保持关闭且可自由点击;仅靠 .zshrc FLAG=1(未写 config.toml)的用户不会向 [experimental.desktop] 自动迁入 tower(保持 .zshrc 不串扰桌面端) mergeShellEnv 保留父进程已有 process.env:显式传入的 FLAG=1 正常锁定开启 Beta,并在存量安装下对 desktop 桶执行一次性 tower = true 迁移
~/.zshrc 逐项设 export KIMI_CODE_EXPERIMENTAL_*=1 单开关环境变量最高优先级生效(source: 'env'),/lab 与 Web 设置界面显示开启并置灰锁定;已设 KIMI_CODE_EXPERIMENTAL_TOWER 时迁移器记 stamped-noop 不改盘 登录 Shell 探针全部拦截,桌面端开关不被锁定,按 [experimental.desktop] 独立读写 父进程显式传入的单开关环境变量正常生效并锁定对应行
旧版浏览器 localStorage 实验开关(context_inspector、session_mentions、sidebar_multi_tab) kimi web 首次同步 /api/v1/meta 时,若 cli 桶未显式配置且 localStorage 为开启值,前端乐观开启并异步写入 [experimental.cli] 后清除旧键 首次同步 /api/v1/meta 时乐观开启并异步写入 [experimental.desktop] 后清除旧键;迁入后同一内嵌 server 下的 Remote Control Web 自动共享 与左列一致
默认未配置用户 & 异常 TOML 容错 wait_for 由默认开启改为默认关闭,其余均默认关闭;未知布尔键静默忽略,手改非布尔值/非法子表由 ConfigService.buildValidated 按 section 隔离告警回退,不阻断启动或其他配置 全部默认关闭;容错同左 同左

受影响模块与验证结论

受影响模块涵盖 packages/agent-core-v2(flag、config、notify、promptPrediction、tokenCounting、sessionIndex、tower、task-wait)、packages/klient、packages/node-sdk、packages/kap-server、packages/acp-server、packages/app-core、packages/app-client、packages/app-i18n、apps/kimi-code(TUI /lab)与 apps/desktop(shell-env 及 SettingsDialog)。

已在 macOS 本地与 Linux / Windows CI 完成全链路验证:覆盖双档案隔离、平铺旧配置归一化、存量 KIMI_CODE_EXPERIMENTAL_FLAG=1 的 tower 单次幂等迁移与只读/损坏回退、Desktop 登录 Shell KIMI_CODE_EXPERIMENTAL_* 过滤、浏览器 localStorage 一次性迁移、TUI /lab 与 Desktop/Web Settings > Lab 两档交互及真实渲染截图核验。

测试覆盖清单
  • packages/agent-core-v2/test/app/flag/flag.test.ts:[experimental.cli] / [experimental.desktop] 双桶隔离、旧平铺键归一化(含 LEGACY_CLI_ONLY_EXPERIMENTAL_KEYS)、experimental / beta / ga 求值优先级、Beta 总开关非破坏性覆盖、migrateLegacyMasterEnvTower 按 profile 幂等迁移、全新安装跳过、只读/损坏/软硬链接异常回退。
  • apps/desktop/tests/main/system/shell-env.test.ts:登录 Shell 探测过滤 KIMI_CODE_EXPERIMENTAL_* 并保留父进程显式环境变量。
  • apps/desktop/tests/renderer/lab-settings.test.ts、packages/app-client/test/workspace-state.test.ts、packages/app-core/test/configClient.test.ts:Desktop / Web 两档分组与阶段说明渲染、Beta「全部」开关联动与回退、环境变量锁定态提示、restart 生效时机 active/enabled 分离、旧 localStorage 键值一次性迁移与清理。
  • apps/kimi-code/test/tui/commands/experiments.test.ts、apps/kimi-code/test/tui/components/dialogs/experiments-selector.test.ts、apps/kimi-code/test/tui/commands/resolve.test.ts:TUI /lab(含 /experiments、/experimental 别名)两档分组、内联阶段说明、Beta 总开关联动、写入 [experimental.cli] 及热重载行为。
  • packages/kap-server/test/meta.test.ts、packages/kap-server/test/apiSurface.test.ts、packages/node-sdk/test/sdk-rpc-client-v2.test.ts:/api/v1/meta 扩展字段与 profile 下发、/api/v1/config 原样保留嵌套 snake_case flag ID、SDK 实验特性查询契约。
  • packages/agent-core-v2/test/agent/task/tools/task-tools.test.ts、packages/agent-core-v2/test/features/notify/tools/notify-user.test.ts、packages/agent-core-v2/test/features/tower/towerFeature.test.ts:wait_for 默认关闭与动态开关、notify_user 统一 Flag ID 跨表面生效、tower 组装激活与 exposedIds 行为。

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.

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 00abdb9

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

This PR includes changesets to release 11 packages
Name Type
@moonshot-ai/kimi-code Minor
kimi-code-app Minor
@moonshot-ai/agent-core-v2 Minor
@moonshot-ai/klient Minor
@moonshot-ai/kap-server Minor
@moonshot-ai/acp-server Patch
@moonshot-ai/kimi-code-sdk Minor
kimi-code Patch
@moonshot-ai/migration-legacy Patch
@moonshot-ai/kimi-code-product Patch
@moonshot-ai/remote-control 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-28T07:45:59.436696Z 85d6152 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: 50afd1eb95

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

Comment thread .changeset/experimental-tiers-sdk.md Resolved
@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@00abdb9
npx https://pkg.pr.new/@moonshot-ai/kimi-code@00abdb9

commit: 00abdb9

@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: 127feabe56

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

@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: 141d0d0127

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: e9039fbd75

ℹ️ 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: bd0008ed17

ℹ️ 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: efd5e64db9

ℹ️ 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: c958f6c1ca

ℹ️ 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: ce3cb6810b

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

Comment thread docs/en/reference/slash-commands.md Resolved

@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: 3cb028c21e

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

wbxl2000 added a commit that referenced this pull request Nov 27, 2026
@wbxl2000

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: 43dba6f25a

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 4feb39bfde

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

@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: 0f1b56e4aa

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review

Changes since last review (b8375755a):

  • Guarded activeExperimentalProfile() in packages/app-client/src/stores/config.ts so browser clients return null (and disable individual Lab switches in SettingsDialog.vue) until /api/v1/meta resolves experimentalBeta.profile, preventing Remote Control Web from writing to [experimental.cli] on a Desktop server.
  • Serialized stampMigrationMarker in packages/agent-core-v2/src/app/flag/legacyMasterEnvMigration.ts with a synchronous lockfile (${markerPath}.lock with bounded ELOCKED retries) so concurrent fresh-install starts preserve both cli and desktop stamps.
  • Added .changeset/experimental-tiers-vscode.md ("kimi-code": patch) and updated .changeset/experimental-tiers-desktop.md to document that WaitFor is no longer enabled by default.

Previously resolved design boundaries (do not re-litigate):

  • notify_user in LEGACY_CLI_ONLY_EXPERIMENTAL_KEYS and Dock-launched Desktop ignoring login-shell KIMI_CODE_EXPERIMENTAL_* exports are intentional and documented in the PR description.
  • /api/v1/config co-evolves with first-party Desktop/Web clients without legacy server compatibility shims per packages/kap-server/AGENTS.md.

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

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

@wbxl2000

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: 9f07b16fa7

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

Comment thread .changeset/experimental-tiers-libs.md Resolved
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

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

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

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex review
已 resolve 的主题代表我们的判断取舍与当前代码现状,请勿重复提出(其余约定同首轮)。

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 85d6152ea6

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

@wbxl2000
wbxl2000 merged commit a731006 into main Nov 28, 2026
28 of 30 checks passed
@wbxl2000
wbxl2000 deleted the feat/experimental-tiers branch November 28, 2026 09:22
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Dec 2, 2026
`bun scripts/upstream-ledger.mjs --refresh` at upstream/main 4eb2919
added 126 rows, so every open upstream commit and every PR it references
now has a ledger row: 0/596, down from 125 at 8bf8ba3 and 126 at the
fetched tip. The refresh only reads `upstream/main ^ main`, so the three
release-2.6.2 commits named by the mission (MoonshotAI#4875/MoonshotAI#4905/MoonshotAI#4922) gained
rows with the refresh's row shape.

Settled with live probes in this tree:

- ported: MoonshotAI#5533 (docs 2.8.1 changelog), MoonshotAI#4875 (registry search_url and
  feedback_url plus the feedback service), MoonshotAI#4905 (Kimi upload status
  validation in packages/core), MoonshotAI#4922 (swarm task events in
  sessionTaskFeed), MoonshotAI#5438 (unload only declared dynamic tools), MoonshotAI#5592
  (dynamic tool replacement order), MoonshotAI#5595 (append-log known length),
  MoonshotAI#5573 (skill roots for every work dir), MoonshotAI#5576 (date reminder cwd
  comparison), MoonshotAI#5618 (session titles for skill openers), MoonshotAI#5638 (frozen
  loop tool baseline), MoonshotAI#5626 (legacy turn-input origins)
- partial: MoonshotAI#5505 (processLiveness source and consumers present; the
  upstream unit test file was never carried), MoonshotAI#5571 (program-resume and
  OSC 7577 present; the upstream test helper was never carried), MoonshotAI#5532
  (gitService half present; fsService still leaks the environment lease
  at fsService.ts:1133 and :1267), MoonshotAI#5557 (app-client icon registry kept;
  the move to app-ui was never carried)
- not-applicable: MoonshotAI#4655 (upstream reverted auto review in MoonshotAI#5649), MoonshotAI#5333
  (PLAYBOOK:111 deliberate flat experimental flags)

M39's "likely present" list was checked, not trusted: MoonshotAI#5438 is present
(upstream test passes), MoonshotAI#5487 is not (nativeStartSettleMs/leg.nativeSettled
absent), MoonshotAI#5635 is not (ToolsSettled absent), MoonshotAI#5429 needs a visual probe.
The remaining 194 pending rows stay open with their reasons; no feature
was ported and no upstream-drift allowlist entry was added.

Verification: verify -> 332 closed rows, 332 carry every file of their
PR; 317 probes pass, 2 foreign-runner skips, 0 fail; a second verify is
byte-identical (ledger sha256 cbf53638...). Probe tests 29 pass; bun run
lint and node scripts/checks/ratchet.mjs green.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Dec 2, 2026
…er wording

Review round 1 on 0083736e14.

`--release-refresh` said it fetched tags but only fetched upstream main, so a
checkout without the release tags failed at `git log <tag>`. It now fetches
each tracked tag that is missing locally, one at a time: a bulk `--tags` fetch
aborts because this fork has repointed tags, and force-overwriting one would
rewrite the evidence a reviewed row rests on. The fixture test deletes the
tags, re-fetches them through the new helper, and pins that a locally
repointed tag is not overwritten.

The changeset no longer says three new entries in the CLI: two commands are
new there and the helpers live in scripts/lib/upstream-ledger-probes.mjs.
MoonshotAI#5176's pending evidence now names the absent route half (persistSessionWrites
and the :wait calls) instead of the engine helper, which does exist.

The completion report is corrected: the main-ledger verify at this tip is
316 pass / 2 skipped / 1 fail, not green. The failure is MoonshotAI#5333, whose
absent:experimentalFeatures probe now finds M34's experimentalFeatures; it
reproduces identically on main 650c9ed, so it is pre-existing base drift and
the main-ledger owner fixes that row in a separate mission. The release
verify is unchanged and green: 44 probes pass, 0 skipped, 0 fail.

Verified: release verify 44/0/0 exit 0; main verify 316 pass / 2 skipped /
1 fail (MoonshotAI#5333, exit 1); upstream-ledger-release 19 pass; upstream-ledger-probes
29 pass; bun run lint 0 warnings 0 errors on 7000 files; ratchet 404 rules /
41807 findings / nothing new.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Dec 2, 2026
…flags port

M34 (merge f643d40) ported the server-driven two-tier experimental flag system, so MoonshotAI#5333's not-applicable probe absent:experimentalFeatures started failing on main: --verify reported 316 pass / 2 skipped / 1 fail.

The row is partial, not ported: the per-PR file-completeness gate counts 3 of 115 files never carried by this fork - two tests/e2e specs (the upstream Playwright suite this fork does not carry; MoonshotAI#5380 records the same) and tests/scenarios/prompt-cache.test.ts (added upstream by MoonshotAI#5474 and never carried here). 107 files are carried and 5 changesets are exempt. The landed half is the whole feature: app-core ServerMeta types and daemon mapping, the kap-server /meta wire, the app-client store writing profile buckets, and the desktop Lab UI. The flat-flag deviation PLAYBOOK:111 recorded is retired by that port.

The probe is the kap-server meta case asserting /meta reports experimental_beta and experimental_features with stage, effect_timing and source; approved_by is "M45 file-level audit". No changeset: ledger bookkeeping is not user-perceivable.

Verified: bun scripts/upstream-ledger.mjs --verify -> 317 probes pass, 2 skipped, 0 probe fail, 0 completeness fail; a second run leaves the ledger byte-identical (sha256 d0f17e07...). bun test --timeout 30000 scripts/test/upstream-ledger-probes.test.ts -> 29 pass / 0 fail. bun run lint and node scripts/checks/ratchet.mjs green. The branch is based on main 7e56303 and carries no spawn-snapshot WIP.
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