kimi-plugin-cc 2.4.3 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "Kimi for Claude Code: code questions, reviews, fixes, parallel tasks, and MCP tasks through the local Kimi Code CLI.",
8
- "version": "2.4.3"
8
+ "version": "2.4.4"
9
9
  },
10
10
  "plugins": [
11
11
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kimi",
3
3
  "description": "Kimi for Claude Code: code questions, independent reviews, bounded fixes, autonomous goals, parallel tasks, and MCP tasks through the local Kimi Code CLI, with PreToolUse safety hooks.",
4
- "version": "2.4.3",
4
+ "version": "2.4.4",
5
5
  "homepage": "https://github.com/linxule/kimi-plugin-cc",
6
6
  "repository": "https://github.com/linxule/kimi-plugin-cc",
7
7
  "license": "Apache-2.0",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  > **Post-1.0 release history (v1.0.1 -> present) lives in [ROADMAP-TO-GA.md § Post-GA audit log](./ROADMAP-TO-GA.md#post-ga-audit-log)** and the "Version" / "Upstream compat" lines of [AGENTS.md](./AGENTS.md). Docs-only kimi-code compat checkups that don't bump the plugin version (e.g. the 0.14.2 / 0.14.3 patches) are recorded there, not here. Notable releases are summarized below; the GA entry and full pre-GA detail follow.
4
4
 
5
+ ## 2.4.4 — 2026-10-29
6
+
7
+ - Certify exact kimi-code 2.4.0 for all eight native-v2 operations after exact-source review, revised plan and swarm controls, and candidate/production smoke. See [evidence](docs/upstream-2.4.0-certification.md).
8
+ - Adapt certification to removed EnterPlanMode and fresh-print default-plan cancellation without relaxing config, hook-deny, or journal-taint closures. Add only the reviewed 2.4.0 activation and hook-schema entries.
9
+ - Allow a bounded 15 seconds for graceful web shutdown after exact 2.4.0 exceeded the prior 5-second bound and exited cleanly in 6.743 seconds. Disable ambient idle-session reclamation for plugin-owned lifecycle processes. Preserve cleanup verification, process identity, durable recovery, workspace confinement, concurrency, and the legacy-v1 0.41.x boundary.
10
+ - Reject ignored sync-conflict copies during package validation so local generated debris cannot silently enter the npm archive.
11
+
5
12
  ## 2.4.3 — 2026-10-27
6
13
 
7
14
  - Certify exact kimi-code 2.3.3 for all eight native-v2 operations after exact-source review, plan and swarm controls, and candidate/production smoke. See [evidence](docs/upstream-2.3.3-certification.md).
package/README.md CHANGED
@@ -40,7 +40,7 @@ You need:
40
40
  - macOS or Linux
41
41
  - Claude Code or Codex with plugin support
42
42
  - Node.js 22.5 or newer
43
- - Kimi Code CLI 2.3.3 (certified; 2.3.2, 2.3.1 and 2.3.0 are also certified)
43
+ - Kimi Code CLI 2.4.0 (certified; 2.3.3, 2.3.2, 2.3.1 and 2.3.0 are also certified)
44
44
 
45
45
  Windows is not currently supported. Contributors can help with the [no-model Windows diagnostics checks](./docs/windows-validation.md). Check your versions in a terminal:
46
46
 
@@ -105,10 +105,10 @@ Codex. Published releases are also available as
105
105
  both compiled plugin distributions. No Bun, TypeScript, or install scripts are
106
106
  needed to use the package. Kimi Code CLI and Node are still prerequisites.
107
107
 
108
- For an explicitly versioned local Claude Code plugin, this example pins the 2.4.3 package:
108
+ For an explicitly versioned local Claude Code plugin, this example pins the 2.4.4 package:
109
109
 
110
110
  ```sh
111
- npm install --prefix ~/.local/share/kimi-plugin-cc kimi-plugin-cc@2.4.3
111
+ npm install --prefix ~/.local/share/kimi-plugin-cc kimi-plugin-cc@2.4.4
112
112
  claude --plugin-dir ~/.local/share/kimi-plugin-cc/node_modules/kimi-plugin-cc
113
113
  ```
114
114
 
@@ -228,7 +228,7 @@ All refusal codes and their remedies are listed in the [refusal-code catalog](./
228
228
 
229
229
  The tool rules for ask, review, challenge, and read-only swarm deny file writes and shell commands. Rescue and pursue can write files in your workspace. Swarm with `--write` works in a temporary Git worktree. It starts from your latest commit, so it does not include uncommitted changes. It returns a patch without applying it to your project.
230
230
 
231
- For swarm on CLI 2.3.2 and 2.3.3, the plugin briefly starts an authenticated loopback `kimi web` process to activate a session and another to deactivate swarm mode afterward; one ordinary `kimi -p -r` process still performs the task. Activation counts against the time limit, the access token stays in memory and out of logs, and cleanup failure prevents success. Older certified versions use `kimi -p` directly.
231
+ For swarm on CLI 2.3.2, 2.3.3 and 2.4.0, the plugin briefly starts an authenticated loopback `kimi web` process to activate a session and another to deactivate swarm mode afterward; one ordinary `kimi -p -r` process still performs the task. Activation counts against the time limit, the access token stays in memory and out of logs, and cleanup failure prevents success. Older certified versions use `kimi -p` directly.
232
232
 
233
233
  The plugin does not commit changes. Review changes before you keep or apply them.
234
234
 
@@ -264,7 +264,7 @@ Contributors need Bun to run `bun run check`. The detailed engineering documents
264
264
  - macOS 或 Linux
265
265
  - 支持插件的 Claude Code 或 Codex
266
266
  - Node.js 22.5 或更高版本
267
- - Kimi Code CLI 2.3.3(已认证;2.3.2、2.3.1 和 2.3.0 也已认证)
267
+ - Kimi Code CLI 2.4.0(已认证;2.3.3、2.3.2、2.3.1 和 2.3.0 也已认证)
268
268
 
269
269
  目前不支持 Windows。在终端检查版本:
270
270
 
@@ -427,7 +427,7 @@ codex plugin add kimi@kimi-marketplace
427
427
 
428
428
  Ask、review、challenge 和只读 swarm 的工具规则禁止写入文件和执行 shell 命令。Rescue 和 pursue 可以修改工作区内的文件。带 `--write` 的 swarm 在临时 Git 工作树中操作。它从最新提交开始,不包含尚未提交的修改。任务结束后返回补丁,不会自动应用到项目。
429
429
 
430
- 在 CLI 2.3.2 和 2.3.3 上运行 swarm 时,插件会短暂启动需要认证的本地回环 `kimi web` 进程来激活会话,并在结束后再次启动以停用 swarm 模式;任务本身仍由一个普通的 `kimi -p -r` 进程执行。激活计入任务时限,访问令牌只保存在内存且不会写入日志;无法确认清理完成时,任务不会报告成功。较早的已认证版本仍直接通过 `kimi -p` 运行。
430
+ 在 CLI 2.3.2、2.3.3 和 2.4.0 上运行 swarm 时,插件会短暂启动需要认证的本地回环 `kimi web` 进程来激活会话,并在结束后再次启动以停用 swarm 模式;任务本身仍由一个普通的 `kimi -p -r` 进程执行。激活计入任务时限,访问令牌只保存在内存且不会写入日志;无法确认清理完成时,任务不会报告成功。较早的已认证版本仍直接通过 `kimi -p` 运行。
431
431
 
432
432
  插件不会提交修改。保留或应用修改前,请先审查。
433
433
 
@@ -463,7 +463,7 @@ Il vous faut :
463
463
  - macOS ou Linux
464
464
  - une version de Claude Code ou de Codex prenant en charge les plugins
465
465
  - Node.js 22.5 ou une version ultérieure
466
- - Kimi Code CLI 2.3.3 (certifiée ; les versions 2.3.2, 2.3.1 et 2.3.0 sont également certifiées)
466
+ - Kimi Code CLI 2.4.0 (certifiée ; les versions 2.3.3, 2.3.2, 2.3.1 et 2.3.0 sont également certifiées)
467
467
 
468
468
  Windows n'est pas pris en charge actuellement. Vérifiez les versions dans un terminal :
469
469
 
@@ -626,7 +626,7 @@ Tous les codes de refus et leurs remèdes sont répertoriés dans le [catalogue
626
626
 
627
627
  Les règles des modes ask, review, challenge et swarm en lecture seule interdisent les écritures et les commandes shell. Rescue et pursue peuvent modifier les fichiers de votre espace de travail. Swarm avec `--write` travaille dans un worktree Git temporaire. Il part du dernier commit et n'inclut donc pas les modifications non commitées. Il renvoie un patch sans l'appliquer à votre projet.
628
628
 
629
- Avec le CLI 2.3.2 et 2.3.3, les tâches swarm lancent brièvement un processus `kimi web` authentifié sur l'interface de boucle locale pour activer la session, puis un second pour désactiver le mode swarm ; un seul processus `kimi -p -r` ordinaire exécute toujours la tâche. L'activation est comptée dans la limite de temps, le jeton reste en mémoire et hors des journaux, et l'échec du nettoyage empêche de déclarer la réussite. Les versions certifiées antérieures utilisent directement `kimi -p`.
629
+ Avec le CLI 2.3.2, 2.3.3 et 2.4.0, les tâches swarm lancent brièvement un processus `kimi web` authentifié sur l'interface de boucle locale pour activer la session, puis un second pour désactiver le mode swarm ; un seul processus `kimi -p -r` ordinaire exécute toujours la tâche. L'activation est comptée dans la limite de temps, le jeton reste en mémoire et hors des journaux, et l'échec du nettoyage empêche de déclarer la réussite. Les versions certifiées antérieures utilisent directement `kimi -p`.
630
630
 
631
631
  Le plugin ne crée aucun commit. Examinez les modifications avant de les conserver ou de les appliquer.
632
632
 
@@ -662,7 +662,7 @@ Les contributeurs ont besoin de Bun pour exécuter `bun run check`. La documenta
662
662
  - macOS または Linux
663
663
  - プラグインに対応した Claude Code または Codex
664
664
  - Node.js 22.5 以降
665
- - Kimi Code CLI 2.3.3(認証済み。2.3.2、2.3.1 と 2.3.0 も認証済み)
665
+ - Kimi Code CLI 2.4.0(認証済み。2.3.3、2.3.2、2.3.1 と 2.3.0 も認証済み)
666
666
 
667
667
  現在、Windows には対応していません。ターミナルでバージョンを確認します。
668
668
 
@@ -825,7 +825,7 @@ codex plugin add kimi@kimi-marketplace
825
825
 
826
826
  Ask、review、challenge、読み取り専用 swarm のツールルールでは、ファイルへの書き込みとシェルコマンドを禁止しています。Rescue と pursue はワークスペース内のファイルを変更できます。`--write` を指定した swarm は、一時的な Git ワークツリーで作業します。最新のコミットから開始するため、未コミットの変更は含まれません。パッチを返すだけで、プロジェクトには自動適用しません。
827
827
 
828
- CLI 2.3.2 / 2.3.3 の swarm では、セッションを有効化するため、そして終了後に swarm モードを無効化するため、認証付きのローカルループバック `kimi web` プロセスをそれぞれ短時間だけ起動します。タスク自体は従来どおり 1 つの `kimi -p -r` プロセスが実行します。有効化も制限時間に含まれ、トークンはメモリー内にのみ保持されてログには出ません。後処理を確認できない場合、タスクは成功と報告されません。以前の認証済みバージョンでは、引き続き `kimi -p` を直接使います。
828
+ CLI 2.3.2 / 2.3.3 / 2.4.0 の swarm では、セッションを有効化するため、そして終了後に swarm モードを無効化するため、認証付きのローカルループバック `kimi web` プロセスをそれぞれ短時間だけ起動します。タスク自体は従来どおり 1 つの `kimi -p -r` プロセスが実行します。有効化も制限時間に含まれ、トークンはメモリー内にのみ保持されてログには出ません。後処理を確認できない場合、タスクは成功と報告されません。以前の認証済みバージョンでは、引き続き `kimi -p` を直接使います。
829
829
 
830
830
  プラグインは変更をコミットしません。変更を残す、または適用する前に内容を確認してください。
831
831
 
@@ -814,6 +814,8 @@ export function buildKimiCliEnvironment(opts) {
814
814
  // The update preflight runs on the `-p` path too; a plugin spawn must never
815
815
  // swap the certified binary underneath the execution plan.
816
816
  env.KIMI_CODE_NO_AUTO_UPDATE = "1";
817
+ // Plugin-owned web lifecycles must not inherit ambient idle-session reclamation.
818
+ env.KIMI_CODE_SESSION_IDLE_RECLAIM_MS = "0";
817
819
  // Rescue and pursue share the write label. Only the immutable execution
818
820
  // plan can grant pursue's narrow goal-metadata access; never trust ambient
819
821
  // state inherited from another plugin job.
@@ -28,8 +28,8 @@ import { buildKimiSessionTitle, syncKimiSessionTitle } from "../session-title.js
28
28
  // only the wall-clock hard bound. Read/write modes reuse review/rescue lineage,
29
29
  // and the mandatory PreToolUse hook enforces read-only policy or trusted-worktree
30
30
  // write confinement on the coordinator and every subagent. Write mode requires
31
- // kimi-code 0.18.0+. Exact 2.3.2 and 2.3.3 additionally activates a same-job session through
32
- // a bounded loopback web lifecycle, then resumes it through the normal print path.
31
+ // kimi-code 0.18.0+. Exact 2.3.2, 2.3.3 and 2.4.0 additionally activate a same-job
32
+ // session through a bounded loopback web lifecycle, then resume it through the normal print path.
33
33
  const SWARM_SUMMARY_MAX = 120;
34
34
  const SWARM_AGENT_PROFILE = "<swarm>";
35
35
  const SWARM_WRITE_AGENT_PROFILE = "<swarm-write>";
@@ -594,9 +594,9 @@ function validateVersionSensitiveEvents(events, version) {
594
594
  }
595
595
  // Exact schemas reviewed at 2.0.0 (1b89e4b0), 2.0.1 (caf7d4e2),
596
596
  // 2.0.2 (9d07f634), 2.1.0 (52437299), 2.1.1 (f67e6398), 2.2.0 (472192c3),
597
- // 2.3.0 (b5e28fd6), 2.3.1 (684bae9e) 2.3.2 (b8dd3a13), and 2.3.3 (ec495f0c): the additive
598
- // events and HookDefSchema are unchanged. Require the full version string AND matching components;
599
- // no inferred 2.x compatibility.
597
+ // 2.3.0 (b5e28fd6), 2.3.1 (684bae9e), 2.3.2 (b8dd3a13), 2.3.3 (ec495f0c),
598
+ // and 2.4.0 (f26e4d91): the additive events and HookDefSchema are unchanged.
599
+ // Require the full version string AND matching components; no inferred 2.x compatibility.
600
600
  if (version.major === 2 && ((version.minor === 0 && ((version.version === "2.0.0" && version.patch === 0) ||
601
601
  (version.version === "2.0.1" && version.patch === 1) ||
602
602
  (version.version === "2.0.2" && version.patch === 2))) ||
@@ -606,7 +606,8 @@ function validateVersionSensitiveEvents(events, version) {
606
606
  (version.minor === 3 && ((version.version === "2.3.0" && version.patch === 0) ||
607
607
  (version.version === "2.3.1" && version.patch === 1) ||
608
608
  (version.version === "2.3.2" && version.patch === 2) ||
609
- (version.version === "2.3.3" && version.patch === 3))))) {
609
+ (version.version === "2.3.3" && version.patch === 3))) ||
610
+ (version.minor === 4 && ((version.version === "2.4.0" && version.patch === 0))))) {
610
611
  return { valid: true };
611
612
  }
612
613
  if (version.major !== 0) {
@@ -43,6 +43,7 @@ export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([
43
43
  "2.3.1",
44
44
  "2.3.2",
45
45
  "2.3.3",
46
+ "2.4.0",
46
47
  ]);
47
48
  /** Per-operation native-v2 certification. One green operation never certifies another. */
48
49
  export const NATIVE_V2_CERTIFIED = new Map([
@@ -9,10 +9,11 @@ import { assertExecutionPlanMatchesSpawn, assertNoUnsafeExperimentalSelector, }
9
9
  import { resolveKimiHome } from "./kimi-home.js";
10
10
  import { assertNativeV2Preflight } from "./native-v2-preflight.js";
11
11
  import { collectDescendantIdentities, collectProcessGroupsIdentities, probeProcessIdentity, revalidateProcessIdentities, waitForProcessTreeExit, } from "./process-tree.js";
12
- const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3"];
12
+ const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3", "2.4.0"];
13
13
  const READY_TIMEOUT_MS = 10_000;
14
14
  const REST_TIMEOUT_MS = 5_000;
15
- const SHUTDOWN_TIMEOUT_MS = 5_000;
15
+ // Exact 2.4.0 can take longer than 5s to drain session/workspace lifecycle work.
16
+ const SHUTDOWN_TIMEOUT_MS = 15_000;
16
17
  const JOURNAL_TIMEOUT_MS = 2_000;
17
18
  const JOURNAL_POLL_MS = 50;
18
19
  const READY_LINE_MAX_CHARS = 65_536;
package/dist/version.js CHANGED
@@ -4,4 +4,4 @@
4
4
  // and AGENTS.md on every release. A future improvement would read this from
5
5
  // package.json at build time, but that adds a build-step dependency we
6
6
  // don't want yet.
7
- export const KIMI_PLUGIN_CC_VERSION = "2.4.3";
7
+ export const KIMI_PLUGIN_CC_VERSION = "2.4.4";
package/docs/migration.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Compatibility and upgrades
2
2
 
3
- Plugin 2.4.1 certifies Kimi Code CLI 2.3.2 for all eight operations, alongside exact native-v2 versions `0.42.0`, `0.43.0`, `0.43.1`, `2.0.0`, `2.0.1`, `2.0.2`, `2.1.0`, `2.1.1`, `2.2.0`, `2.3.0`, and `2.3.1`. Later patches and minor releases are not accepted automatically. The npm distribution adds an installation channel; it does not change this compatibility table.
3
+ Plugin 2.4.4 certifies Kimi Code CLI 2.4.0 for all eight operations, alongside exact native-v2 versions `0.42.0`, `0.43.0`, `0.43.1`, `2.0.0`, `2.0.1`, `2.0.2`, `2.1.0`, `2.1.1`, `2.2.0`, `2.3.0`, `2.3.1`, `2.3.2`, and `2.3.3`. Later patches and minor releases are not accepted automatically. The npm distribution adds an installation channel; it does not change this compatibility table.
4
4
 
5
5
  Explicitly pinned legacy-v1 binaries remain supported within `KIMI_TESTED_MINORS`, through 0.41.x, subject to each operation's minimum version. The [runtime table](../runtime/kimi-engine.ts) is the authority.
6
6
 
@@ -8,17 +8,17 @@ Use the [README installation and update steps](../README.md) for Claude Code or
8
8
 
9
9
  ## Plugin versions and upgrades
10
10
 
11
- Plugin versions advance independently using ordinary SemVer and may deliberately align with a certified CLI release. Plugin 2.4.1 certifies exact CLI 2.3.2; the nearby numbers do not imply version alignment. Published versions and tags are never reused. Every upstream patch requires its own certification. The native-v2 no-plan profile, plugin/marketplace IDs and existing job store are preserved.
11
+ Plugin versions advance independently using ordinary SemVer and may deliberately align with a certified CLI release. Plugin 2.4.4 certifies exact CLI 2.4.0; the nearby numbers do not imply version alignment. Published versions and tags are never reused. Every upstream patch requires its own certification. The native-v2 no-plan profile, plugin/marketplace IDs and existing job store are preserved.
12
12
 
13
- ## CLI 2.3.2 swarm activation
13
+ ## CLI 2.3.2, 2.3.3 and 2.4.0 swarm activation
14
14
 
15
- Upstream 2.3.2 removes model self-activation of `AgentSwarm` in fresh print sessions. On that exact version only, swarm commands and MCP calls use the same `runSwarm` lifecycle:
15
+ Upstream 2.3.2 removes model self-activation of `AgentSwarm` in fresh print sessions. On exact 2.3.2, 2.3.3 and 2.4.0, swarm commands and MCP calls use the same `runSwarm` lifecycle:
16
16
 
17
- 1. A short-lived `web --no-open --host 127.0.0.1 --port 0 --log-level error` process uses authenticated loopback routes to verify the exact v2 server, choose the explicit or configured default model, create a session, bind the model and auto permission, enable and verify `swarm_mode`, and shut down.
17
+ 1. A short-lived `web --no-open --host 127.0.0.1 --port 0 --log-level error` process uses authenticated loopback routes to verify the exact v2 server, choose the explicit or configured default model, create a session, bind the model and auto permission, enable and verify `swarm_mode`, and shut down. The child environment sets `KIMI_CODE_SESSION_IDLE_RECLAIM_MS=0` to disable ambient idle-session reclamation.
18
18
  2. One ordinary `kimi -p -r` prompt runner resumes that session. Its recorded session-id source is `preactivated`, and the returned print session must match it.
19
19
  3. A second short-lived web lifecycle disables swarm mode, verifies status and the `swarm_mode.exit` journal record, and shuts down.
20
20
 
21
- Activation is inside the job's finite budget. `runSwarm` solely owns deactivation: normal cleanup uses the remaining budget, while failure recovery has a separate two-second cancellation-aware bound and is never retried. Print/session failures stay primary. The ready token stays in memory and out of logs, and success cannot complete if cleanup fails. Post-mutation identity or process/group uncertainty preserves diagnostics and, for write-swarm, the recovery worktree. Process groups are rechecked after teardown; unknown survivors are unverified and unproven groups are not signalled. Older certified versions still launch swarm directly with `kimi -p`. This narrow lifecycle is not a full RPC transport or a model-driven activation workaround; the managed hook and workspace boundaries still govern every tool call.
21
+ Activation is inside the job's finite budget. Graceful process close has a bounded 15-second allowance. `runSwarm` solely owns deactivation: normal cleanup uses the remaining budget, while failure recovery has a separate two-second cancellation-aware bound and is never retried. Print/session failures stay primary. The ready token stays in memory and out of logs, and success cannot complete if cleanup fails. Post-mutation identity or process/group uncertainty preserves diagnostics and, for write-swarm, the recovery worktree. Process groups are rechecked after teardown; unknown survivors are unverified and unproven groups are not signalled. Older certified versions still launch swarm directly with `kimi -p`. This narrow lifecycle is not a full RPC transport or a model-driven activation workaround; the managed hook and workspace boundaries still govern every tool call.
22
22
 
23
23
  After updating the plugin, run Claude Code `/kimi:setup` or Codex `$kimi-setup`
24
24
  from that host's active install to re-pin its version-stamped hook path, then
@@ -6,9 +6,9 @@ remain available. The package has no install scripts and no separate CLI.
6
6
 
7
7
  ## Publishing status
8
8
 
9
- Plugin **2.4.3** adds exact CLI **2.3.3** certification for all eight operations,
9
+ Plugin **2.4.4** adds exact CLI **2.4.0** certification for all eight operations,
10
10
  with the existing host-preactivated swarm lifecycle and durable recovery.
11
- See the [certification record](./upstream-2.3.3-certification.md).
11
+ See the [certification record](./upstream-2.4.0-certification.md).
12
12
  Release execution and registry verification are recorded in the release notes;
13
13
  publication uses the same validated-tarball OIDC workflow below.
14
14
 
@@ -93,11 +93,12 @@ bun run check
93
93
  bun run check:package .tmp/npm
94
94
  ```
95
95
 
96
- The package check inspects the actual tarball, verifies runtime copies and
97
- vendored licenses, and installs/checks the safety hook in isolated homes for
98
- both hosts. It also exercises unsupported-version refusal using a fake CLI and
99
- modern MCP discovery plus legacy initialization on both extracted compiled
100
- distributions. It does not invoke a model or read the maintainer's Kimi configuration.
96
+ The package check inspects the actual tarball, rejects sync-conflict copies in
97
+ any path component, verifies runtime copies and vendored licenses, and
98
+ installs/checks the safety hook in isolated homes for both hosts. It also
99
+ exercises unsupported-version refusal using a fake CLI and modern MCP discovery
100
+ plus legacy initialization on both extracted compiled distributions. It does
101
+ not invoke a model or read the maintainer's Kimi configuration.
101
102
 
102
103
  ## First publication (completed bootstrap reference)
103
104
 
package/docs/safety.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This guide describes the current checkout runtime. Read-only tasks deny file writes and shell commands. Rescue and pursue can edit your workspace. Write-swarm returns a patch from a temporary Git worktree.
4
4
 
5
- Native agent-core-v2 is certified at exact CLI versions `0.42.0`, `0.43.0`, `0.43.1`, `2.0.0`, `2.0.1`, `2.0.2`, `2.1.0`, `2.1.1`, `2.2.0`, `2.3.0`, `2.3.1`, `2.3.2`, and `2.3.3`, with plan mode disabled. The [runtime certification table](../runtime/kimi-engine.ts) controls routing. The hook is not an operating-system sandbox.
5
+ Native agent-core-v2 is certified at exact CLI versions `0.42.0`, `0.43.0`, `0.43.1`, `2.0.0`, `2.0.1`, `2.0.2`, `2.1.0`, `2.1.1`, `2.2.0`, `2.3.0`, `2.3.1`, `2.3.2`, `2.3.3`, and `2.4.0`, with plan mode disabled. The [runtime certification table](../runtime/kimi-engine.ts) controls routing. The hook is not an operating-system sandbox.
6
6
 
7
7
  ## Why the safety story is hook-based
8
8
 
@@ -205,15 +205,15 @@ If another installed host still points to an older hook, that hook may veto thes
205
205
  - **Resume is intentionally not exposed yet.** In goal mode `goal.summary` emits a *goalId* distinct from the resume-hint *sessionId*; `kimi -r <sessionId>` re-enters the session but not necessarily the goal continuation. The plugin captures and surfaces the goalId but does not offer `--resume` for pursue until that split is reconciled upstream — exposing it now would be a silent-failure trap. **Re-verified against kimi-code 0.26.0 (2026-07-16):** the headless CLI still has no argv, prompt syntax, or session-resume path that calls `resumeGoal()`. `parseHeadlessGoalCreate` (`apps/kimi-code/src/cli/goal-prompt.ts`) accepts only the `/goal <objective>` *create* shape on both the v1 and experimental-v2 drivers, and upstream's own docs (`docs/en/guides/goals.md`, § "Use goal mode carefully") state that in non-interactive prompt mode *only goal creation is supported* — goal management is a TUI/kimi-web control. PR #552 makes a plain `-r <sessionId>` correctly *restore* the paused goal snapshot, but nothing in the headless path *acts* on it; the real `resumeGoal()` is wired only to the TUI (`/goal resume`) and kimi-web RPC (PR #1693, web-only). Implementing `--resume` would therefore require either prompt-injected model compliance (rejected — the plugin bounds autonomy with hard limits, not model goodwill) or abandoning the subprocess model for kimi-web's RPC. Re-check if upstream ever ships a headless `goal resume` verb.
206
206
  - **A model-invocable `kimi-pursue` agent (v1.3) wraps this command.** The main thread can dispatch autonomous goal mode, not just the human-typed `/kimi:pursue` — the same command↔agent mirror as rescue/review/swarm. Auto-dispatch does NOT widen the blast radius: pursue runs under `commandLabel: "rescue"`, so the managed PreToolUse hook + workspace allowlist gate every tool call on every continuation turn (no git mutation), and the mandatory `--budget` wall-clock ceiling bounds the autonomy regardless of who launched it. Because it is write-capable AND autonomous — the plugin's highest blast radius — the agent's description requires an explicit user request for hands-off multi-turn pursuit, steers single bounded tasks to `kimi-rescue`, and never auto-promotes a fix or a question into a goal loop. Like the command, it refuses without the hook and offers no `--resume`.
207
207
 
208
- ## Swarm activation on CLI 2.3.2 and 2.3.3
208
+ ## Swarm activation on CLI 2.3.2, 2.3.3 and 2.4.0
209
209
 
210
210
  For interrupted runs, see [durable recovery and its explicit limits](swarm-recovery.md).
211
211
 
212
212
  Upstream 2.3.2 removes model self-activation of `AgentSwarm` in fresh print sessions. A rejected call can therefore coexist with zero child journals and a successful exit; a tool-call record, aggregate denial, or coordinator-produced patch does not prove fan-out. The plugin does not use prompt workarounds or replace its print transport with general RPC.
213
213
 
214
- For versions requiring activation (currently exact 2.3.2 and 2.3.3), both slash-command and MCP swarm operations use the same `runSwarm` implementation and one ordinary `kimi -p -r` prompt runner per job, bracketed by short-lived host-managed web lifecycles:
214
+ For versions requiring activation (currently exact 2.3.2, 2.3.3 and 2.4.0), both slash-command and MCP swarm operations use the same `runSwarm` implementation and one ordinary `kimi -p -r` prompt runner per job, bracketed by short-lived host-managed web lifecycles:
215
215
 
216
- 1. The exact planned CLI starts `web --no-open --host 127.0.0.1 --port 0 --log-level error`. The plugin accepts only the expected loopback ready URL, uses a supplied token for authenticated REST requests, and keeps that token in memory, never writing it to logs. `/api/v1/meta` must confirm backend v2, the exact planned version, and no dangerous authentication bypass. The plugin uses the explicit model or environment-model alias, otherwise reading the default alias from `/api/v1/config`; creates a session in the job cwd; binds that model with `permission_mode:auto` and `swarm_mode:true`; verifies those settings and `plan_mode:false` through `/status`; verifies clean shutdown; and requires the main journal's manual `swarm_mode.enter` record.
216
+ 1. The exact planned CLI starts `web --no-open --host 127.0.0.1 --port 0 --log-level error`. The child environment sets `KIMI_CODE_SESSION_IDLE_RECLAIM_MS=0`, so ambient idle-session reclamation cannot disrupt the plugin-owned lifecycle. The plugin accepts only the expected loopback ready URL, uses a supplied token for authenticated REST requests, and keeps that token in memory, never writing it to logs. `/api/v1/meta` must confirm backend v2, the exact planned version, and no dangerous authentication bypass. The plugin uses the explicit model or environment-model alias, otherwise reading the default alias from `/api/v1/config`; creates a session in the job cwd; binds that model with `permission_mode:auto` and `swarm_mode:true`; verifies those settings and `plan_mode:false` through `/status`; verifies clean shutdown; and requires the main journal's manual `swarm_mode.enter` record.
217
217
  2. The ordinary stream-json print runner resumes that session with `kimi -p -r`. The job records `kimi_session_id_source:"preactivated"`, and the session returned by print must exactly match the preactivated id. Every coordinator and child tool call remains governed by the same managed PreToolUse hook and operation allowlist.
218
218
  3. After the print run, a second web lifecycle sets `swarm_mode:false`, verifies `/status`, shuts down cleanly, and requires `swarm_mode.exit` in the main journal. Activation consumes part of the same finite job budget rather than extending it. `runSwarm` solely owns session deactivation: normal cleanup uses the remaining budget, while failure recovery has a separate two-second cancellation-aware bound and is never retried. Print/session failures stay primary, with exit codes and cleanup diagnostics preserved. Cancellation aborts the owned lifecycle and never starts a fresh cleanup server. Every post-mutation failure retains the session identity; process/group uncertainty is marked without inventing an ID; process groups are rechecked after teardown, unknown survivors are unverified, unproven groups are never signalled, and a same-PID/start-token process that changes PGID remains active but is not a validated signal target. Root loss requires a previously observed matching identity; first-missing roots and actual probe errors/timeouts remain unverified. Reparenting and PGID moves preserve the current verified child identity for revalidation rather than treating it as exited. Unverified cleanup prevents success and preserves raw output, structured diagnostics, and the write worktree for recovery.
219
219
 
@@ -224,7 +224,7 @@ Older certified versions keep the direct `kimi -p` path. The web processes are n
224
224
  `/kimi:swarm` (v1.2) fans a **read-only** review out across subagents using kimi-code's `AgentSwarm` tool (kimi-code 0.12.0+). The coordinator launches one subagent per target (file/module/question); each inspects the workspace with read tools and reports findings, which the coordinator consolidates into one markdown report. It opens **zero new write surface**.
225
225
 
226
226
  - **The hook label is `swarm`, and it allows the read-only tool set PLUS `AgentSwarm`.** The coordinator must be allowed to call `AgentSwarm` (else the swarm never launches), but no write/edit/shell tool is allowed. The exact allowed tool name is `AgentSwarm` (verified at 0.42.0 against `packages/agent-core-v2/src/features/swarm/tools/agent-swarm/agentSwarmTool.ts`: `'AgentSwarm'`, strict schema). The singular `Agent` tool is deliberately *not* allowed — swarm is the fan-out surface, not arbitrary delegation.
227
- - **Every subagent inherits the `swarm` label and fires the same hook.** On native v2 (0.42.0) `AgentSwarm` children run in-process in a child DI scope with their OWN eager external-hooks service, so every child tool call passes the same before-execute channel and the same managed hook — there is no sub-vs-main branch and no deny-all shortcut on the swarm route. So a subagent's `Write`/`Edit`/`Bash` is denied exactly like a single-turn review's. The swarm listener in that channel is non-terminal and nothing auto-approves `AgentSwarm` ahead of the hook. (Legacy-v1 ≤ 0.41 reached the same result by placing the hook policy at index 0 of every agent's permission stack.) **Required for final certification evidence** (`tests/runtime/real-binary-smoke.test.ts`, run via `bun run smoke:real`): distinct child journals must exist, and each assigned Write/Edit `path` must be correlated through its `toolCallId` with the managed denial in that exact tool result; unrelated denials and coordinator-only reports are insufficient. On 2.3.2 and 2.3.3, targeted controls also prove that direct OFF produces no children while the preactivated ON path produces the real child journals and denials.
227
+ - **Every subagent inherits the `swarm` label and fires the same hook.** On native v2 (0.42.0) `AgentSwarm` children run in-process in a child DI scope with their OWN eager external-hooks service, so every child tool call passes the same before-execute channel and the same managed hook — there is no sub-vs-main branch and no deny-all shortcut on the swarm route. So a subagent's `Write`/`Edit`/`Bash` is denied exactly like a single-turn review's. The swarm listener in that channel is non-terminal and nothing auto-approves `AgentSwarm` ahead of the hook. (Legacy-v1 ≤ 0.41 reached the same result by placing the hook policy at index 0 of every agent's permission stack.) **Required for final certification evidence** (`tests/runtime/real-binary-smoke.test.ts`, run via `bun run smoke:real`): distinct child journals must exist, and each assigned Write/Edit `path` must be correlated through its `toolCallId` with the managed denial in that exact tool result; unrelated denials and coordinator-only reports are insufficient. On 2.3.2, 2.3.3 and 2.4.0, targeted controls also prove that direct OFF produces no children while the preactivated ON path produces the real child journals and denials.
228
228
  - **The managed hook is the read-only boundary; no `explore`-profile second layer is assumed.** Production deliberately omits `subagent_type` for read-only swarm rather than selecting kimi-code's `explore` profile. Every coordinator and subagent tool call is enforced by the same managed hook.
229
229
  - **Swarm refuses without the hook, like every model-spawning command.** A swarm makes the reason especially acute: it asks for up to `--cap` subagents, but this total-count hint is advisory, so a missing hook would remove enforcement from all of them at once. `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK=1` remains an explicit tests/diagnostics escape hatch, not a recovery path.
230
230
  - **The only new risk is COST, and the plugin bounds it.** Read-only swarm writes nothing, so the new risk is runaway cost from N parallel model runs (and possible nested `AgentSwarm`). `/kimi:swarm` enforces a **mandatory finite wall-clock ceiling** via its AbortController (`--budget`, default 30m); the SIGTERM→SIGKILL descendant-reaping cancellation reaps the whole subagent process tree. Two **distinct** subagent bounds: `--cap N` is a *soft* prompt-injected hint on TOTAL subagent count (the hook is stateless and cannot enforce a count, so the model may exceed it), and `--max-concurrency N` is a *hard* ceiling on how many subagents kimi-code's `SubagentBatch` runs concurrently — exported as `KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY` (PR #888) on **kimi-code 0.18.0+** (older binaries ignore the unknown env var, so on < 0.18 only the soft hint applies). It **defaults to 4** when the user passes none (`resolveSwarmMaxConcurrency` in swarm.ts), so every swarm run — agent-dispatched or human-typed — carries an enforced peak-parallelism ceiling on 0.18.0+ rather than falling back to kimi-code's internal ramp; pass an explicit value to widen or throttle. **Never merge them into one flag:** concurrency ≠ total count — a hard concurrency cap of N still permits more than N subagents over the life of the run, just never more than N at once. The `--budget` bounds elapsed time, not a dollar amount or total token count; `--max-concurrency` bounds *peak* parallelism (the spike in simultaneous model spend), and `--cap` is only an advisory total-count nudge. Folding both onto one flag would create the "cap-as-total-count illusion" — a user reading `--cap N` would expect a total bound but receive only a peak-parallelism one.
@@ -293,9 +293,9 @@ at it (the runtime resolves that path instead of `kimi` on `PATH`; every spawn
293
293
  still exports `KIMI_CODE_NO_AUTO_UPDATE=1`, so the pinned copy never drifts).
294
294
 
295
295
  ```sh
296
- PIN=~/.local/share/kimi-plugin-cc/kimi-bin/2.3.3
296
+ PIN=~/.local/share/kimi-plugin-cc/kimi-bin/2.4.0
297
297
  mkdir -p "$PIN" && cd "$PIN" && printf '{"name":"kimi-plugin-cc-pin","private":true}\n' > package.json
298
- npm install @moonshot-ai/kimi-code@2.3.3
298
+ npm install @moonshot-ai/kimi-code@2.4.0
299
299
  export KIMI_PLUGIN_CC_KIMI_BIN="$PIN/node_modules/.bin/kimi" # e.g. in ~/.zshenv
300
300
  ```
301
301
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Normal stop: use `scripts/companion.sh cancel` for a shell-owned run, or the MCP job cancel tool for an MCP-owned run. A hard kill cannot execute cleanup. Cancellation still starts no fresh cleanup server.
4
4
 
5
- For exact CLI 2.3.2 and 2.3.3 swarm runs created by this runtime, status includes a durable `swarm_recovery` record. It contains the resolved home/workspace, companion identity, launch intent, verified process identities and session identity. It never contains the web authentication token, credentials, prompt or config contents. Session identity is committed before the request enabling swarm mode.
5
+ For exact CLI 2.3.2, 2.3.3 and 2.4.0 swarm runs created by this runtime, status includes a durable `swarm_recovery` record. It contains the resolved home/workspace, companion identity, launch intent, verified process identities and session identity. It never contains the web authentication token, credentials, prompt or config contents. Session identity is committed before the request enabling swarm mode.
6
6
 
7
7
  ## Preview, then recover
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kimi-plugin-cc",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "Kimi for Claude Code and Codex: code questions, independent reviews, bounded fixes, autonomous goals, parallel tasks, and MCP tools through the local Kimi Code CLI.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kimi",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "Kimi for Codex: code questions, independent reviews, bounded fixes, autonomous goals, parallel tasks, and MCP job controls through the local Kimi Code CLI.",
5
5
  "author": {
6
6
  "name": "linxule"
@@ -814,6 +814,8 @@ export function buildKimiCliEnvironment(opts) {
814
814
  // The update preflight runs on the `-p` path too; a plugin spawn must never
815
815
  // swap the certified binary underneath the execution plan.
816
816
  env.KIMI_CODE_NO_AUTO_UPDATE = "1";
817
+ // Plugin-owned web lifecycles must not inherit ambient idle-session reclamation.
818
+ env.KIMI_CODE_SESSION_IDLE_RECLAIM_MS = "0";
817
819
  // Rescue and pursue share the write label. Only the immutable execution
818
820
  // plan can grant pursue's narrow goal-metadata access; never trust ambient
819
821
  // state inherited from another plugin job.
@@ -28,8 +28,8 @@ import { buildKimiSessionTitle, syncKimiSessionTitle } from "../session-title.js
28
28
  // only the wall-clock hard bound. Read/write modes reuse review/rescue lineage,
29
29
  // and the mandatory PreToolUse hook enforces read-only policy or trusted-worktree
30
30
  // write confinement on the coordinator and every subagent. Write mode requires
31
- // kimi-code 0.18.0+. Exact 2.3.2 and 2.3.3 additionally activates a same-job session through
32
- // a bounded loopback web lifecycle, then resumes it through the normal print path.
31
+ // kimi-code 0.18.0+. Exact 2.3.2, 2.3.3 and 2.4.0 additionally activate a same-job
32
+ // session through a bounded loopback web lifecycle, then resume it through the normal print path.
33
33
  const SWARM_SUMMARY_MAX = 120;
34
34
  const SWARM_AGENT_PROFILE = "<swarm>";
35
35
  const SWARM_WRITE_AGENT_PROFILE = "<swarm-write>";
@@ -594,9 +594,9 @@ function validateVersionSensitiveEvents(events, version) {
594
594
  }
595
595
  // Exact schemas reviewed at 2.0.0 (1b89e4b0), 2.0.1 (caf7d4e2),
596
596
  // 2.0.2 (9d07f634), 2.1.0 (52437299), 2.1.1 (f67e6398), 2.2.0 (472192c3),
597
- // 2.3.0 (b5e28fd6), 2.3.1 (684bae9e) 2.3.2 (b8dd3a13), and 2.3.3 (ec495f0c): the additive
598
- // events and HookDefSchema are unchanged. Require the full version string AND matching components;
599
- // no inferred 2.x compatibility.
597
+ // 2.3.0 (b5e28fd6), 2.3.1 (684bae9e), 2.3.2 (b8dd3a13), 2.3.3 (ec495f0c),
598
+ // and 2.4.0 (f26e4d91): the additive events and HookDefSchema are unchanged.
599
+ // Require the full version string AND matching components; no inferred 2.x compatibility.
600
600
  if (version.major === 2 && ((version.minor === 0 && ((version.version === "2.0.0" && version.patch === 0) ||
601
601
  (version.version === "2.0.1" && version.patch === 1) ||
602
602
  (version.version === "2.0.2" && version.patch === 2))) ||
@@ -606,7 +606,8 @@ function validateVersionSensitiveEvents(events, version) {
606
606
  (version.minor === 3 && ((version.version === "2.3.0" && version.patch === 0) ||
607
607
  (version.version === "2.3.1" && version.patch === 1) ||
608
608
  (version.version === "2.3.2" && version.patch === 2) ||
609
- (version.version === "2.3.3" && version.patch === 3))))) {
609
+ (version.version === "2.3.3" && version.patch === 3))) ||
610
+ (version.minor === 4 && ((version.version === "2.4.0" && version.patch === 0))))) {
610
611
  return { valid: true };
611
612
  }
612
613
  if (version.major !== 0) {
@@ -43,6 +43,7 @@ export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([
43
43
  "2.3.1",
44
44
  "2.3.2",
45
45
  "2.3.3",
46
+ "2.4.0",
46
47
  ]);
47
48
  /** Per-operation native-v2 certification. One green operation never certifies another. */
48
49
  export const NATIVE_V2_CERTIFIED = new Map([
@@ -9,10 +9,11 @@ import { assertExecutionPlanMatchesSpawn, assertNoUnsafeExperimentalSelector, }
9
9
  import { resolveKimiHome } from "./kimi-home.js";
10
10
  import { assertNativeV2Preflight } from "./native-v2-preflight.js";
11
11
  import { collectDescendantIdentities, collectProcessGroupsIdentities, probeProcessIdentity, revalidateProcessIdentities, waitForProcessTreeExit, } from "./process-tree.js";
12
- const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3"];
12
+ const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3", "2.4.0"];
13
13
  const READY_TIMEOUT_MS = 10_000;
14
14
  const REST_TIMEOUT_MS = 5_000;
15
- const SHUTDOWN_TIMEOUT_MS = 5_000;
15
+ // Exact 2.4.0 can take longer than 5s to drain session/workspace lifecycle work.
16
+ const SHUTDOWN_TIMEOUT_MS = 15_000;
16
17
  const JOURNAL_TIMEOUT_MS = 2_000;
17
18
  const JOURNAL_POLL_MS = 50;
18
19
  const READY_LINE_MAX_CHARS = 65_536;
@@ -4,4 +4,4 @@
4
4
  // and AGENTS.md on every release. A future improvement would read this from
5
5
  // package.json at build time, but that adds a build-step dependency we
6
6
  // don't want yet.
7
- export const KIMI_PLUGIN_CC_VERSION = "2.4.3";
7
+ export const KIMI_PLUGIN_CC_VERSION = "2.4.4";