kimi-plugin-cc 2.5.6 → 2.5.8
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +17 -0
- package/README.md +8 -8
- package/agents/kimi-swarm-write.md +3 -3
- package/agents/kimi-swarm.md +3 -3
- package/commands/swarm.md +2 -2
- package/dist/cli-client.js +3 -3
- package/dist/commands/recover-swarm.js +2 -1
- package/dist/commands/setup.js +7 -7
- package/dist/commands/swarm.js +40 -33
- package/dist/hooks/config-safety.js +7 -4
- package/dist/kimi-engine.js +46 -12
- package/dist/mcp/operations.js +1 -1
- package/dist/session-recovery.js +3 -1
- package/dist/stream-json.js +2 -2
- package/dist/swarm-activation.js +73 -32
- package/dist/version.js +1 -1
- package/docs/migration.md +6 -6
- package/docs/registry-releases.md +3 -1
- package/docs/safety.md +19 -16
- package/docs/swarm-recovery.md +4 -2
- package/docs/upstream-2.5.3-certification.md +73 -0
- package/docs/upstream-2.6.0-certification.md +52 -0
- package/package.json +3 -1
- package/plugins/kimi-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/kimi-codex/dist/cli-client.js +3 -3
- package/plugins/kimi-codex/dist/commands/recover-swarm.js +2 -1
- package/plugins/kimi-codex/dist/commands/setup.js +7 -7
- package/plugins/kimi-codex/dist/commands/swarm.js +40 -33
- package/plugins/kimi-codex/dist/hooks/config-safety.js +7 -4
- package/plugins/kimi-codex/dist/kimi-engine.js +46 -12
- package/plugins/kimi-codex/dist/mcp/operations.js +1 -1
- package/plugins/kimi-codex/dist/session-recovery.js +3 -1
- package/plugins/kimi-codex/dist/stream-json.js +2 -2
- package/plugins/kimi-codex/dist/swarm-activation.js +73 -32
- package/plugins/kimi-codex/dist/version.js +1 -1
- package/plugins/kimi-dsh/dist/cli-client.js +3 -3
- package/plugins/kimi-dsh/dist/commands/recover-swarm.js +2 -1
- package/plugins/kimi-dsh/dist/commands/setup.js +7 -7
- package/plugins/kimi-dsh/dist/commands/swarm.js +40 -33
- package/plugins/kimi-dsh/dist/hooks/config-safety.js +7 -4
- package/plugins/kimi-dsh/dist/kimi-engine.js +46 -12
- package/plugins/kimi-dsh/dist/mcp/operations.js +1 -1
- package/plugins/kimi-dsh/dist/session-recovery.js +3 -1
- package/plugins/kimi-dsh/dist/stream-json.js +2 -2
- package/plugins/kimi-dsh/dist/swarm-activation.js +73 -32
- package/plugins/kimi-dsh/dist/version.js +1 -1
- package/plugins/kimi-dsh/package.json +1 -1
|
@@ -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.5.
|
|
4
|
+
"version": "2.5.8",
|
|
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,23 @@
|
|
|
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.5.8 — 2026-11-13
|
|
6
|
+
|
|
7
|
+
- Certify exact kimi-code 2.6.0 for review, challenge, ask, rescue, review_gate and pursue only. Both swarm operations refuse before model spawn with `v2-swarm-not-certified`, including at the persisted-plan boundary; neither falls back to legacy-v1. Setup reports the narrowed scope. Exact 2.6.1 and full swarm certification remain uncertified. See the [2.6.0 non-swarm evidence](docs/upstream-2.6.0-certification.md).
|
|
8
|
+
- Preserve `NATIVE_V2_CERTIFIED_VERSIONS` as the all-operation export for automatic full-swarm pins, and add `NATIVE_V2_ANY_OPERATION_VERSIONS` for the scoped union. Existing full-swarm pin selection therefore does not move silently to non-swarm-only 2.6.0; choose that CLI explicitly for non-swarm use.
|
|
9
|
+
- Integrate the reviewed 2.6.0 executor, direct-subscription, local-environment, goal-journal and canonical execution-root changes. Preserve the no-plan construction and recovery safeguards. Candidate swarm activation and recovery remain outside production scope on 2.6.0.
|
|
10
|
+
- Pass the exact 2.6.0 source scan (19 tests / 225 assertions), 2.5.3 regression (153 assertions), full-scope candidate matrix (24 tests / 201 assertions / no skips), and narrowed production matrix (**23 tests / 170 assertions in 241.67 seconds**). The only three production skips are explicitly excluded swarm execution lanes; both real swarm command paths prove pre-spawn refusal with no model session, retained worktree, or user-tree change.
|
|
11
|
+
- Pass the definitive isolated full repository gate with **1,472 tests, 36 expected skips and 19,530 assertions in 402.26 seconds**, including generated-surface and drift checks with frozen dependencies. A five-second setup fixture timeout was raised to 30 seconds after its unchanged behavior passed in isolation; every assertion was preserved. Validate 333 package files across all three distributions, patched DSH host/profile with seven providers/tools and Web boot, and isolated npm consumer security. Independent reviews and publication receipts are recorded in the certification record.
|
|
12
|
+
- Preserve the upstream follow-up for the rate-limit recovery cap defect rather than waiving it. Full swarm certification still ends at 2.5.3 with its inherited limitation disclosed; restoration requires an exact upstream release containing the scheduler correction and fresh full-scope evidence. Publication does not update installed hosts or operator pins.
|
|
13
|
+
|
|
14
|
+
## 2.5.7 — 2026-11-11
|
|
15
|
+
|
|
16
|
+
- Certify exact kimi-code 2.5.3 for all eight native-v2 operations, alongside 2.5.0, 2.5.1 and 2.5.2. All 40 load-bearing source files are unchanged from 2.5.2; steering/transcript, agent-loop, MCP startup and Windows spawn changes preserve the single before-execute gate and no-plan construction. See the [2.5.3 evidence](docs/upstream-2.5.3-certification.md).
|
|
17
|
+
- Extend every exact-version branch to 2.5.3: production table, swarm preactivation/local binding and protocol-v2 agent state, fresh `--environment local`, and the reviewed hook schema. Prerelease/build-suffixed versions and 2.5.4 remain refused. The manual smoke workflow now defaults to 2.5.3.
|
|
18
|
+
- Make resume and goal controls deterministic with loopback providers, exact fresh/resumed/goal call IDs, per-turn managed denials, compaction handling, and smoke-only objective-digest store recovery. Both candidate and production matrices pass 24 tests with 201 assertions in 349.07 and 406.19 seconds, including real rescue/Bash.cwd confinement, resume/taint refusal, child-authored patches, and out-of-root denial.
|
|
19
|
+
- Repair the operator-local certification wrapper with a Kimi-only, mode-0600 credential mapping and literal environment-based redaction, so an unrelated missing shared-vault item cannot block certification. This wrapper is not shipped in the plugin. Publication does not update installed hosts or operator pins.
|
|
20
|
+
- Pass the exact-tag scan on 2.5.3 and the 2.5.2 regression tree (18 tests, 153 assertions each), sequential exact-binary controls, candidate and production matrices (24 tests, 201 assertions each, no skips), the corrected-tree full repository gate with 1,437 tests and 18,980 assertions in 396.30 seconds, and 332-file package checks across all three distributions with isolated consumer security.
|
|
21
|
+
|
|
5
22
|
## 2.5.6 — 2026-11-07
|
|
6
23
|
|
|
7
24
|
- Certify exact kimi-code 2.5.2 for all eight native-v2 operations, alongside 2.5.0 and 2.5.1. Upstream 2.5.2 changes only MCP pending-tool registration, tool-select reconciliation and tool-contract signature helpers; all seven audit scopes and all 40 pinned files are unchanged from 2.5.1, and pending replacements never resolve for execution. See the [2.5.2 evidence](docs/upstream-2.5.2-certification.md).
|
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ You need:
|
|
|
40
40
|
- macOS or Linux
|
|
41
41
|
- Claude Code, Codex, or DSH with plugin support
|
|
42
42
|
- Node.js 22.5 or newer (24.9 or newer for DSH)
|
|
43
|
-
- Kimi Code CLI 2.
|
|
43
|
+
- Kimi Code CLI 2.6.0 for review, challenge, ask, rescue, review gate, or pursue. Both swarm modes refuse on 2.6.0; full eight-operation certification ends at 2.5.3, with the [documented rate-limit limitation](./docs/safety.md). Other exact certified versions remain supported per the [runtime matrix](./docs/native-v2-certification-provenance.md).
|
|
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
|
|
|
@@ -238,7 +238,7 @@ Remove the app's hook before removing its plugin. In Claude Code, run `/kimi:set
|
|
|
238
238
|
|
|
239
239
|
If a hook check fails, follow its diagnosis. Run setup for the affected app when instructed. Do not bypass the check.
|
|
240
240
|
|
|
241
|
-
If you see `KIMI_CAPABILITY_NOT_CERTIFIED`, update the plugin or
|
|
241
|
+
If you see `KIMI_CAPABILITY_NOT_CERTIFIED`, update the plugin or select a CLI certified for the requested operation. On 2.6.0, use the six non-swarm operations; swarm requires a CLI version certified for that operation, not merely a release listed for another operation. Running setup again does not certify a new CLI or expand its operation scope.
|
|
242
242
|
|
|
243
243
|
If you see `CLI_V2_PLAN_MODE_CONFIGURED`, set `default_plan_mode` to `false` or remove it from your Kimi `config.toml` file. Sessions run by this plugin cannot use plan mode.
|
|
244
244
|
|
|
@@ -284,7 +284,7 @@ Contributors need Bun to run `bun run check`. The detailed engineering documents
|
|
|
284
284
|
- macOS 或 Linux
|
|
285
285
|
- 支持插件的 Claude Code、Codex 或 DSH
|
|
286
286
|
- Node.js 22.5 或更高版本(DSH 需要 24.9 或更高版本)
|
|
287
|
-
- Kimi Code CLI 2.
|
|
287
|
+
- Kimi Code CLI 2.6.0(仅限 review、challenge、ask、rescue、review gate 和 pursue;两种 swarm 模式均会拒绝运行。完整八项操作认证止于 2.5.3,并有已披露的速率限制恢复缺陷。其他精确认证版本见[运行时矩阵](./docs/native-v2-certification-provenance.md))
|
|
288
288
|
|
|
289
289
|
目前不支持 Windows。在终端检查版本:
|
|
290
290
|
|
|
@@ -455,7 +455,7 @@ codex plugin add kimi@kimi-marketplace
|
|
|
455
455
|
|
|
456
456
|
如果钩子检查失败,请按诊断信息处理。提示需要重新配置时,在对应应用中运行 setup。不要绕过检查。
|
|
457
457
|
|
|
458
|
-
如果出现 `KIMI_CAPABILITY_NOT_CERTIFIED
|
|
458
|
+
如果出现 `KIMI_CAPABILITY_NOT_CERTIFIED`,请更新插件,或改用针对所需操作已认证的 CLI 版本。2.6.0 仅支持六项非 swarm 操作;swarm 需要选择针对该操作认证的版本,而不是仅凭其他操作已认证的版本。再次运行 setup 不能认证新的 CLI,也不能扩大其操作范围。
|
|
459
459
|
|
|
460
460
|
如果出现 `CLI_V2_PLAN_MODE_CONFIGURED`,请将 Kimi 的 `config.toml` 文件中的 `default_plan_mode` 设为 `false`,或删除该项。本插件运行的会话不能使用计划模式。
|
|
461
461
|
|
|
@@ -503,7 +503,7 @@ Il vous faut :
|
|
|
503
503
|
- macOS ou Linux
|
|
504
504
|
- une version de Claude Code, Codex ou DSH prenant en charge les plugins
|
|
505
505
|
- Node.js 22.5 ou une version ultérieure (24.9 ou ultérieure pour DSH)
|
|
506
|
-
- Kimi Code CLI 2.
|
|
506
|
+
- Kimi Code CLI 2.6.0 (uniquement pour review, challenge, ask, rescue, review gate et pursue ; les deux modes swarm sont refusés. La certification complète des huit opérations s'arrête à 2.5.3, avec la limite connue de récupération après limitation de débit. Les autres versions exactes certifiées figurent dans la [matrice runtime](./docs/native-v2-certification-provenance.md))
|
|
507
507
|
|
|
508
508
|
Windows n'est pas pris en charge actuellement. Vérifiez les versions dans un terminal :
|
|
509
509
|
|
|
@@ -672,7 +672,7 @@ Supprimez le hook de l'application avant d'en retirer le plugin. Dans Claude Cod
|
|
|
672
672
|
|
|
673
673
|
Si la vérification du hook échoue, suivez le diagnostic. Relancez setup dans l'application concernée lorsque les instructions le demandent. Ne contournez pas la vérification.
|
|
674
674
|
|
|
675
|
-
Si vous voyez `KIMI_CAPABILITY_NOT_CERTIFIED`, mettez à jour le plugin ou utilisez une version du CLI
|
|
675
|
+
Si vous voyez `KIMI_CAPABILITY_NOT_CERTIFIED`, mettez à jour le plugin ou utilisez une version du CLI certifiée pour l'opération demandée. La version 2.6.0 est limitée aux six opérations non swarm ; swarm exige une version certifiée pour cette opération, pas seulement pour une autre. Relancer setup ne valide pas une nouvelle version du CLI et n'élargit pas son champ d'opérations.
|
|
676
676
|
|
|
677
677
|
Si vous voyez `CLI_V2_PLAN_MODE_CONFIGURED`, réglez `default_plan_mode` sur `false` ou supprimez cette option du fichier `config.toml` de Kimi. Les sessions lancées par ce plugin ne peuvent pas utiliser le mode plan.
|
|
678
678
|
|
|
@@ -718,7 +718,7 @@ Les contributeurs ont besoin de Bun pour exécuter `bun run check`. La documenta
|
|
|
718
718
|
- macOS または Linux
|
|
719
719
|
- プラグインに対応した Claude Code、Codex、または DSH
|
|
720
720
|
- Node.js 22.5 以降(DSH では 24.9 以降)
|
|
721
|
-
- Kimi Code CLI 2.
|
|
721
|
+
- Kimi Code CLI 2.6.0(対象は review、challenge、ask、rescue、review gate、pursue のみ。両 swarm モードは拒否されます。8 操作すべての認証は 2.5.3 までで、継承されたレート制限復帰時の問題も開示しています。その他の正確な認証バージョンは[ランタイムマトリックス](./docs/native-v2-certification-provenance.md)を参照)
|
|
722
722
|
|
|
723
723
|
現在、Windows には対応していません。ターミナルでバージョンを確認します。
|
|
724
724
|
|
|
@@ -889,7 +889,7 @@ codex plugin add kimi@kimi-marketplace
|
|
|
889
889
|
|
|
890
890
|
フックの確認に失敗した場合は、診断結果に従って対処してください。Setup の実行を指示された場合は、該当するアプリで実行します。確認を回避しないでください。
|
|
891
891
|
|
|
892
|
-
`KIMI_CAPABILITY_NOT_CERTIFIED`
|
|
892
|
+
`KIMI_CAPABILITY_NOT_CERTIFIED` が表示されたら、プラグインを更新するか、実行したい操作が認証された CLI バージョンを選んでください。2.6.0 では 6 つの非 swarm 操作のみ利用できます。swarm には、ほかの操作ではなく、その操作が認証されたバージョンが必要です。Setup を再実行しても、新しい CLI の互換性が検証済みになったり、対応操作が広がったりすることはありません。
|
|
893
893
|
|
|
894
894
|
`CLI_V2_PLAN_MODE_CONFIGURED` が表示されたら、Kimi の `config.toml` で `default_plan_mode` を `false` にするか、その項目を削除してください。このプラグインが実行するセッションではプランモードを使えません。
|
|
895
895
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kimi-swarm-write
|
|
3
|
-
description: Use this agent ONLY when the user has explicitly asked Kimi to make EDITS across MANY disjoint targets IN PARALLEL (a write fan-out) — e.g. "apply this same change to every handler, in parallel" or "fan out these independent edits across these N files." Requires BOTH signals: many independent WRITE targets AND explicit fan-out intent. WRITE-CAPABLE but PATCH-ONLY: edits happen in an ephemeral throwaway git worktree off HEAD and come back as a reviewable .patch — the plugin NEVER applies or commits, the user owns the merge, and the real working tree is never touched. Bounded by a MANDATORY hard --budget and a
|
|
3
|
+
description: Use this agent ONLY when the user has explicitly asked Kimi to make EDITS across MANY disjoint targets IN PARALLEL (a write fan-out) — e.g. "apply this same change to every handler, in parallel" or "fan out these independent edits across these N files." Requires BOTH signals: many independent WRITE targets AND explicit fan-out intent. WRITE-CAPABLE but PATCH-ONLY: edits happen in an ephemeral throwaway git worktree off HEAD and come back as a reviewable .patch — the plugin NEVER applies or commits, the user owns the merge, and the real working tree is never touched. Bounded by a MANDATORY hard --budget and a normal-launch --max-concurrency; reviewed 2.5.3/2.6.0 sources can exceed the requested cap during rate-limit recovery. Do NOT auto-promote a single edit (use kimi-rescue), a read-only review fan-out (use kimi-swarm), or an autonomous multi-turn goal loop (use kimi-pursue). Requires kimi-code >= 0.18.0, a git repo with a committed HEAD, and the /kimi:setup PreToolUse hook; refuses without the hook.
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
6
|
color: red
|
|
@@ -47,7 +47,7 @@ When invoked:
|
|
|
47
47
|
- confirm BOTH signals are present before dispatching: (1) MANY disjoint WRITE targets and (2) an explicit request to fan the edits out in parallel. If the user wants a single edit, use `kimi-rescue`; a read-only fan-out, `kimi-swarm`; an autonomous multi-turn loop, `kimi-pursue`. When in doubt, prefer `kimi-rescue` — do not shard one task into a swarm
|
|
48
48
|
- preserve the user's objective and the disjoint target list with minimal reframing; partition into NON-overlapping targets (the subagents edit in one shared worktree, so overlapping targets can clobber each other)
|
|
49
49
|
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm --write <args>` (the `--write` flag is REQUIRED — this agent is the write path)
|
|
50
|
-
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; e.g. `30m`, `1h`, `90s`; bare number = minutes; default 30m, max 24h), `--cap <N>` (SOFT total-subagent-count hint injected into the coordinator prompt — advisory, the hook is stateless and can't count subagents), `--max-concurrency <N>` (
|
|
50
|
+
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; e.g. `30m`, `1h`, `90s`; bare number = minutes; default 30m, max 24h), `--cap <N>` (SOFT total-subagent-count hint injected into the coordinator prompt — advisory, the hook is stateless and can't count subagents), `--max-concurrency <N>` (caps normal launches on kimi-code 0.18.0+; **defaults to 1 for `--write`** — normal-launch writes serialize because disjoint-target partitioning is prompt-only; reviewed 2.5.3/2.6.0 sources can exceed the requested cap during rate-limit recovery), and `-m`/`--model <name>`. Everything else is trailing objective text. Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). `--no-thinking` is rejected; use `--thinking off`
|
|
51
51
|
- do not invent flags. The runtime hard-fails with `INVALID_ARGS` on unknown flag-shaped tokens — pass `--` before flag-shaped objective text to forward it as objective text rather than a flag
|
|
52
52
|
- **this is write-capable, but the blast radius is bounded by construction — and PATCH-ONLY is the load-bearing safety property.** Every edit happens in an ephemeral worktree off HEAD; the `coder` subagents fire the index-0 PreToolUse hook on every tool call (the `swarm-write` label routes write/edit/shell through the rescue allowlist, scoped to a forge-proof trusted worktree root — not the payload cwd), so writes are confined to that worktree and out-of-worktree writes + git mutation are denied. The result is a `.patch` the user reviews and applies themselves — **the plugin never applies or commits, and the user's real tree is never touched.** Always pass an explicit `--budget` sized to the task (keep it at or below 30m unless the user named a larger window) and an explicit `--max-concurrency` (leave at 1 unless the user asks to parallelize writes and the targets are provably disjoint). Never try to remove these bounds
|
|
53
53
|
- swarm-write **bases the worktree on HEAD: uncommitted changes are NOT included.** If the user has a dirty tree the runtime warns; surface that and suggest committing or stashing first if the swarm needs those changes
|
|
@@ -55,7 +55,7 @@ When invoked:
|
|
|
55
55
|
- **the user should never have to type a job id** (it is a raw UUID), and you will not have one either — a detached run prints nothing at launch; the job id only reaches you with the final report. So cancel by omitting it: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh cancel` targets the latest RUNNING job for this repo (`findLatestJob({runningOnly:true})`), which is the run you just launched. Pass an explicit id only if you already have one from a completed report. Note the ambiguity: with two runs in flight, the no-id form takes the most recent — if the user has more than one going, confirm which they mean before cancelling
|
|
56
56
|
- **prefer `companion.sh cancel` over an Esc/interrupt, and say so if the user asks how to stop it.** A harness interrupt gives the companion only ~1.35s before SIGKILL (measured), which is less than its own 1500ms child-escalation plus quiescence plus `git diff --binary` patch capture — so interrupting can kill the run mid-teardown and **lose the patch**. The cancel command signals the job from a separate process that is not racing that deadline, so teardown completes and the partial patch survives
|
|
57
57
|
- swarm-write **REFUSES without the `/kimi:setup` PreToolUse hook** (a write fan-out with no per-subagent enforcement is an N-fold blast radius). If the companion refuses, surface that and tell the user to run `/kimi:setup`; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
58
|
-
- requires kimi-code **>= 0.18.0** (
|
|
58
|
+
- requires kimi-code **>= 0.18.0** (normal-launch concurrency support; reviewed 2.5.3/2.6.0 sources have a rate-limit-recovery overrun) and a git repo with a **committed HEAD** — surface `WRITE_SWARM_NOT_A_REPO` / `WRITE_SWARM_NO_HEAD` plainly if the runtime reports them
|
|
59
59
|
- `/kimi:result <jobId> --json` returns a structured envelope with metadata plus the artifact body.
|
|
60
60
|
|
|
61
61
|
When swarm-write completes:
|
package/agents/kimi-swarm.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kimi-swarm
|
|
3
|
-
description: Use this agent ONLY when the user has explicitly asked for a READ-ONLY review fanned out in PARALLEL across many independent targets (files, modules, or questions) at once — a user-scoped whole-directory or repo-wide audit where one subagent per target is the point. Requires BOTH signals: many independent targets AND an explicit request for parallel fan-out. Do NOT auto-promote a single, unscoped, or diff-shaped review into a per-file swarm — use kimi-review for a single working-tree/branch diff or any review the user did not scope as a fan-out. Read-only (every subagent is hook-denied writes — zero write surface), bounded by a hard wall-clock --budget and a concurrency
|
|
3
|
+
description: Use this agent ONLY when the user has explicitly asked for a READ-ONLY review fanned out in PARALLEL across many independent targets (files, modules, or questions) at once — a user-scoped whole-directory or repo-wide audit where one subagent per target is the point. Requires BOTH signals: many independent targets AND an explicit request for parallel fan-out. Do NOT auto-promote a single, unscoped, or diff-shaped review into a per-file swarm — use kimi-review for a single working-tree/branch diff or any review the user did not scope as a fan-out. Read-only (every subagent is hook-denied writes — zero write surface), bounded by a hard wall-clock --budget and a normal-launch concurrency setting; requires the /kimi:setup PreToolUse hook and refuses without it. Not for writes (see kimi-rescue) or free-form Q&A (see kimi-ask).
|
|
4
4
|
model: sonnet
|
|
5
5
|
tools: Bash
|
|
6
6
|
color: green
|
|
@@ -42,9 +42,9 @@ When invoked:
|
|
|
42
42
|
- decide whether the task is a BROAD read-only fan-out rather than a single-diff review (kimi-review), free-form ask (kimi-ask), or implementation (kimi-rescue); for one working-tree or branch diff, use kimi-review instead
|
|
43
43
|
- preserve the user's review scope as the trailing focus text — what to review across the workspace — with minimal reframing
|
|
44
44
|
- call the shared companion runtime with one Bash invocation after any model-discovery step: `${CLAUDE_PLUGIN_ROOT}/scripts/companion.sh task swarm <args>`
|
|
45
|
-
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; e.g. `30m`, `1h`, `90s`; bare number = minutes; default 30m), `--cap <N>` (SOFT total-subagent-count hint injected into the coordinator prompt — advisory, the hook is stateless and can't count subagents), `--max-concurrency <N>` (
|
|
45
|
+
- the companion accepts a **strict allowlist** of flags: `--thinking <off|low|medium|high>` (requested per run), `--budget <duration>` (HARD wall-clock ceiling; e.g. `30m`, `1h`, `90s`; bare number = minutes; default 30m), `--cap <N>` (SOFT total-subagent-count hint injected into the coordinator prompt — advisory, the hook is stateless and can't count subagents), `--max-concurrency <N>` (caps normal launches on kimi-code 0.18.0+; **defaults to 4** when omitted, older binaries ignore it; reviewed 2.5.3/2.6.0 sources can exceed the requested cap during rate-limit recovery), and `-m`/`--model <name>`. Everything else is trailing focus text. Reasoning behavior follows the selected model and Kimi configuration unless `--thinking <effort>` requests one for this run (honoured by Kimi's own providers on models that can turn thinking off; other providers ignore it silently; the plugin cannot verify it). `--no-thinking` is rejected; use `--thinking off`
|
|
46
46
|
- do not invent flags. The runtime hard-fails with `INVALID_ARGS` on unknown flag-shaped tokens — pass `--` before flag-shaped objective text to forward it as scope text rather than a flag
|
|
47
|
-
- **cost is the only real risk, and it is bounded by construction.** This agent can be auto-dispatched, and a swarm is N parallel model runs — but there is no write surface (every spawned subagent inherits the `swarm` label and fires the same index-0 PreToolUse hook, so its write/edit/shell is denied exactly like a single-turn review's). The runtime
|
|
47
|
+
- **cost is the only real risk, and it is bounded by construction.** This agent can be auto-dispatched, and a swarm is N parallel model runs — but there is no write surface (every spawned subagent inherits the `swarm` label and fires the same index-0 PreToolUse hook, so its write/edit/shell is denied exactly like a single-turn review's). The runtime enforces a normal-launch peak: `--max-concurrency` defaults to `4` for every run, and `--budget` defaults to 30m; reviewed 2.5.3/2.6.0 sources can exceed the requested peak during rate-limit recovery. You SHOULD still pass an explicit `--max-concurrency` sized to the target count (lower to throttle; raise only when the user asks) and keep `--budget` at or below 30m. Never attempt to remove these bounds
|
|
48
48
|
- swarm is **foreground-only** — do not pass `--background`, `--wait`, `--fresh`, or `--resume` (the parser rejects them with `INVALID_ARGS`). Default to foreground so the run stays watchable. Detach the Bash call with `run_in_background: true` ONLY when the user explicitly asks for fire-and-forget, and only with a finite `--max-concurrency` and a reduced `--budget` (a backgrounded fan-out has no human watching it to Ctrl+C); after launching, tell the user to check `/kimi:status` for progress
|
|
49
49
|
- swarm **REFUSES without the `/kimi:setup` PreToolUse hook**, matching every model-spawning command. If the companion refuses, surface that and tell the user to run `/kimi:setup`; do not reach for `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK`
|
|
50
50
|
- requires kimi-code **>= 0.12.0** (the `AgentSwarm` tool); `--max-concurrency` only binds on **>= 0.18.0**
|
package/commands/swarm.md
CHANGED
|
@@ -19,13 +19,13 @@ Supported flags:
|
|
|
19
19
|
- `--write` — fan out EDITS (not just review). Requires kimi-code **>= 0.18.0**, a git repo with a committed HEAD, and the PreToolUse hook. Bases the worktree on HEAD: **uncommitted changes are NOT included** (you'll get a warning) — commit or stash first if the swarm needs them. `--write` is also reachable via the model-invocable `kimi-swarm-write` subagent, with strict triggering (many disjoint write targets AND explicit fan-out intent); auto-dispatch widens no write surface and keeps every bound, and the slash command itself stays human-only.
|
|
20
20
|
- `--budget <duration>` — HARD wall-clock ceiling (e.g. `30m`, `1h`, `90s`; bare number = minutes). Default 30m. The always-on bound on cost/runaway.
|
|
21
21
|
- `--cap <N>` — SOFT cap on TOTAL subagent count: injected into the prompt as a model instruction. Advisory, not hook-enforced (the hook is stateless and can't count subagents), so the model may exceed it. Bounds lifetime total, not peak parallelism.
|
|
22
|
-
- `--max-concurrency <N>` —
|
|
22
|
+
- `--max-concurrency <N>` — caps normal launches of concurrent subagents on kimi-code **0.18.0+** (exported as `KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY`; older binaries ignore it). **Defaults to 4 for read, 1 for `--write`** (normal-launch writes serialize by default since disjoint-target partitioning is prompt-only) — pass a value to widen or throttle. On reviewed 2.5.3/2.6.0 sources, rate-limit recovery can exceed this setting; it is not an unconditional hard ceiling. Distinct from `--cap`: concurrency (simultaneous) ≠ total count (lifetime).
|
|
23
23
|
- `-m`, `--model <name>`
|
|
24
24
|
|
|
25
25
|
Prototype limitations:
|
|
26
26
|
|
|
27
27
|
- **No `--background` flag** — the runtime has no detached-worker mode for swarm. That is separate from how the *caller* runs the shell command: for `--write` (30m default budget vs a 10-minute foreground Bash cap) detaching the call is expected; for a read-only fan-out the default stays foreground and detaching is a per-request choice. `--budget` and `--max-concurrency` stay finite either way, and budget expiry still captures the patch/report. To stop a run, just say so — the stop path is `companion.sh cancel` with no id (it targets the latest running job for this repo). For `--write`, prefer that over Esc: an interrupt can kill the run mid-teardown and lose the captured patch.
|
|
28
|
-
- Read-only swarm requires kimi-code **>= 0.12.0** (the `AgentSwarm` tool); `--write` requires **>= 0.18.0** (
|
|
28
|
+
- Read-only swarm requires kimi-code **>= 0.12.0** (the `AgentSwarm` tool); `--write` requires **>= 0.18.0** (normal-launch concurrency support; reviewed 2.5.3/2.6.0 sources have a rate-limit-recovery overrun). Both **refuse** without the `/kimi:setup` PreToolUse hook (a fan-out with no enforcement is an N-fold blast radius).
|
|
29
29
|
|
|
30
30
|
Return the companion stdout verbatim.
|
|
31
31
|
|
package/dist/cli-client.js
CHANGED
|
@@ -115,8 +115,8 @@ export async function runCliPrompt(opts) {
|
|
|
115
115
|
const records = [];
|
|
116
116
|
const malformed = [];
|
|
117
117
|
// Rolling stderr tail — keep only the trailing STDERR_TAIL_BYTES so a
|
|
118
|
-
// long-running kimi process emitting megabytes of stderr (tool.
|
|
119
|
-
// thinking deltas) doesn't grow our RSS unboundedly.
|
|
118
|
+
// long-running kimi process emitting megabytes of stderr (tool.updated
|
|
119
|
+
// output/status, thinking deltas) doesn't grow our RSS unboundedly.
|
|
120
120
|
let stderrTail = "";
|
|
121
121
|
let announcedSessionId;
|
|
122
122
|
let announcedGoalSummary;
|
|
@@ -786,7 +786,7 @@ function buildArgs(opts) {
|
|
|
786
786
|
? opts.env.KIMI_PLUGIN_CC_SMOKE_V2_CANDIDATE
|
|
787
787
|
: undefined;
|
|
788
788
|
if (opts.resumeSessionId === undefined &&
|
|
789
|
-
["2.5.0", "2.5.1", "2.5.2"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
789
|
+
["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
790
790
|
args.push("--environment", "local");
|
|
791
791
|
}
|
|
792
792
|
if (opts.resumeSessionId !== undefined) {
|
|
@@ -103,7 +103,8 @@ export async function runRecoverSwarm(argv, context) {
|
|
|
103
103
|
if (current.command !== plan.command || current.kimiVersion !== plan.kimiVersion || JSON.stringify(current.prefixArgs) !== JSON.stringify(plan.prefixArgs))
|
|
104
104
|
throw recoveryError("The exact recorded CLI is not selected. Restore that certified binary before session cleanup.");
|
|
105
105
|
signal.throwIfAborted();
|
|
106
|
-
await
|
|
106
|
+
const recoveryExecutionCwd = await realpath(record.cwd);
|
|
107
|
+
await deactivateSwarmSession({ cwd: recoveryExecutionCwd, env: context.env, command: current.command,
|
|
107
108
|
prefixArgs: current.prefixArgs, executionPlan: current, commandLabel: expectedRoot ? "swarm-write" : "swarm",
|
|
108
109
|
trustedWorkspaceRoot: expectedRoot ?? undefined, ...record.session, signal,
|
|
109
110
|
onRecoveryEvent: (event) => recordRecoveryEvent(store, record, event) });
|
package/dist/commands/setup.js
CHANGED
|
@@ -28,7 +28,7 @@ import { normalizeTopLevelInlineHooks, validateKimiHookSetForEnvironment, withKi
|
|
|
28
28
|
import { buildHookShellCommand, hostIdFromHookCommand, resolveHookScriptPath, resolveHostId, resolveNodeBinary, } from "../hooks/install-paths.js";
|
|
29
29
|
import { decodeManagedCommandLine, effectiveHost, evaluateInstalled, findUnmanagedApprovalHookBlocks, markerCommentLines, MARKERS, ORPHAN_MARKER_REMEDY, parseManagedBlock, } from "../hooks/managed-block.js";
|
|
30
30
|
import { formatVersionOutOfRangeWarning, probeKimiVersion, } from "../kimi-version-probe.js";
|
|
31
|
-
import { isNativeV2CertifiedVersion,
|
|
31
|
+
import { isNativeV2CertifiedVersion, NATIVE_V2_ANY_OPERATION_VERSIONS, NATIVE_V2_NON_SWARM_VERSIONS, } from "../kimi-engine.js";
|
|
32
32
|
import { resolveKimiHome } from "../kimi-home.js";
|
|
33
33
|
import { ensurePluginPaths, resolvePluginPaths } from "../paths.js";
|
|
34
34
|
import { KIMI_PLUGIN_CC_VERSION } from "../version.js";
|
|
@@ -973,13 +973,13 @@ async function collectKimiVersionWarnings(env, warnings) {
|
|
|
973
973
|
// clearer message. Avoid double-noise.
|
|
974
974
|
return;
|
|
975
975
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
// KIMI_TESTED_MINORS — that table never gains 0.42). Without this, setup on a
|
|
979
|
-
// v2-certified binary would wrongly warn "not certified, commands will refuse".
|
|
980
|
-
if (probe.inTestedRange || isNativeV2CertifiedVersion(probe.version))
|
|
976
|
+
if (!probe.inTestedRange && !isNativeV2CertifiedVersion(probe.version)) {
|
|
977
|
+
warnings.push(formatVersionOutOfRangeWarning(probe, KIMI_PLUGIN_CC_VERSION, NATIVE_V2_ANY_OPERATION_VERSIONS));
|
|
981
978
|
return;
|
|
982
|
-
|
|
979
|
+
}
|
|
980
|
+
if (NATIVE_V2_NON_SWARM_VERSIONS.includes(probe.version)) {
|
|
981
|
+
warnings.push(`NOTE: kimi-code ${probe.version} is certified for review, challenge, ask, rescue, review gate, and pursue only. Read-only swarm and write swarm refuse before model spawn because upstream rate-limit recovery can exceed maxConcurrency.`);
|
|
982
|
+
}
|
|
983
983
|
}
|
|
984
984
|
/**
|
|
985
985
|
* Non-blocking notice for kimi-code's own enabled plugins from
|
package/dist/commands/swarm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolveKimiHome } from "../kimi-home.js";
|
|
|
2
2
|
import { probeProcessIdentity } from "../process-tree.js";
|
|
3
3
|
import { recordRecoveryEvent, finishRecoveryRecord } from "../swarm-recovery.js";
|
|
4
4
|
import { allocateJobId } from "../job-id.js";
|
|
5
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
|
+
import { mkdir, realpath, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { createCliCancellationHandlers } from "../cli-cancellation.js";
|
|
8
8
|
import { ResponseTimeoutError, runCliPromptWithBudget } from "../cli-client.js";
|
|
@@ -23,44 +23,47 @@ import { assertCliResultSuccess, reassembleProseFromRecords, warnIfSessionIdMiss
|
|
|
23
23
|
import { buildKimiSessionTitle, syncKimiSessionTitle } from "../session-title.js";
|
|
24
24
|
// /kimi:swarm — parallel fan-out, read-only by default and runtime-foreground-only.
|
|
25
25
|
// A finite wall-clock budget bounds the whole run. --cap is a SOFT total-count
|
|
26
|
-
// prompt hint; --max-concurrency
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
26
|
+
// prompt hint; --max-concurrency caps normal launches on kimi-code 0.18.0+.
|
|
27
|
+
// Reviewed 2.5.3/2.6.0 schedulers can exceed that cap during rate-limit recovery.
|
|
28
|
+
// The plugin always exports the setting; older read-only swarms retain only the
|
|
29
|
+
// wall-clock hard bound. Read/write modes reuse review/rescue lineage, and the
|
|
30
|
+
// mandatory PreToolUse hook enforces read-only policy or trusted-worktree write
|
|
31
|
+
// confinement on the coordinator and every subagent. Write mode requires
|
|
32
|
+
// kimi-code 0.18.0+. Exact 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2,
|
|
33
|
+
// and certified 2.5.3 activate a same-job session through a bounded loopback
|
|
34
|
+
// web lifecycle, then resume it through the normal print path. Candidate-only
|
|
35
|
+
// 2.6.0 activation uses that lifecycle too; production 2.6.0 is non-swarm
|
|
36
|
+
// certified and refuses both modes before model spawn. The certification table
|
|
37
|
+
// controls whether each exact version is reachable.
|
|
33
38
|
const SWARM_SUMMARY_MAX = 120;
|
|
34
39
|
const SWARM_AGENT_PROFILE = "<swarm>";
|
|
35
40
|
const SWARM_WRITE_AGENT_PROFILE = "<swarm-write>";
|
|
36
41
|
/**
|
|
37
|
-
* Default concurrency setting when the user passes no
|
|
38
|
-
* The plugin always exports
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
+
* Default normal-launch concurrency setting when the user passes no
|
|
43
|
+
* `--max-concurrency`. The plugin always exports
|
|
44
|
+
* KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY; older read-only swarms ignore it and
|
|
45
|
+
* retain only the wall-clock hard bound. Rate-limit recovery can exceed it on
|
|
46
|
+
* reviewed 2.5.3/2.6.0 sources; this is not an unconditional peak guarantee.
|
|
42
47
|
*/
|
|
43
48
|
export const SWARM_DEFAULT_MAX_CONCURRENCY = 4;
|
|
44
49
|
/**
|
|
45
|
-
* Resolve the
|
|
46
|
-
* wins; otherwise
|
|
47
|
-
* never unset. Pure + exported for unit testing (the parser leaves
|
|
48
|
-
* undefined; swarm.ts owns the default, mirroring `budgetMs`).
|
|
50
|
+
* Resolve the requested normal-launch concurrency: an explicit
|
|
51
|
+
* `--max-concurrency` wins; otherwise use SWARM_DEFAULT_MAX_CONCURRENCY so the
|
|
52
|
+
* setting is never unset. Pure + exported for unit testing (the parser leaves
|
|
53
|
+
* the value undefined; swarm.ts owns the default, mirroring `budgetMs`).
|
|
49
54
|
*/
|
|
50
55
|
export function resolveSwarmMaxConcurrency(requested) {
|
|
51
56
|
return requested ?? SWARM_DEFAULT_MAX_CONCURRENCY;
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
|
-
* Default
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* override with an explicit `--max-concurrency N`. Effective only on kimi-code
|
|
60
|
-
* 0.18.0+ (the write-mode version gate), so the ceiling is always enforced.
|
|
59
|
+
* Default normal-launch concurrency for WRITE mode — 1 (serialized) vs read's 4.
|
|
60
|
+
* Disjoint-target partitioning is prompt-only, so normal writes serialize by
|
|
61
|
+
* default. Rate-limit recovery can still exceed the requested cap on reviewed
|
|
62
|
+
* 2.5.3/2.6.0 sources; this is not an unconditional serialization guarantee.
|
|
63
|
+
* Override with an explicit `--max-concurrency N`.
|
|
61
64
|
*/
|
|
62
65
|
export const SWARM_WRITE_DEFAULT_MAX_CONCURRENCY = 1;
|
|
63
|
-
/** Resolve the write-mode concurrency
|
|
66
|
+
/** Resolve the write-mode normal-launch concurrency: explicit wins, else default 1. */
|
|
64
67
|
export function resolveSwarmWriteMaxConcurrency(requested) {
|
|
65
68
|
return requested ?? SWARM_WRITE_DEFAULT_MAX_CONCURRENCY;
|
|
66
69
|
}
|
|
@@ -74,9 +77,10 @@ export function resolveSwarmWriteMaxConcurrency(requested) {
|
|
|
74
77
|
* Read-only is NOT enforced by this prose — the PreToolUse hook (swarm label) at
|
|
75
78
|
* policy index 0 denies every write/edit/shell for the coordinator AND every
|
|
76
79
|
* subagent, so slimming this text does not move the safety boundary. The optional
|
|
77
|
-
* `cap` is a SOFT subagent-count hint (the hook cannot enforce a count). The
|
|
78
|
-
* concurrency
|
|
80
|
+
* `cap` is a SOFT subagent-count hint (the hook cannot enforce a count). The
|
|
81
|
+
* normal-launch concurrency setting is separate: --max-concurrency →
|
|
79
82
|
* KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY (see executeSwarmJob / cli-client buildKimiCliEnvironment).
|
|
83
|
+
* Reviewed 2.5.3/2.6.0 sources can exceed it during rate-limit recovery.
|
|
80
84
|
* The --budget wall-clock ceiling is the always-on hard bound on the whole run.
|
|
81
85
|
*/
|
|
82
86
|
export function buildSwarmPrompt(objective, cap) {
|
|
@@ -209,7 +213,7 @@ async function runReadSwarm(parsed, objective, context) {
|
|
|
209
213
|
await markJobFailed(store, paths, job, classified, "Swarm failed.", { phase: "failed" });
|
|
210
214
|
throw classified;
|
|
211
215
|
}
|
|
212
|
-
const completed = await executeSwarmJob(job.job_id, prompt, objective, job.budget_ms, resolveSwarmMaxConcurrency(parsed.maxConcurrency), context);
|
|
216
|
+
const completed = await executeSwarmJob(job.job_id, prompt, objective, job.budget_ms, resolveSwarmMaxConcurrency(parsed.maxConcurrency), context, undefined, await realpath(context.cwd));
|
|
213
217
|
if (!completed.final_output_path) {
|
|
214
218
|
throw new RuntimeError("SWARM_RESULT_MISSING", "Swarm finished without a rendered result.", "swarm.result");
|
|
215
219
|
}
|
|
@@ -319,7 +323,7 @@ async function runWriteSwarm(parsed, objective, context) {
|
|
|
319
323
|
onPatchCaptureFailure: () => {
|
|
320
324
|
preserveWorktree = true;
|
|
321
325
|
},
|
|
322
|
-
});
|
|
326
|
+
}, await realpath(worktreePath));
|
|
323
327
|
if (preserveWorktree && completed.error) {
|
|
324
328
|
throw new RuntimeError(completed.error.code, completed.error.message, completed.error.stage, {
|
|
325
329
|
details: completed.error.details,
|
|
@@ -389,8 +393,11 @@ async function executeSwarmJob(jobId, prompt, objective, budgetMs, maxConcurrenc
|
|
|
389
393
|
* (`spawnCwd`), the hook label is "swarm-write", and `workspaceRoot` (the same
|
|
390
394
|
* worktree) is exported as the trusted allowlist root + used to capture the
|
|
391
395
|
* patch. Undefined ⇒ read-only swarm (label "swarm", spawn cwd = job.cwd).
|
|
396
|
+
* Real command paths supply the canonical execution cwd for activation/resume,
|
|
397
|
+
* trusted-root checks, read-mode preflight, and the print spawn. Virtual test
|
|
398
|
+
* doubles may omit the canonical path and retain their original spawn spelling.
|
|
392
399
|
*/
|
|
393
|
-
writeMode) {
|
|
400
|
+
writeMode, executionCwd) {
|
|
394
401
|
const paths = resolvePluginPaths(context.env);
|
|
395
402
|
await ensurePluginPaths(paths);
|
|
396
403
|
const store = new JobStore(paths);
|
|
@@ -465,7 +472,7 @@ writeMode) {
|
|
|
465
472
|
store.saveSwarmRecovery(job.job_id, recovery);
|
|
466
473
|
}
|
|
467
474
|
activationOptions = {
|
|
468
|
-
cwd: writeMode?.spawnCwd ?? job.cwd,
|
|
475
|
+
cwd: executionCwd ?? writeMode?.spawnCwd ?? job.cwd,
|
|
469
476
|
env: context.env,
|
|
470
477
|
command: executionPlan.command,
|
|
471
478
|
prefixArgs: executionPlan.prefixArgs,
|
|
@@ -474,7 +481,7 @@ writeMode) {
|
|
|
474
481
|
model: job.model ?? undefined,
|
|
475
482
|
thinkingEffort: job.thinking_effort ?? undefined,
|
|
476
483
|
swarmMaxConcurrency: maxConcurrency,
|
|
477
|
-
trustedWorkspaceRoot: writeMode?.workspaceRoot,
|
|
484
|
+
trustedWorkspaceRoot: executionCwd ?? writeMode?.workspaceRoot,
|
|
478
485
|
expectedVersion: executionPlan.kimiVersion ?? undefined,
|
|
479
486
|
onRecoveryEvent: recovery ? (event) => recordRecoveryEvent(store, recovery, event) : undefined,
|
|
480
487
|
};
|
|
@@ -554,7 +561,7 @@ writeMode) {
|
|
|
554
561
|
prompt,
|
|
555
562
|
commandLabel,
|
|
556
563
|
swarmMaxConcurrency: maxConcurrency,
|
|
557
|
-
trustedWorkspaceRoot: writeMode?.workspaceRoot,
|
|
564
|
+
trustedWorkspaceRoot: executionCwd ?? writeMode?.workspaceRoot,
|
|
558
565
|
model: job.model ?? undefined,
|
|
559
566
|
thinkingEffort: job.thinking_effort ?? undefined,
|
|
560
567
|
resumeSessionId: preactivated?.sessionId,
|
|
@@ -595,9 +595,10 @@ function validateVersionSensitiveEvents(events, version) {
|
|
|
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
597
|
// 2.3.0 (b5e28fd6), 2.3.1 (684bae9e), 2.3.2 (b8dd3a13), 2.3.3 (ec495f0c),
|
|
598
|
-
// 2.4.0 (f26e4d91), 2.4.1 (2c73f3f5), 2.5.0 (41c34143), 2.5.1 (1b02030d),
|
|
599
|
-
// 2.5.2 (1c142a00):
|
|
600
|
-
// the additive events and HookDefSchema are unchanged.
|
|
598
|
+
// 2.4.0 (f26e4d91), 2.4.1 (2c73f3f5), 2.5.0 (41c34143), 2.5.1 (1b02030d),
|
|
599
|
+
// 2.5.2 (1c142a00), 2.5.3 (5af9942e), and 2.6.0 (740d6c0b):
|
|
600
|
+
// the additive events and HookDefSchema are unchanged. Exact 2.6.0 schema acceptance
|
|
601
|
+
// covers the narrowed non-swarm production certification, not swarm operations.
|
|
601
602
|
// Require the full version string AND matching components; no inferred 2.x compatibility.
|
|
602
603
|
if (version.major === 2 && ((version.minor === 0 && ((version.version === "2.0.0" && version.patch === 0) ||
|
|
603
604
|
(version.version === "2.0.1" && version.patch === 1) ||
|
|
@@ -613,7 +614,9 @@ function validateVersionSensitiveEvents(events, version) {
|
|
|
613
614
|
(version.version === "2.4.1" && version.patch === 1))) ||
|
|
614
615
|
(version.minor === 5 && ((version.version === "2.5.0" && version.patch === 0) ||
|
|
615
616
|
(version.version === "2.5.1" && version.patch === 1) ||
|
|
616
|
-
(version.version === "2.5.2" && version.patch === 2)
|
|
617
|
+
(version.version === "2.5.2" && version.patch === 2) ||
|
|
618
|
+
(version.version === "2.5.3" && version.patch === 3))) ||
|
|
619
|
+
(version.minor === 6 && ((version.version === "2.6.0" && version.patch === 0))))) {
|
|
617
620
|
return { valid: true };
|
|
618
621
|
}
|
|
619
622
|
if (version.major !== 0) {
|
package/dist/kimi-engine.js
CHANGED
|
@@ -48,15 +48,31 @@ export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([
|
|
|
48
48
|
"2.5.0",
|
|
49
49
|
"2.5.1",
|
|
50
50
|
"2.5.2",
|
|
51
|
+
"2.5.3",
|
|
52
|
+
]);
|
|
53
|
+
/**
|
|
54
|
+
* Exact releases certified only for review, challenge, ask, rescue, review_gate
|
|
55
|
+
* and pursue. Their upstream rate-limit recovery can exceed AgentSwarm's
|
|
56
|
+
* configured maximum, so both swarm operations refuse before model spawn.
|
|
57
|
+
*/
|
|
58
|
+
export const NATIVE_V2_NON_SWARM_VERSIONS = Object.freeze(["2.6.0"]);
|
|
59
|
+
/**
|
|
60
|
+
* Any-operation union used by setup and engine selection. The older
|
|
61
|
+
* NATIVE_V2_CERTIFIED_VERSIONS export stays all-operation-only for consumers
|
|
62
|
+
* that choose a full-swarm pin automatically.
|
|
63
|
+
*/
|
|
64
|
+
export const NATIVE_V2_ANY_OPERATION_VERSIONS = Object.freeze([
|
|
65
|
+
...NATIVE_V2_CERTIFIED_VERSIONS,
|
|
66
|
+
...NATIVE_V2_NON_SWARM_VERSIONS,
|
|
51
67
|
]);
|
|
52
68
|
/** Per-operation native-v2 certification. One green operation never certifies another. */
|
|
53
69
|
export const NATIVE_V2_CERTIFIED = new Map([
|
|
54
|
-
["review",
|
|
55
|
-
["challenge",
|
|
56
|
-
["ask",
|
|
57
|
-
["rescue",
|
|
58
|
-
["review_gate",
|
|
59
|
-
["pursue",
|
|
70
|
+
["review", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
71
|
+
["challenge", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
72
|
+
["ask", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
73
|
+
["rescue", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
74
|
+
["review_gate", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
75
|
+
["pursue", NATIVE_V2_ANY_OPERATION_VERSIONS],
|
|
60
76
|
["swarm", NATIVE_V2_CERTIFIED_VERSIONS],
|
|
61
77
|
["swarm-write", NATIVE_V2_CERTIFIED_VERSIONS],
|
|
62
78
|
]);
|
|
@@ -76,16 +92,17 @@ export function isNativeV2CertifiedVersion(version) {
|
|
|
76
92
|
const normalized = parseVersionLine(version)?.raw;
|
|
77
93
|
if (normalized === undefined)
|
|
78
94
|
return false;
|
|
79
|
-
return
|
|
95
|
+
return NATIVE_V2_ANY_OPERATION_VERSIONS.includes(normalized);
|
|
80
96
|
}
|
|
81
97
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* ≥0.42 binary is refused by the legacy range rather than silently run on v2.
|
|
98
|
+
* Select native v2 for an exactly certified version or a test-only operation
|
|
99
|
+
* admission, then enforce scope in assertCertifiedCapability. A narrowed
|
|
100
|
+
* release must not fall back to legacy-v1 for an excluded operation.
|
|
86
101
|
*/
|
|
87
102
|
export function selectIntendedEngine(operationKind, probe) {
|
|
88
|
-
return isNativeV2Certified(operationKind, probe.version)
|
|
103
|
+
return isNativeV2CertifiedVersion(probe.version) || isNativeV2Certified(operationKind, probe.version)
|
|
104
|
+
? "native-v2"
|
|
105
|
+
: "legacy-v1";
|
|
89
106
|
}
|
|
90
107
|
const UNSAFE_EXPERIMENTAL_VALUES = new Set(["1", "true", "yes", "on"]);
|
|
91
108
|
/**
|
|
@@ -546,6 +563,23 @@ function assertExecutionPlanShape(plan) {
|
|
|
546
563
|
}
|
|
547
564
|
function nativeV2NotCertified(operationKind, version) {
|
|
548
565
|
const certified = NATIVE_V2_CERTIFIED.get(operationKind) ?? [];
|
|
566
|
+
const normalized = version === null ? undefined : parseVersionLine(version)?.raw;
|
|
567
|
+
if (normalized !== undefined &&
|
|
568
|
+
NATIVE_V2_NON_SWARM_VERSIONS.includes(normalized) &&
|
|
569
|
+
(operationKind === "swarm" || operationKind === "swarm-write")) {
|
|
570
|
+
return new RuntimeError("KIMI_CAPABILITY_NOT_CERTIFIED", `Refusing ${operationKind}: kimi-code ${normalized} is certified only for non-swarm operations (review, challenge, ask, rescue, review_gate, pursue). Its upstream rate-limit recovery can exceed AgentSwarm's configured maximum, so this plugin refuses AgentSwarm before model spawn. Use a non-swarm operation on ${normalized}, or select a version explicitly certified for ${operationKind}.`, "kimi-engine.capability", {
|
|
571
|
+
details: {
|
|
572
|
+
refusal_kind: "v2-swarm-not-certified",
|
|
573
|
+
certification_scope: "non-swarm",
|
|
574
|
+
retryable_after_setup: false,
|
|
575
|
+
operation_kind: operationKind,
|
|
576
|
+
intended_engine: "native-v2",
|
|
577
|
+
kimi_version: normalized,
|
|
578
|
+
certified_versions: [...certified],
|
|
579
|
+
certified_operations: ["review", "challenge", "ask", "rescue", "review_gate", "pursue"],
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
}
|
|
549
583
|
const observed = version === null ? "an unprobed version" : `kimi-code ${version}`;
|
|
550
584
|
return new RuntimeError("KIMI_CAPABILITY_NOT_CERTIFIED", `Refusing ${operationKind} on native v2: ${observed} is not in this operation's exactly certified set [${certified.join(", ")}]. Update kimi-plugin-cc to a release that certifies this kimi-code version, or point KIMI_PLUGIN_CC_KIMI_BIN at a certified binary. KIMI_PLUGIN_CC_SKIP_VERSION_PROBE is a test/smoke seam, not a production repair path.`, "kimi-engine.capability", {
|
|
551
585
|
details: {
|
package/dist/mcp/operations.js
CHANGED
|
@@ -65,7 +65,7 @@ const CAP_PROPERTY = {
|
|
|
65
65
|
const MAX_CONCURRENCY_PROPERTY = {
|
|
66
66
|
type: "integer",
|
|
67
67
|
minimum: 1,
|
|
68
|
-
description: "
|
|
68
|
+
description: "Requested normal-launch subagent concurrency on supported Kimi Code versions. Rate-limit recovery can exceed it on reviewed 2.5.3/2.6.0 sources. Distinct from the soft total cap.",
|
|
69
69
|
};
|
|
70
70
|
const START_RESULT_GUIDANCE = "Task-capable clients receive an MCP task. Other clients receive a job ID immediately after launch; use kimi_job_status and kimi_job_result until terminal, and kimi_job_cancel to stop. Do not present a launch handle as the finished answer.";
|
|
71
71
|
function schema(properties, required = []) {
|
package/dist/session-recovery.js
CHANGED
|
@@ -22,7 +22,9 @@ const SESSION_ID = /^session_[0-9a-f-]{36}$/;
|
|
|
22
22
|
*
|
|
23
23
|
* A candidate is bound to THIS job by content, not only by time: the first
|
|
24
24
|
* user message in the session's main journal must carry a text item whose
|
|
25
|
-
* sha256 equals the
|
|
25
|
+
* sha256 equals the caller-supplied digest of the exact `-p` argument. Native
|
|
26
|
+
* goal print stores the unwrapped objective, so the smoke recovery control
|
|
27
|
+
* supplies that digest. Production pursue does not perform store recovery. Time and
|
|
26
28
|
* cwd alone would admit a concurrent TUI session, another host's finished job
|
|
27
29
|
* (host-local stores cannot see each other's session ids), or a `state.json`
|
|
28
30
|
* planted by repository code running under rescue. The digest is not unique
|
package/dist/stream-json.js
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
// stream, not on a separate channel.
|
|
24
24
|
// - thinking.delta events are silently discarded by the CLI's
|
|
25
25
|
// PromptJsonWriter (`writeThinkingDelta(): void {}`).
|
|
26
|
-
// - tool.
|
|
27
|
-
// stream-json.
|
|
26
|
+
// - tool.updated output/status events are written to stderr only, never
|
|
27
|
+
// entering stream-json.
|
|
28
28
|
// - assistant messages are only emitted when content OR tool_calls are
|
|
29
29
|
// non-empty; we still defend against the empty case for resilience.
|
|
30
30
|
export const MAX_STREAM_JSON_LINE_BYTES = 1_048_576;
|