kimi-plugin-cc 2.7.2 → 2.7.3
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 +9 -1
- package/README.md +8 -8
- package/agents/kimi-pursue.md +1 -1
- package/agents/kimi-swarm-write.md +4 -4
- package/agents/kimi-swarm.md +5 -5
- package/commands/swarm.md +3 -3
- package/dist/cli-client.js +1 -1
- package/dist/commands/setup.js +2 -2
- package/dist/commands/swarm.js +4 -4
- package/dist/hooks/approval-policy.js +1 -1
- package/dist/hooks/config-safety.js +4 -3
- package/dist/kimi-engine.js +2 -1
- package/dist/kimi-timeouts.js +1 -1
- package/dist/mcp/operations.js +1 -1
- package/dist/swarm-activation.js +12 -12
- package/dist/swarm-policy.js +1 -1
- package/dist/version.js +1 -1
- package/docs/migration.md +4 -4
- package/docs/registry-releases.md +3 -1
- package/docs/safety.md +15 -15
- package/docs/swarm-recovery.md +3 -3
- package/docs/upstream-2.7.2-certification.md +16 -2
- package/docs/upstream-2.7.3-certification.md +83 -0
- package/package.json +2 -1
- package/plugins/kimi-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/kimi-codex/dist/cli-client.js +1 -1
- package/plugins/kimi-codex/dist/commands/setup.js +2 -2
- package/plugins/kimi-codex/dist/commands/swarm.js +4 -4
- package/plugins/kimi-codex/dist/hooks/approval-policy.js +1 -1
- package/plugins/kimi-codex/dist/hooks/config-safety.js +4 -3
- package/plugins/kimi-codex/dist/kimi-engine.js +2 -1
- package/plugins/kimi-codex/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-codex/dist/mcp/operations.js +1 -1
- package/plugins/kimi-codex/dist/swarm-activation.js +12 -12
- package/plugins/kimi-codex/dist/swarm-policy.js +1 -1
- package/plugins/kimi-codex/dist/version.js +1 -1
- package/plugins/kimi-dsh/dist/cli-client.js +1 -1
- package/plugins/kimi-dsh/dist/commands/setup.js +2 -2
- package/plugins/kimi-dsh/dist/commands/swarm.js +4 -4
- package/plugins/kimi-dsh/dist/hooks/approval-policy.js +1 -1
- package/plugins/kimi-dsh/dist/hooks/config-safety.js +4 -3
- package/plugins/kimi-dsh/dist/kimi-engine.js +2 -1
- package/plugins/kimi-dsh/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-dsh/dist/mcp/operations.js +1 -1
- package/plugins/kimi-dsh/dist/swarm-activation.js +12 -12
- package/plugins/kimi-dsh/dist/swarm-policy.js +1 -1
- package/plugins/kimi-dsh/dist/version.js +1 -1
- package/plugins/kimi-dsh/package.json +1 -1
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 uses the no-plan construction on exact reviewed versions. The [runtime certification table](../runtime/kimi-engine.ts) controls routing and operation scope. Exact 2.6.0 remains limited to review, challenge, ask, rescue, review gate and pursue. Plugin 2.6.2 adds the bounded swarm construction described below for exact stock CLI 2.6.2; its [certification receipt](upstream-2.6.2-certification.md) records validation status. Plugin 2.6.3 certifies exact CLI 2.6.3 under the same construction with a separate [release receipt](upstream-2.6.3-certification.md); the immutable GitHub/npm release and fresh registry verification are complete. Plugin 2.7.2 certifies exact CLI 2.7.2 with separate [certification evidence](upstream-2.7.2-certification.md); publication does not update installed hosts or operator pins. Older full-operation rows through 2.5.3 retain their known rate-limit-recovery limitation. The hook is not an operating-system sandbox.
|
|
5
|
+
Native agent-core-v2 uses the no-plan construction on exact reviewed versions. The [runtime certification table](../runtime/kimi-engine.ts) controls routing and operation scope. Exact 2.6.0 remains limited to review, challenge, ask, rescue, review gate and pursue. Plugin 2.6.2 adds the bounded swarm construction described below for exact stock CLI 2.6.2; its [certification receipt](upstream-2.6.2-certification.md) records validation status. Plugin 2.6.3 certifies exact CLI 2.6.3 under the same construction with a separate [release receipt](upstream-2.6.3-certification.md); the immutable GitHub/npm release and fresh registry verification are complete. Plugin 2.7.2 certifies exact CLI 2.7.2 with separate [certification evidence](upstream-2.7.2-certification.md). Plugin 2.7.3 adds exact CLI 2.7.3 under the same construction with a separate [certification record](upstream-2.7.3-certification.md); publication does not update installed hosts or operator pins. Older full-operation rows through 2.5.3 retain their known rate-limit-recovery limitation. The hook is not an operating-system sandbox.
|
|
6
6
|
|
|
7
7
|
## Why the safety story is hook-based
|
|
8
8
|
|
|
@@ -220,30 +220,30 @@ If another installed host still points to an older hook, that hook may veto thes
|
|
|
220
220
|
- **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.
|
|
221
221
|
- **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`.
|
|
222
222
|
|
|
223
|
-
## Swarm activation on CLI 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.2, 2.6.3 and 2.7.
|
|
223
|
+
## Swarm activation on CLI 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.2, 2.6.3, 2.7.2 and 2.7.3
|
|
224
224
|
|
|
225
225
|
For interrupted runs, see [durable recovery and its explicit limits](swarm-recovery.md).
|
|
226
226
|
|
|
227
227
|
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.
|
|
228
228
|
|
|
229
|
-
For parallel paths requiring activation (exact 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2, 2.5.3 and 2.6.2/2.6.3/2.7.2), 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:
|
|
229
|
+
For parallel paths requiring activation (exact 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2, 2.5.3 and 2.6.2/2.6.3/2.7.2/2.7.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:
|
|
230
230
|
|
|
231
|
-
1. Earlier paths start `web --no-open --host 127.0.0.1 --port 0 --log-level error` and require the expected loopback ready URL with backend v2, exact planned version, and no auth bypass in `/api/v1/meta`. Exact 2.7.2 instead starts `web --json` with an in-memory ephemeral token, validates the loopback origin and `/api/v1/ws`, and requires KAP 1.0.0 plus WebSocket capability without a legacy backend field. The child environment sets `KIMI_CODE_SESSION_IDLE_RECLAIM_MS=0`, so ambient idle-session reclamation cannot disrupt the plugin-owned lifecycle. Tokens stay in memory and out of logs. 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; on exact 2.5.0/2.5.1/2.5.2/2.5.3 and the bounded 2.6.2/2.6.3/2.7.2 paths explicitly binds `environment_id:"local"` and the job cwd, then verifies that binding through authenticated `/environment` before either profile mutation; binds the selected model with `permission_mode:auto` and `swarm_mode:true`; verifies those settings and `plan_mode:false` through `/status` on earlier versions, protocol-v2 authenticated WebSocket state on 2.5.0/2.5.1/2.5.2/2.5.3, or direct-subscription state on 2.6.2/2.6.3/2.7.2; closes that channel before validating the latest frame; verifies clean shutdown; and requires the main journal's manual `swarm_mode.enter` record.
|
|
231
|
+
1. Earlier paths start `web --no-open --host 127.0.0.1 --port 0 --log-level error` and require the expected loopback ready URL with backend v2, exact planned version, and no auth bypass in `/api/v1/meta`. Exact 2.7.2/2.7.3 instead starts `web --json` with an in-memory ephemeral token, validates the loopback origin and `/api/v1/ws`, and requires KAP 1.0.0 plus WebSocket capability without a legacy backend field. The child environment sets `KIMI_CODE_SESSION_IDLE_RECLAIM_MS=0`, so ambient idle-session reclamation cannot disrupt the plugin-owned lifecycle. Tokens stay in memory and out of logs. 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; on exact 2.5.0/2.5.1/2.5.2/2.5.3 and the bounded 2.6.2/2.6.3/2.7.2/2.7.3 paths explicitly binds `environment_id:"local"` and the job cwd, then verifies that binding through authenticated `/environment` before either profile mutation; binds the selected model with `permission_mode:auto` and `swarm_mode:true`; verifies those settings and `plan_mode:false` through `/status` on earlier versions, protocol-v2 authenticated WebSocket state on 2.5.0/2.5.1/2.5.2/2.5.3, or direct-subscription state on 2.6.2/2.6.3/2.7.2/2.7.3; closes that channel before validating the latest frame; verifies clean shutdown; and requires the main journal's manual `swarm_mode.enter` record.
|
|
232
232
|
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.
|
|
233
|
-
3. After the print run, a second web lifecycle rechecks the local binding on 2.5.0/2.5.1/2.5.2/2.5.3/2.6.0/2.6.2/2.6.3/2.7.2, sets `swarm_mode:false`, verifies the version-appropriate state proof, 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.
|
|
233
|
+
3. After the print run, a second web lifecycle rechecks the local binding on 2.5.0/2.5.1/2.5.2/2.5.3/2.6.0/2.6.2/2.6.3/2.7.2/2.7.3, sets `swarm_mode:false`, verifies the version-appropriate state proof, 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.
|
|
234
234
|
|
|
235
235
|
Older certified versions keep the direct `kimi -p` path. The web processes are narrow, planned lifecycle helpers, not a second model runner and not a general RPC transport.
|
|
236
236
|
|
|
237
|
-
## Bounded swarm on exact CLI 2.6.2/2.6.3/2.7.2
|
|
237
|
+
## Bounded swarm on exact CLI 2.6.2/2.6.3/2.7.2/2.7.3
|
|
238
238
|
|
|
239
|
-
`--max-concurrency` defaults to 4 for read-only work and 1 for write work. On exact native-v2 2.6.2/2.6.3/2.7.2, the runtime chooses one of two paths:
|
|
239
|
+
`--max-concurrency` defaults to 4 for read-only work and 1 for write work. On exact native-v2 2.6.2/2.6.3/2.7.2/2.7.3, the runtime chooses one of two paths:
|
|
240
240
|
|
|
241
241
|
- **Two or more:** the canonical hook admits only waves whose fresh items plus resumed entries fit the requested concurrency. Forks, malformed requests and fresh singleton waves are denied. Group odd numbers of targets into at least two disjoint entries per fresh wave, or resume an existing child for the remaining work. The hard bound covers simultaneous Kimi child-agent turns, excluding their coordinator. Fresh children cannot activate another swarm; resumes stay within the new job's own session.
|
|
242
242
|
- **One:** a single worker runs directly in fresh print, without activating native swarm or launching children. Both delegation tools are denied. It keeps the same read-only restrictions or confined worktree writes and patch output.
|
|
243
243
|
|
|
244
244
|
The plugin forces `KIMI_CODE_SWARM_TIMEOUT_MS=2147483647` on bounded spawns, overriding saved or ambient short child timeouts. This value exceeds the plugin's maximum 24-hour job budget. A short native swarm-child timeout is unsafe here: it can return a wave result before a retry stops. A slow or stuck child therefore holds its wave until it completes or the finite whole-job budget or explicit cancellation stops the run. Environment value `0` is ignored upstream and is not used as a timeout override.
|
|
245
245
|
|
|
246
|
-
For the parallel path, the plugin disables `TaskStop` in its fresh owned native session after the activation web process has shut down and before print starts. The managed hook already denies that tool; disabling it in native policy also removes the complete `TaskList`/`TaskOutput`/`TaskStop` set that stock 2.6.2/2.6.3/2.7.2 requires for Bash backgrounding. This closes both explicit backgrounding and automatic detachment after a foreground timeout, whose completion could otherwise wake a finished child. The hook separately denies explicit `Bash.run_in_background:true` on both bounded paths. The escape monitor receives the same trusted wave policy as the hook; a native mode-off rejection on the direct-worker path can still be a harmless mismatch diagnostic, not proof of execution.
|
|
246
|
+
For the parallel path, the plugin disables `TaskStop` in its fresh owned native session after the activation web process has shut down and before print starts. The managed hook already denies that tool; disabling it in native policy also removes the complete `TaskList`/`TaskOutput`/`TaskStop` set that stock 2.6.2/2.6.3/2.7.2/2.7.3 requires for Bash backgrounding. This closes both explicit backgrounding and automatic detachment after a foreground timeout, whose completion could otherwise wake a finished child. The hook separately denies explicit `Bash.run_in_background:true` on both bounded paths. The escape monitor receives the same trusted wave policy as the hook; a native mode-off rejection on the direct-worker path can still be a harmless mismatch diagnostic, not proof of execution.
|
|
247
247
|
|
|
248
248
|
With parallel backgrounding disabled, native Bash uses a 60-second default foreground timeout and a 300-second maximum; commands that exceed their timeout are killed rather than detached. Use `--max-concurrency 1` for longer tests. That direct-worker path still permits native automatic timeout-to-background behavior, although explicit background requests are denied. Its root-agent turns remain sequential, and whole-job settlement still gates the result; the limit of one is an agent-turn bound, not a promise of one OS process.
|
|
249
249
|
|
|
@@ -255,17 +255,17 @@ Process-tree settlement applies on POSIX; Windows retains direct-child-only clea
|
|
|
255
255
|
|
|
256
256
|
`--cap` stays a soft lifetime-total hint, separate from concurrency. Sequential waves can process more targets than the concurrency limit. The finite budget bounds duration, not dollars or total tokens. This construction does not change the existing trust boundary for test runners or other allowed commands that execute repository code.
|
|
257
257
|
|
|
258
|
-
The construction is exact-version-specific. Older certified versions retain normal-launch limits and the inherited recovery overrun; exact 2.6.0 remains non-swarm-only. The upstream 2.6.2, 2.6.3 and 2.7.
|
|
258
|
+
The construction is exact-version-specific. Older certified versions retain normal-launch limits and the inherited recovery overrun; exact 2.6.0 remains non-swarm-only. The upstream 2.6.2, 2.6.3, 2.7.2 and 2.7.3 binaries are unmodified. Validation state and evidence are recorded in the [2.6.2 certification record](upstream-2.6.2-certification.md), [2.6.3 checkout record](upstream-2.6.3-certification.md), [2.7.2 checkout record](upstream-2.7.2-certification.md) and [2.7.3 checkout record](upstream-2.7.3-certification.md).
|
|
259
259
|
|
|
260
260
|
## Read-only swarm (`/kimi:swarm`)
|
|
261
261
|
|
|
262
262
|
`/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**.
|
|
263
263
|
|
|
264
|
-
- **The hook label is `swarm`, and it allows the read-only tool set PLUS `AgentSwarm`.** On parallel paths the coordinator may call an admitted `AgentSwarm`, but no write/edit/shell tool is allowed; the exact-2.6.2/2.6.3/2.7.2 direct-worker path denies delegation too. 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.
|
|
264
|
+
- **The hook label is `swarm`, and it allows the read-only tool set PLUS `AgentSwarm`.** On parallel paths the coordinator may call an admitted `AgentSwarm`, but no write/edit/shell tool is allowed; the exact-2.6.2/2.6.3/2.7.2/2.7.3 direct-worker path denies delegation too. 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.
|
|
265
265
|
- **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 parallel-path 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, 2.4.0, 2.4.1, 2.5.0, 2.5.1, 2.5.2 and 2.5.3, targeted controls also prove that direct OFF produces no children while the preactivated ON path produces the real child journals and denials.
|
|
266
266
|
- **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.
|
|
267
267
|
- **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.
|
|
268
|
-
- **Concurrency and total count are separate.** Every swarm has a finite `--budget` (default 30m). Exact 2.6.2/2.6.3/2.7.2 follows the bounded-wave/direct-worker construction above; `--max-concurrency` defaults to 4 for read-only work. Older certified binaries use `KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY` for normal launches on 0.18.0+ and can exceed it during rate-limit recovery. `--cap` is only a soft lifetime-total hint: a stateless per-wave guard does not make it a total-count limit. A time budget is not a dollar or token cap. Keep all three controls distinct.
|
|
268
|
+
- **Concurrency and total count are separate.** Every swarm has a finite `--budget` (default 30m). Exact 2.6.2/2.6.3/2.7.2/2.7.3 follows the bounded-wave/direct-worker construction above; `--max-concurrency` defaults to 4 for read-only work. Older certified binaries use `KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY` for normal launches on 0.18.0+ and can exceed it during rate-limit recovery. `--cap` is only a soft lifetime-total hint: a stateless per-wave guard does not make it a total-count limit. A time budget is not a dollar or token cap. Keep all three controls distinct.
|
|
269
269
|
- **A model-invocable `kimi-swarm` agent (v1.3) wraps this command.** The `/kimi:swarm` slash command is human-only (`disable-model-invocation: true`, the blanket convention for *all* commands), but the `kimi-swarm` subagent lets the main thread *dispatch* a read-only fan-out on its own judgement — the same human-command + model-invocable-agent split that `kimi-review`/`kimi-challenge`/`kimi-ask`/`kimi-rescue` already use. Swarm is a safe candidate for an agent precisely because it is **read-only (zero write surface)**: the only thing auto-dispatch adds is COST exposure, already bounded by the finite `--budget` and the version-specific `--max-concurrency` bound that defaults to 4 for read-only work — so an auto-dispatched fan-out is bounded by construction, not by ignorable agent prose (the agent additionally restricts backgrounding to explicit user requests). `/kimi:pursue` ALSO gains a model-invocable agent (`kimi-pursue`, v1.3 — see the Autonomous goal mode section above): it is write-capable, but auto-dispatch widens no write surface (the rescue workspace allowlist + the managed PreToolUse hook gate every tool call on every continuation turn, and it cannot mutate git state) and removes no bound (the mandatory `--budget` ceiling holds), so its agent path is exactly as confined as its command path. Because it is the plugin's highest-autonomy surface, its agent description demands an explicit hands-off-autonomy request and steers single bounded tasks to `kimi-rescue`.
|
|
270
270
|
|
|
271
271
|
## Write-capable swarm (`/kimi:swarm --write`)
|
|
@@ -277,9 +277,9 @@ The construction is exact-version-specific. Older certified versions retain norm
|
|
|
277
277
|
- **`coder` subagents really can write, and the hook is the sole boundary.** Verified at kimi-code 0.42.0: swarm subagents get their own eager external-hooks service under the standard before-execute channel — there is no deny-all path on the swarm route (the `btw` side-question path is separate). Write-swarm's `coder` subagents DO have edit tools, and the managed PreToolUse hook is the **only** write boundary — which is why the trusted-root confinement above is load-bearing and gated tightly.
|
|
278
278
|
- **The plugin never touches git; the main thread owns the merge.** Subagents cannot run git (allowlist denies mutation). The plugin captures the change set with `git add -N` (intent-to-add, so new files appear in the diff WITHOUT writing loose objects into the shared object DB) + `git diff --binary` (untruncated, applyable), writes it to a `swarm-write-<jobId>.patch` artifact, and prints the path. It does **not** `git apply`, commit, or move any ref — the user/main thread reviews the patch and applies it (`git apply <path>`). The worktree shares the main repo's object DB and refs, but no ref/HEAD is ever moved, so the user's repository state is untouched.
|
|
279
279
|
- **The patch is captured on every terminal path, before cleanup.** Success, cancel, budget-expiry, and failure all capture the (possibly partial) patch BEFORE `git worktree remove --force` discards the tree, so a cancelled run never silently loses the work the subagents already did. If capture itself fails, the job fails instead of completing and the worktree is retained with its path in the error details for recovery. That guarantee covers the plugin's own terminal paths, including `companion.sh cancel`. It does **not** cover a harness interrupt: Esc/TaskStop delivers SIGTERM then SIGKILL after ~1.35s (measured, process-group-wide), which is shorter than the 1500ms child escalation plus quiescence plus patch capture — so a hard interrupt can kill the companion mid-teardown and lose the patch. `companion.sh cancel` signals from a separate process not racing that deadline and is the work-preserving stop. Abandoned worktrees are retained, never age-deleted. Use the preview/apply recovery procedure in [swarm-recovery.md](swarm-recovery.md); uncertain ownership refuses automatic cleanup.
|
|
280
|
-
- **Gated tightly.** Requires an exact certified CLI (write mode additionally requires at least 0.18.0), a Git repository with committed HEAD, and a verified managed hook. A dirty-tree warning explains that the worktree starts from HEAD and does not contain uncommitted edits. Default concurrency 1 uses a direct worker on exact 2.6.2/2.6.3/2.7.2; larger values use bounded waves. Older certified versions retain normal-launch serialization with the disclosed recovery limitation. Disjoint targets remain prompt guidance, and Git mutation stays denied.
|
|
280
|
+
- **Gated tightly.** Requires an exact certified CLI (write mode additionally requires at least 0.18.0), a Git repository with committed HEAD, and a verified managed hook. A dirty-tree warning explains that the worktree starts from HEAD and does not contain uncommitted edits. Default concurrency 1 uses a direct worker on exact 2.6.2/2.6.3/2.7.2/2.7.3; larger values use bounded waves. Older certified versions retain normal-launch serialization with the disclosed recovery limitation. Disjoint targets remain prompt guidance, and Git mutation stays denied.
|
|
281
281
|
- **Required for final certification evidence on parallel paths.** `tests/runtime/real-binary-smoke.test.ts` runs the real `runSwarm --write` and requires the POSITIVE end-to-end: distinct child journals contain their assigned edits with `Write`/`Replaced` results on the same `toolCallId`, those child-authored changes land in the worktree and captured patch, the user's real tree is byte-identical + git-clean, and the worktree is cleaned up. A patch without per-call child provenance is not accepted as fan-out evidence. The NEGATIVE lane correlates each absolute out-of-root `path` and `toolCallId` with its managed denial. It is the check that catches `tool_input` field-name drift — `Write`/`Edit` carry `path`, not `file_path`, and reading the wrong key denies every real write silently.
|
|
282
|
-
- **The single-worker path needs separate evidence.** At concurrency 1 on exact 2.6.2/2.6.3/2.7.2, require fresh print with no web activation or child journals, managed delegation denials, a confined main-agent write captured in the patch, unchanged user tree, and cancellation/budget settlement. Coordinator-only patches are valid for this explicit path, never substitutes for parallel child evidence.
|
|
282
|
+
- **The single-worker path needs separate evidence.** At concurrency 1 on exact 2.6.2/2.6.3/2.7.2/2.7.3, require fresh print with no web activation or child journals, managed delegation denials, a confined main-agent write captured in the patch, unchanged user tree, and cancellation/budget settlement. Coordinator-only patches are valid for this explicit path, never substitutes for parallel child evidence.
|
|
283
283
|
- **Model-invocable agent (v1.5), patch-only by construction.** Following the field-proof above, `--write` now has a `kimi-swarm-write` subagent so the main thread can dispatch a write fan-out on its own judgement — the same human-command + model-invocable-agent split the rest of the suite uses. Auto-dispatch is a safe extension here because it widens **no** write surface and retains the documented bounds: the agent path runs the identical `runSwarm --write` code, so edits still land only in the throwaway worktree, the managed hook still gates every `coder` subagent, the patch is still handed back for the user to apply (**the plugin never applies or commits**), and `--budget` + default `--max-concurrency` 1 + the hook requirement still apply, with the rate-limit-recovery qualification above. In fact write-swarm is a *less* dangerous agent than the `kimi-pursue` agent already shipped: pursue writes directly into the workspace, whereas write-swarm's output is a patch the human reviews before anything reaches a real tree. Because it is still a write surface, the agent description demands BOTH signals — many disjoint write targets AND explicit fan-out intent — and steers single edits to `kimi-rescue`, read-only fan-outs to `kimi-swarm`, and autonomous loops to `kimi-pursue`. Default `--max-concurrency` stays **1**; raising it (concurrent writers) remains a deliberate, human-or-explicitly-requested choice.
|
|
284
284
|
|
|
285
285
|
## MCP transport and long-running jobs
|
|
@@ -322,7 +322,7 @@ worktree. A directory the operator trusted interactively in the Kimi TUI still
|
|
|
322
322
|
has that property; that persisted-trust route is a documented residual, not
|
|
323
323
|
something the plugin can close.
|
|
324
324
|
|
|
325
|
-
Plugin-managed execution must remain local. Unused remote declarations can remain in operator config, but a configured remote default refuses before spawn. Disabling workspace trust through `[workspace] require_trust = false` also refuses, because it would enable project MCP outside the managed hook. Launcher environment selectors are reserved. Fresh exact 2.5.0/2.5.1/2.5.2/2.5.3/2.6.0/2.6.2/2.6.3/2.7.2 print selects `--environment local`; resume instead inspects persisted metadata and every agent journal and refuses nonlocal or wrong-root records against the expected execution root (the isolated worktree for swarm-write); older sessions without environment records do not fail this check merely for lacking them.
|
|
325
|
+
Plugin-managed execution must remain local. Unused remote declarations can remain in operator config, but a configured remote default refuses before spawn. Disabling workspace trust through `[workspace] require_trust = false` also refuses, because it would enable project MCP outside the managed hook. Launcher environment selectors are reserved. Fresh exact 2.5.0/2.5.1/2.5.2/2.5.3/2.6.0/2.6.2/2.6.3/2.7.2/2.7.3 print selects `--environment local`; resume instead inspects persisted metadata and every agent journal and refuses nonlocal or wrong-root records against the expected execution root (the isolated worktree for swarm-write); older sessions without environment records do not fail this check merely for lacking them.
|
|
326
326
|
|
|
327
327
|
## Running a newer Kimi than the plugin certifies
|
|
328
328
|
|
|
@@ -344,7 +344,7 @@ Both binaries share `~/.kimi-code` (login, config, hook), so nothing else
|
|
|
344
344
|
changes. The full-operation certified maximum can be read from the installed
|
|
345
345
|
plugin (`NATIVE_V2_CERTIFIED_VERSIONS` in `dist/kimi-engine.js`), which lets an
|
|
346
346
|
upgrade script bump the full-swarm pin automatically after each full-operation
|
|
347
|
-
certification. That export excludes narrowed releases such as 2.6.0 and includes exact 2.6.2/2.6.3/2.7.2
|
|
347
|
+
certification. That export excludes narrowed releases such as 2.6.0 and includes exact 2.6.2/2.6.3/2.7.2/2.7.3
|
|
348
348
|
under its certified bounded-swarm construction. `NATIVE_V2_ANY_OPERATION_VERSIONS`
|
|
349
349
|
is the separate scoped union, so an automatic full-swarm pin does not silently
|
|
350
350
|
become a non-swarm-only pin.
|
package/docs/swarm-recovery.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
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, 2.3.3, 2.4.0, 2.4.1 and 2.5.0/2.5.1/2.5.2/2.5.3 swarm runs, plus exact-2.6.2/2.6.3/2.7.2 parallel runs, 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 web authentication tokens, credentials, prompts or config contents. Session identity is committed before enabling swarm mode. The exact-2.6.2/2.6.3/2.7.2 concurrency-1 path starts a direct worker without a mutable swarm session, so it does not create an activation-recovery record; normal cancellation and patch capture still apply.
|
|
5
|
+
For exact CLI 2.3.2, 2.3.3, 2.4.0, 2.4.1 and 2.5.0/2.5.1/2.5.2/2.5.3 swarm runs, plus exact-2.6.2/2.6.3/2.7.2/2.7.3 parallel runs, 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 web authentication tokens, credentials, prompts or config contents. Session identity is committed before enabling swarm mode. The exact-2.6.2/2.6.3/2.7.2/2.7.3 concurrency-1 path starts a direct worker without a mutable swarm session, so it does not create an activation-recovery record; normal cancellation and patch capture still apply.
|
|
6
6
|
|
|
7
|
-
Exact-2.6.2/2.6.3/2.7.2 parallel sessions retain their native `TaskStop`-disabled policy after normal deactivation or recovery. Recovery does not remove it. The bounded construction covers the managed job; resuming that historical session interactively through another client is outside its certification.
|
|
7
|
+
Exact-2.6.2/2.6.3/2.7.2/2.7.3 parallel sessions retain their native `TaskStop`-disabled policy after normal deactivation or recovery. Recovery does not remove it. The bounded construction covers the managed job; resuming that historical session interactively through another client is outside its certification.
|
|
8
8
|
|
|
9
9
|
The exact 2.6.0 swarm integration is candidate-only: the narrowed 2.6.0 non-swarm certification excludes both swarm operations and does not certify this recovery path. Recovery canonicalizes `record.cwd` only for session deactivation through symlinked execution parents. Ownership, workspace, and patch checks continue to use the original recorded alias.
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ Preview does not signal processes, modify sessions, or capture patches. Apply:
|
|
|
21
21
|
|
|
22
22
|
1. Requires the original companion to be gone and acquires an identity-checked recovery claim. A second recovery cannot race the first; a dead recovery owner can be reclaimed by compare-and-swap.
|
|
23
23
|
2. Revalidates recorded processes and groups. It stops only verified individual identities, never a guessed PID or unproven group. An unknown surviving group member, changed group, incomplete probe or unrecorded launch refuses recovery.
|
|
24
|
-
3. If session cleanup is pending, requires the selected exact certified CLI and valid managed hook. It starts one bounded authenticated web lifecycle, disables the recorded session's swarm mode, verifies the version-appropriate state proof and exit journal, then verifies process quiescence. On 2.5.0/2.5.1/2.5.2/2.5.3 this includes the local environment binding and protocol-v2 WebSocket main-agent state rather than `/status`. On exact 2.6.2/2.6.3/2.7.2 parallel sessions it uses authenticated direct-subscription state proof and the same local binding checks. It does not resume a prompt, generate model output, install hooks or retry failed cleanup automatically. New recovery web launches are themselves journaled. Deactivation uses the realpath of `record.cwd`; the original recorded alias remains the ownership, workspace, and patch-check boundary.
|
|
24
|
+
3. If session cleanup is pending, requires the selected exact certified CLI and valid managed hook. It starts one bounded authenticated web lifecycle, disables the recorded session's swarm mode, verifies the version-appropriate state proof and exit journal, then verifies process quiescence. On 2.5.0/2.5.1/2.5.2/2.5.3 this includes the local environment binding and protocol-v2 WebSocket main-agent state rather than `/status`. On exact 2.6.2/2.6.3/2.7.2/2.7.3 parallel sessions it uses authenticated direct-subscription state proof and the same local binding checks. It does not resume a prompt, generate model output, install hooks or retry failed cleanup automatically. New recovery web launches are themselves journaled. Deactivation uses the realpath of `record.cwd`; the original recorded alias remains the ownership, workspace, and patch-check boundary.
|
|
25
25
|
4. Captures a binary patch from a retained write worktree. It does not apply the patch or delete the tree. The result names both paths for inspection.
|
|
26
26
|
|
|
27
27
|
The recovery attempt has a 30-second cancellation signal, with bounded identity probes and normal teardown. Interrupting recovery retains its journal. An already-recovered record is an idempotent no-op. Failed/cancelled/completed job outcomes are immutable; a previously running abandoned job becomes failed, never completed. Recovery status is separate from task success.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Scope and decision
|
|
4
4
|
|
|
5
|
-
**Status: certified for all eight operations
|
|
5
|
+
**Status: certified and published for all eight operations.** Exact `@moonshot-ai/kimi-code@2.7.2` passed the source, exact-binary, deterministic stock-binary, real-provider candidate and production-table operation gates. Certification was completed before release authorization. Plugin 2.7.2 release commit `e2bba0e2d4e1745e4155eb5c6ddf3f4dabaffb66` passed release CI `44799772434`; the immutable GitHub release, recovery npm OIDC run `44803040496`, and fresh registry/attestation verification are complete. Neither certification nor publication updates installed hosts or operator pins.
|
|
6
6
|
|
|
7
7
|
Exact source commit: `56145f849caa305d42acd09b67fb65d11146f887` (annotated tag object `1781dbd74bc7fabf23ac4721a570397f278817f1`). The isolated npm binary reports 2.7.2; `dist/main.mjs` SHA-256 is `dafef22f56c4c1fff755eb3af5e42a76d32d09a9dc858ebdc055a6d1a6008e67`. npm `latest` was rechecked as 2.7.2 during the production gate.
|
|
8
8
|
|
|
@@ -92,7 +92,21 @@ Full repository, package, consumer-security, and final independent code/document
|
|
|
92
92
|
- **Consumer security:** PASS, exit 0. `bun run check:consumer-security` verified the isolated npm consumer security of `kimi-plugin-cc@2.7.2`. Receipt: `.claude/kimi-code-research/release-2.7.2/consumer-security.log`.
|
|
93
93
|
- **Independent release-diff review:** PASS after correction. The reviewer found the stale 2.6.3 version headline in `docs/invariants.md`; it was corrected to 2.7.2. No other release-blocking finding was returned.
|
|
94
94
|
|
|
95
|
-
Release
|
|
95
|
+
## Release and registry receipt
|
|
96
|
+
|
|
97
|
+
Release commit `e2bba0e2d4e1745e4155eb5c6ddf3f4dabaffb66` passed release CI run `44799772434`, including both Linux/full-package and Windows jobs. The immutable [v2.7.2 GitHub release](https://github.com/linxule/kimi-plugin-cc/releases/tag/v2.7.2) is anchored at that commit with annotated tag object `cdbd0d179a8fafd41019230a655887e035453670`.
|
|
98
|
+
|
|
99
|
+
Initial OIDC run `44801159950` passed the full tag build, package/DSH checks, consumer audit and artifact upload, but npm rejected publication with `TLOG_CREATE_ENTRY_ERROR`; registry inspection confirmed it published nothing. The documented manual-dispatch recovery [run 44803040496](https://github.com/linxule/kimi-plugin-cc/actions/runs/44803040496) validated the same immutable tag and published npm `latest` 2.7.2 at `2026-11-20T19:44:23.172Z`.
|
|
100
|
+
|
|
101
|
+
The **342-file** registry tarball is byte-identical to the successful Actions artifact, and every published file matches the release tag:
|
|
102
|
+
|
|
103
|
+
- SHA-1: `c78a89fa5ea199c6605c7453ca50b2c23ee3cb3f`
|
|
104
|
+
- SHA-256: `0a0bcba76513adac3448776d4f8df9ec73b60987edac0ca5e6535db428b91f33`
|
|
105
|
+
- SHA-512: `2e7dfe8043c2c05447a28dbfc17c6124c6b08444efb864c5b5f5f3f586f338ff4b77d35e3b769168b570a32c08bec48e8f78aa6e11b958e9f22257cda29616f1`
|
|
106
|
+
|
|
107
|
+
SLSA provenance log index `4028226284` and publish attestation log index `4028244850` match the package subject, SHA-512, recovery run and release commit. Their workflow ref is `refs/heads/main` because recovery used `workflow_dispatch`; the artifact and all published bytes independently match `refs/tags/v2.7.2`. Fresh registry installation has zero production advisories and no invalid or missing signatures. Isolated Claude Code, Codex and DSH setup/check pass against exact stock CLI 2.7.2, and all three installed runtime maps enforce full 2.7.2 certification with 2.6.0 non-swarm-only scope. Verification made no model calls and changed no installed host or operator pin. Receipts are under `.claude/kimi-code-research/release-2.7.2/registry/`.
|
|
108
|
+
|
|
109
|
+
The post-publication DSH Discover timestamp is `1795203863`, recording the actual npm publication time.
|
|
96
110
|
|
|
97
111
|
## Residual boundaries
|
|
98
112
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Exact CLI 2.7.3 certification — plugin 2.7.3
|
|
2
|
+
|
|
3
|
+
## Scope and decision
|
|
4
|
+
|
|
5
|
+
**All eight operation gates and the full local repository check pass for plugin 2.7.3.** Exact `@moonshot-ai/kimi-code@2.7.3` passed the source, exact-binary, deterministic stock-binary, real-provider candidate and production-table operation gates. Certification is separate from release authorization. CI, GitHub and npm publication receipts are recorded only after those steps complete; neither certification nor publication updates installed hosts or operator pins.
|
|
6
|
+
|
|
7
|
+
Exact source commit: `a8f643ad2e7f197d6ec4409b7cdad8a544afad86` (annotated tag object `f27c2321c7eabafc00ad8581b12a4d60138bc6ac`). A fresh isolated npm binary reports 2.7.3; `dist/main.mjs` SHA-256 is `747dbb1fd3ad0789194e0181cfaf036a795c8c6d6b3a9204c152aee8db10de16`. npm `latest` was rechecked as 2.7.3 during certification.
|
|
8
|
+
|
|
9
|
+
## Monitor verification and correction
|
|
10
|
+
|
|
11
|
+
The 2026-11-24 Codex monitor correctly held the production pin at 2.7.2 after its authorized 2.7.3 candidate smoke exited 1 with **23 pass / 6 skip / 3 fail / 217 assertions**. It observed no hook bypass or user-worktree write. The three failures were missing real-child or child-patch evidence, not a demonstrated upstream scheduler regression.
|
|
12
|
+
|
|
13
|
+
The cause was candidate-harness coverage: candidate-only operation admission included 2.7.3, but preactivation and bounded-policy selectors did not. Fresh sessions therefore remained swarm-off, and the four bounded single-worker/wave cases skipped. The separate certification pass reviewed the changed KAP behavior, corrected those selectors, and reran the complete matrix. The monitor smoke itself was not retried.
|
|
14
|
+
|
|
15
|
+
## Source audit
|
|
16
|
+
|
|
17
|
+
The pristine exact 2.7.3 source was archived from the verified tag and compared with exact 2.7.2 through all nine playbook scopes plus related auth/attribution and upstream-test diffs. CLI print, before-execute/permissions, external hooks, plan/restore, session bootstrap/config, tools/fan-out/SDK, and OS/remote/DI scopes are byte-empty. Only KAP/web activation and loop attribution changed.
|
|
18
|
+
|
|
19
|
+
The review establishes:
|
|
20
|
+
|
|
21
|
+
- the active-plan guard remains the only production final `allow()` across agent-core, shared core, CLI, KAP, SDK, Klient and ACP;
|
|
22
|
+
- executor construction/order, eager per-child hooks, first-block-wins aggregation, tool input fields and local/trust boundaries are unchanged;
|
|
23
|
+
- no new model-reachable plan entry exists; host-only plan entry and raw resume journal closures remain mandatory;
|
|
24
|
+
- optional `replyModel` and `modelSteps` extend the existing `TurnEnded` journal payload without changing print-mode stream-json;
|
|
25
|
+
- authenticated feedback routes and the optional `/meta` feedback capability are host-only additions on the short-lived activation server, which shuts down before print;
|
|
26
|
+
- missing configured main-agent models are reported as unset, with a `model.not_configured` notice after history; activation's existing expected-model check therefore fails closed, while other config errors and subagent errors still throw;
|
|
27
|
+
- native scheduler/recovery behavior is unchanged, so no upstream concurrency fix is claimed.
|
|
28
|
+
|
|
29
|
+
The unmodified scan reproduced **18 pass / 15 skip / 5 fail / 72 assertions**: one missing pin row, four stale exact-version branches, and the omitted bounded suite. The final row has **159 pins**, updating all eight changed inherited files and adding six reviewed attribution/model/conversation helpers. Final exact 2.7.3 scan: **38 pass / 0 fail / 0 skip / 533 assertions**. Exact 2.7.2 regression: **38 pass / 0 fail / 0 skip / 527 assertions**.
|
|
30
|
+
|
|
31
|
+
## Exact-binary controls
|
|
32
|
+
|
|
33
|
+
All controls ran sequentially against the fresh isolated binary. Real-model controls used the dedicated Agent Keys environment-model route and fresh absolute-path homes; personal config and credential stores were neither read nor linked.
|
|
34
|
+
|
|
35
|
+
- **Plan OFF:** ordinary Write reached the deny hook, returned `cert-control: denied` on the same call, created no file, recorded no plan state, and emitted exact first-line `system.version` 2.7.3.
|
|
36
|
+
- **Deliberately armed plan ON:** authenticated JSON/KAP activation armed an isolated session. Glob was denied; Write created a **1,762-byte plan file without a plan-Write hook**. No workspace file was created, proving the no-plan closures remain load-bearing.
|
|
37
|
+
- **Forced EnterPlanMode:** the tool was absent from offered tools. Scripted `call_enter_forced` returned `Tool "EnterPlanMode" not found` before any hook, was returned to the provider, and created no plan journal or file.
|
|
38
|
+
- **Environment:** real JSON activation/deactivation passed. A configured remote default refused before its launcher ran, disabled workspace trust refused, and a resumed nonlocal binding refused.
|
|
39
|
+
|
|
40
|
+
Receipts are `write-off-absolute/summary.json`, `plan-on/summary.json`, `enter-off-forced/summary.json`, and `environment-controls/summary.json` under `.claude/kimi-code-research/cert-2.7.3-live/`.
|
|
41
|
+
|
|
42
|
+
## Deterministic and real-provider operation evidence
|
|
43
|
+
|
|
44
|
+
The deterministic untouched-binary suite passed **23 tests / 138 assertions in 615.18 seconds**. It covers real new/resumed/odd waves, child-authored writes and patches, explicit/automatic background controls, direct workers, nested-profile refusal, timeout and cancellation tails, and both long recovery controls. `recovery-429` took 201.66 seconds; `recovery-context` took 201.01 seconds. Both recovery controls produced four children, peaked at three active child turns and settled all turns. Implementation fingerprints were unchanged at launch and settlement.
|
|
45
|
+
|
|
46
|
+
The real-provider candidate matrix passed **30 tests / 402 assertions in 407.70 seconds**, with only the two inapplicable narrowed-refusal skips. The production-table matrix independently passed **30 tests / 402 assertions in 411.76 seconds**, with the same skips and no candidate override. Both used dedicated environment-model authentication and empty temporary seed homes.
|
|
47
|
+
|
|
48
|
+
Evidence includes:
|
|
49
|
+
|
|
50
|
+
- same-call managed Write denials for review, challenge, ask and review_gate;
|
|
51
|
+
- confined rescue writing and separate absolute out-of-root `Bash.cwd` denial;
|
|
52
|
+
- unsafe experimental, default-plan and plan-tainted resume refusals;
|
|
53
|
+
- real multi-turn goal denials and both pursue terminal controls;
|
|
54
|
+
- real read-only child denials and write-swarm child edits with a **278-byte patch**, clean user tree and cleaned worktree;
|
|
55
|
+
- real out-of-worktree child Write denials;
|
|
56
|
+
- direct single-worker read/write with no children or web activation, including **348-byte** candidate and production direct-write patches;
|
|
57
|
+
- directed recovery from an oversized wave, then two bounded waves with four children and candidate/production patches of **708/680 bytes**;
|
|
58
|
+
- uncoached five-target work at width four: one accepted wave, three children, peak three, zero coordinator-authored targets, and candidate/production patches of **899/843 bytes**. Grouping multiple targets into one child is valid; one child per target is not required.
|
|
59
|
+
|
|
60
|
+
All retained bounded jobs contain exact 2.7.3 version/marker evidence, terminal completion, no hook-escape findings and verified cleanup. Candidate evidence is under `candidate-live-evidence/`; production evidence is under `production-live-evidence/`.
|
|
61
|
+
|
|
62
|
+
## Focused implementation and emitted-runtime checks
|
|
63
|
+
|
|
64
|
+
- Candidate source/type checks: **403 focused runtime tests / 1,449 assertions**, plus typecheck; the 21 skips are ordinary opt-in real-binary lanes outside that unit run.
|
|
65
|
+
- Promoted engine/setup/compiled policy/recovery suites: **180 pass / 6,094 assertions**, including exact 2.7.3 schema acceptance, neighboring-version refusal, all three emitted runtime maps and durable hard-kill recovery.
|
|
66
|
+
- Contract-size and generated-surface checks: PASS.
|
|
67
|
+
|
|
68
|
+
Exact 2.7.2 and 2.7.3 use `web --json` with an in-memory ephemeral token, strict loopback origin and matching `/api/v1/ws`, KAP 1.0.0 and WebSocket capability, exact server version, and no auth bypass or legacy backend field. Older ready/meta formats are unchanged. Fresh print explicitly selects `--environment local`; resume never receives that flag. Bounded policy, preactivation, direct-worker selection, additive schema acceptance and durable recovery use exact versions with no 2.7.x range inheritance. Exact 2.7.0, 2.7.1 and 2.7.4 remain excluded.
|
|
69
|
+
|
|
70
|
+
## Certification validation
|
|
71
|
+
|
|
72
|
+
- **Frozen install:** PASS. `bun install --frozen-lockfile` completed with no changes.
|
|
73
|
+
- **Full repository gate.** `bun run check` exited 0, including the generated-file drift check. The suite reported **1,878 passed, 83 skipped, 0 failed and 24,758 assertions** across 96 files in 997.07 seconds. See `full-check-04.log` under `.claude/kimi-code-research/cert-2.7.3-live/`.
|
|
74
|
+
- **Earlier failures.** Three full runs stopped in the 2.3.2 swarm cleanup test. The one-second whole-job deadline could expire before the mock server received the deactivation request. The same assertion failed on unmodified HEAD. The corrected cleanup test allows time for process startup and uses print and status delays whose sum exceeds the job budget. The print-timeout test also allows time for activation. The error-precedence test now forces a cleanup REST failure after print exits with code 7. All three passed together and in the full suite. The original failures are in `full-check-01.log` through `full-check-03.log`, with the focused verification in `cleanup-three-focused.log`.
|
|
75
|
+
- **Package and DSH:** PASS. `bun run check:package` verified the **343-file** `kimi-plugin-cc@2.7.3` archive, all three compiled distributions, isolated hook setup/check and version refusal, the patched DSH host/profile, seven live providers/tools, and Web boot. Receipt: `package-check.log`.
|
|
76
|
+
- **Consumer security:** PASS. `bun run check:consumer-security` verified the isolated npm consumer security of `kimi-plugin-cc@2.7.3`. Receipt: `consumer-security.log`.
|
|
77
|
+
- **Final diff review:** no runtime defect, stale current exclusion, duplicate version list or generated-surface drift was found.
|
|
78
|
+
|
|
79
|
+
Release-commit CI, tagging, GitHub and npm publication, and registry attestation verification remain pending.
|
|
80
|
+
|
|
81
|
+
## Residual boundaries
|
|
82
|
+
|
|
83
|
+
The concurrency bound covers simultaneous Kimi child-agent turns, excluding the coordinator and OS subprocess counts. `--cap` remains a soft lifetime-total hint, and a finite time budget is not a spend cap. Upstream rate-limit recovery can still exceed its native setting; the plugin-owned bound is required. Parallel sessions retain the native TaskStop restriction after deactivation, and later external interactive resume is outside this certification. Stream-json still lacks a general execution-outcome field, so hook-escape findings remain detection evidence rather than a failure signal. `KIMI_CODE_NO_AUTO_UPDATE=1` suppresses passive updates but does not prevent every manually staged native replacement; exact probe and first-line marker checks remain the mismatch backstop, not rollback. Trusted operator config/journals, upstream hook-runner fail-open behavior, host-only plan routes and repository Git helpers retain their existing boundaries.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimi-plugin-cc",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"description": "Kimi for Claude Code, Codex, and DeepSeek Harness: 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
|
"main": "dist/dsh/index.js",
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"docs/upstream-2.6.2-certification.md",
|
|
143
143
|
"docs/upstream-2.6.3-certification.md",
|
|
144
144
|
"docs/upstream-2.7.2-certification.md",
|
|
145
|
+
"docs/upstream-2.7.3-certification.md",
|
|
145
146
|
"README.md",
|
|
146
147
|
"LICENSE",
|
|
147
148
|
"CHANGELOG.md",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kimi",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
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"
|
|
@@ -966,7 +966,7 @@ function buildArgs(opts) {
|
|
|
966
966
|
? opts.env.KIMI_PLUGIN_CC_SMOKE_V2_CANDIDATE
|
|
967
967
|
: undefined;
|
|
968
968
|
if (opts.resumeSessionId === undefined &&
|
|
969
|
-
["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
969
|
+
["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
970
970
|
args.push("--environment", "local");
|
|
971
971
|
}
|
|
972
972
|
if (opts.resumeSessionId !== undefined) {
|
|
@@ -977,12 +977,12 @@ async function collectKimiVersionWarnings(env, warnings) {
|
|
|
977
977
|
warnings.push(formatVersionOutOfRangeWarning(probe, KIMI_PLUGIN_CC_VERSION, NATIVE_V2_ANY_OPERATION_VERSIONS));
|
|
978
978
|
return;
|
|
979
979
|
}
|
|
980
|
-
if (probe.version === "2.6.2" || probe.version === "2.6.3" || probe.version === "2.7.2") {
|
|
980
|
+
if (probe.version === "2.6.2" || probe.version === "2.6.3" || probe.version === "2.7.2" || probe.version === "2.7.3") {
|
|
981
981
|
warnings.push(`NOTE: kimi-code ${probe.version} is certified for all operations. Swarm uses bounded waves with concurrency 2 or more, and one direct worker at concurrency 1. The finite job budget stops the whole run.`);
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
984
984
|
if (NATIVE_V2_NON_SWARM_VERSIONS.includes(probe.version)) {
|
|
985
|
-
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 on this exact release. Select exact kimi-code 2.6.2, 2.6.3 or 2.7.
|
|
985
|
+
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 on this exact release. Select exact kimi-code 2.6.2, 2.6.3, 2.7.2 or 2.7.3 for this plugin's certified bounded waves and single-worker path.`);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
/**
|
|
@@ -24,7 +24,7 @@ import { buildKimiSessionTitle, syncKimiSessionTitle } from "../session-title.js
|
|
|
24
24
|
import { usesBoundedSwarmPolicy } from "../swarm-policy.js";
|
|
25
25
|
// /kimi:swarm — parallel fan-out, read-only by default and runtime-foreground-only.
|
|
26
26
|
// A finite wall-clock budget bounds the whole run. --cap is a SOFT total-count
|
|
27
|
-
// prompt hint. Exact native-v2 2.6.2/2.6.3/2.7.2 bounds admitted waves and prevents native
|
|
27
|
+
// prompt hint. Exact native-v2 2.6.2/2.6.3/2.7.2/2.7.3 bounds admitted waves and prevents native
|
|
28
28
|
// child timeouts from returning a continuing coordinator before children stop.
|
|
29
29
|
// Concurrency 1 uses a direct worker without native fan-out. Older versions keep
|
|
30
30
|
// their normal-launch setting and inherited recovery limitation. Read/write
|
|
@@ -34,14 +34,14 @@ import { usesBoundedSwarmPolicy } from "../swarm-policy.js";
|
|
|
34
34
|
// 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,
|
|
35
35
|
// and certified 2.5.3 activate a same-job session through a bounded loopback
|
|
36
36
|
// web lifecycle, then resume it through the normal print path. 2.6.2/2.6.3 parallel
|
|
37
|
-
// waves, 2.7.2 JSON-authenticated waves, and candidate-only 2.6.0 use that lifecycle too. The per-operation certification
|
|
37
|
+
// waves, 2.7.2/2.7.3 JSON-authenticated waves, and candidate-only 2.6.0 use that lifecycle too. The per-operation certification
|
|
38
38
|
// table controls whether each exact version is reachable in production.
|
|
39
39
|
const SWARM_SUMMARY_MAX = 120;
|
|
40
40
|
const SWARM_AGENT_PROFILE = "<swarm>";
|
|
41
41
|
const SWARM_WRITE_AGENT_PROFILE = "<swarm-write>";
|
|
42
42
|
/**
|
|
43
43
|
* Default concurrency setting when the user passes no `--max-concurrency`.
|
|
44
|
-
* Exact native-v2 2.6.2/2.6.3/2.7.2 also enforces this as the admitted wave size. The plugin exports
|
|
44
|
+
* Exact native-v2 2.6.2/2.6.3/2.7.2/2.7.3 also enforces this as the admitted wave size. The plugin exports
|
|
45
45
|
* KIMI_CODE_AGENT_SWARM_MAX_CONCURRENCY; older read-only swarms ignore it and
|
|
46
46
|
* retain only the wall-clock hard bound. Rate-limit recovery can exceed it on
|
|
47
47
|
* older reviewed sources; their setting is not an unconditional peak guarantee.
|
|
@@ -57,7 +57,7 @@ export function resolveSwarmMaxConcurrency(requested) {
|
|
|
57
57
|
return requested ?? SWARM_DEFAULT_MAX_CONCURRENCY;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
* Default concurrency for WRITE mode — 1 vs read's 4. Exact native-v2 2.6.2/2.6.3/2.7.2
|
|
60
|
+
* Default concurrency for WRITE mode — 1 vs read's 4. Exact native-v2 2.6.2/2.6.3/2.7.2/2.7.3
|
|
61
61
|
* runs one direct worker; older versions serialize normal child launches but
|
|
62
62
|
* retain the rate-limit recovery overrun. Disjoint-target partitioning remains
|
|
63
63
|
* prompt-only when parallel workers are explicitly requested.
|
|
@@ -146,7 +146,7 @@ export function decideHookOutcomePure(input, ctx) {
|
|
|
146
146
|
// AgentSwarm are allowed and the singular Agent stays denied. This adds
|
|
147
147
|
// no direct tool-write permission within the repository/Git trust
|
|
148
148
|
// boundary: read-only Git context commands still trust repository Git
|
|
149
|
-
// configuration and can execute configured helpers. Exact 2.6.2/2.6.3/2.7.2 waves
|
|
149
|
+
// configuration and can execute configured helpers. Exact 2.6.2/2.6.3/2.7.2/2.7.3 waves
|
|
150
150
|
// pass the admission guard above; fresh children cannot activate swarm
|
|
151
151
|
// mode. Older paths retain their inherited scheduler limitations.
|
|
152
152
|
if (READ_ONLY_TOOLS.has(toolName) || toolName === AGENT_SWARM_TOOL) {
|
|
@@ -597,8 +597,8 @@ function validateVersionSensitiveEvents(events, version) {
|
|
|
597
597
|
// 2.3.0 (b5e28fd6), 2.3.1 (684bae9e), 2.3.2 (b8dd3a13), 2.3.3 (ec495f0c),
|
|
598
598
|
// 2.4.0 (f26e4d91), 2.4.1 (2c73f3f5), 2.5.0 (41c34143), 2.5.1 (1b02030d),
|
|
599
599
|
// 2.5.2 (1c142a00), 2.5.3 (5af9942e), 2.6.0 (740d6c0b), 2.6.2
|
|
600
|
-
// (6a8493df), 2.6.3 (b0de2fbd),
|
|
601
|
-
// and HookDefSchema are unchanged. Schema acceptance does not certify operations.
|
|
600
|
+
// (6a8493df), 2.6.3 (b0de2fbd), 2.7.2 (56145f84), and 2.7.3 (a8f643ad):
|
|
601
|
+
// the additive events and HookDefSchema are unchanged. Schema acceptance does not certify operations.
|
|
602
602
|
// Require the full version string AND matching components; no inferred 2.x compatibility.
|
|
603
603
|
if (version.major === 2 && ((version.minor === 0 && ((version.version === "2.0.0" && version.patch === 0) ||
|
|
604
604
|
(version.version === "2.0.1" && version.patch === 1) ||
|
|
@@ -619,7 +619,8 @@ function validateVersionSensitiveEvents(events, version) {
|
|
|
619
619
|
(version.minor === 6 && ((version.version === "2.6.0" && version.patch === 0) ||
|
|
620
620
|
(version.version === "2.6.2" && version.patch === 2) ||
|
|
621
621
|
(version.version === "2.6.3" && version.patch === 3))) ||
|
|
622
|
-
(version.minor === 7 && version.version === "2.7.2" && version.patch === 2)
|
|
622
|
+
(version.minor === 7 && ((version.version === "2.7.2" && version.patch === 2) ||
|
|
623
|
+
(version.version === "2.7.3" && version.patch === 3))))) {
|
|
623
624
|
return { valid: true };
|
|
624
625
|
}
|
|
625
626
|
if (version.major !== 0) {
|
|
@@ -52,6 +52,7 @@ export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([
|
|
|
52
52
|
"2.6.2",
|
|
53
53
|
"2.6.3",
|
|
54
54
|
"2.7.2",
|
|
55
|
+
"2.7.3",
|
|
55
56
|
]);
|
|
56
57
|
/**
|
|
57
58
|
* Exact releases certified only for review, challenge, ask, rescue, review_gate
|
|
@@ -571,7 +572,7 @@ function nativeV2NotCertified(operationKind, version) {
|
|
|
571
572
|
if (normalized !== undefined &&
|
|
572
573
|
NATIVE_V2_NON_SWARM_VERSIONS.includes(normalized) &&
|
|
573
574
|
(operationKind === "swarm" || operationKind === "swarm-write")) {
|
|
574
|
-
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 native rate-limit recovery can exceed AgentSwarm's configured maximum, so this exact release refuses swarm before model spawn. Select exact kimi-code 2.6.2, 2.6.3 or 2.7.
|
|
575
|
+
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 native rate-limit recovery can exceed AgentSwarm's configured maximum, so this exact release refuses swarm before model spawn. Select exact kimi-code 2.6.2, 2.6.3, 2.7.2 or 2.7.3 for this plugin's certified bounded waves and single-worker path, or use a non-swarm operation on ${normalized}.`, "kimi-engine.capability", {
|
|
575
576
|
details: {
|
|
576
577
|
refusal_kind: "v2-swarm-not-certified",
|
|
577
578
|
certification_scope: "non-swarm",
|
|
@@ -23,7 +23,7 @@ export const KIMI_PURSUE_DEFAULT_BUDGET_MS = 2_700_000; // 45 minutes
|
|
|
23
23
|
* Swarm (read-only parallel fan-out) DEFAULT wall-clock ceiling when the user
|
|
24
24
|
* passes no `--budget`. Read-only swarm opens no write surface, so the only new
|
|
25
25
|
* risk is cost/runaway from repeated model work. This AbortController bounds
|
|
26
|
-
* the whole job; `--cap` remains a soft lifetime-count hint. Exact 2.6.2/2.6.3/2.7.2 also
|
|
26
|
+
* the whole job; `--cap` remains a soft lifetime-count hint. Exact 2.6.2/2.6.3/2.7.2/2.7.3 also
|
|
27
27
|
* bounds wave cardinality and prevents child timeouts from overlapping waves;
|
|
28
28
|
* a requested concurrency of one runs a direct worker. Sized like the single-turn
|
|
29
29
|
* review budget — a swarm fans review work out in parallel within one process,
|
|
@@ -65,7 +65,7 @@ const CAP_PROPERTY = {
|
|
|
65
65
|
const MAX_CONCURRENCY_PROPERTY = {
|
|
66
66
|
type: "integer",
|
|
67
67
|
minimum: 1,
|
|
68
|
-
description: "Concurrent worker limit on exact Kimi Code 2.6.2/2.6.3/2.7.2: one runs directly; larger values bound each native swarm wave. Older certified versions limit normal launches only and recovery can exceed it. Distinct from the soft total cap.",
|
|
68
|
+
description: "Concurrent worker limit on exact Kimi Code 2.6.2/2.6.3/2.7.2/2.7.3: one runs directly; larger values bound each native swarm wave. Older certified versions limit normal launches only and recovery can exceed it. 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 = []) {
|
|
@@ -13,8 +13,8 @@ import { usesBoundedSwarmPolicy } from "./swarm-policy.js";
|
|
|
13
13
|
import { installBoundedSwarmToolPolicy } from "./swarm-tool-policy.js";
|
|
14
14
|
import { collectDescendantIdentities, collectProcessGroupsIdentities, probeProcessIdentity, revalidateProcessIdentities, waitForProcessTreeExit, } from "./process-tree.js";
|
|
15
15
|
// These exact activation entries support candidate integration; production scope is per operation.
|
|
16
|
-
const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3", "2.4.0", "2.4.1", "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"];
|
|
17
|
-
const
|
|
16
|
+
const PREACTIVATION_VERSIONS = ["2.3.2", "2.3.3", "2.4.0", "2.4.1", "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"];
|
|
17
|
+
const JSON_READY_VERSIONS = ["2.7.2", "2.7.3"];
|
|
18
18
|
const KIMI_AGENT_PROTOCOL_VERSION = "1.0.0";
|
|
19
19
|
const READY_TIMEOUT_MS = 10_000;
|
|
20
20
|
const REST_TIMEOUT_MS = 5_000;
|
|
@@ -152,7 +152,7 @@ async function startWebChild(options, env, expectedVersion, failureCode) {
|
|
|
152
152
|
const args = [
|
|
153
153
|
...(options.prefixArgs ?? []),
|
|
154
154
|
"web",
|
|
155
|
-
expectedVersion
|
|
155
|
+
JSON_READY_VERSIONS.includes(expectedVersion) ? "--json" : "--no-open",
|
|
156
156
|
"--host",
|
|
157
157
|
"127.0.0.1",
|
|
158
158
|
"--port",
|
|
@@ -274,7 +274,7 @@ async function waitForReadyLine(owned, expectedVersion, signal, failureCode) {
|
|
|
274
274
|
const newline = buffered.indexOf("\n");
|
|
275
275
|
const line = buffered.slice(0, newline).replace(/\r$/, "");
|
|
276
276
|
buffered = buffered.slice(newline + 1);
|
|
277
|
-
if (expectedVersion
|
|
277
|
+
if (JSON_READY_VERSIONS.includes(expectedVersion)) {
|
|
278
278
|
if (line.trim().length === 0)
|
|
279
279
|
continue;
|
|
280
280
|
try {
|
|
@@ -364,7 +364,7 @@ async function verifyMeta(web, expectedVersion, signal, failureCode) {
|
|
|
364
364
|
if (!isRecord(data)) {
|
|
365
365
|
throw failure(failureCode, "swarm-activation.meta", "Kimi web /meta returned an invalid payload.");
|
|
366
366
|
}
|
|
367
|
-
if (expectedVersion
|
|
367
|
+
if (JSON_READY_VERSIONS.includes(expectedVersion)) {
|
|
368
368
|
if (data.kimi_agent_protocol_version !== KIMI_AGENT_PROTOCOL_VERSION ||
|
|
369
369
|
!isRecord(data.capabilities) ||
|
|
370
370
|
data.capabilities.websocket !== true ||
|
|
@@ -399,7 +399,7 @@ async function resolveProfileModel(web, options, failureCode) {
|
|
|
399
399
|
}
|
|
400
400
|
async function createSession(web, options, expectedVersion, failureCode) {
|
|
401
401
|
const request = { metadata: { cwd: options.cwd } };
|
|
402
|
-
if (["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion)) {
|
|
402
|
+
if (["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion)) {
|
|
403
403
|
request.environment_id = "local";
|
|
404
404
|
request.environment_cwd = options.cwd;
|
|
405
405
|
}
|
|
@@ -410,7 +410,7 @@ async function createSession(web, options, expectedVersion, failureCode) {
|
|
|
410
410
|
return { sessionId: data.id, workspaceId: data.workspace_id };
|
|
411
411
|
}
|
|
412
412
|
async function verifyLocalEnvironment(web, identity, expectedCwd, expectedVersion, signal, failureCode) {
|
|
413
|
-
if (!["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion))
|
|
413
|
+
if (!["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion))
|
|
414
414
|
return;
|
|
415
415
|
const data = await restData(web, "GET", `/api/v1/sessions/${encodeURIComponent(identity.sessionId)}/environment`, undefined, signal, failureCode);
|
|
416
416
|
if (!isRecord(data)) {
|
|
@@ -430,10 +430,10 @@ async function postSwarmProfile(web, identity, active, model, signal, failureCod
|
|
|
430
430
|
await restData(web, "POST", `/api/v1/sessions/${encodeURIComponent(identity.sessionId)}/profile`, { agent_config: agentConfig }, signal, failureCode);
|
|
431
431
|
}
|
|
432
432
|
async function verifySwarmStatus(web, identity, active, model, expectedVersion, signal, failureCode) {
|
|
433
|
-
const data = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion)
|
|
433
|
+
const data = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion)
|
|
434
434
|
? await readWebSocketAgentState(web, identity.sessionId, expectedVersion, signal, failureCode)
|
|
435
435
|
: await restData(web, "GET", `/api/v1/sessions/${encodeURIComponent(identity.sessionId)}/status`, undefined, signal, failureCode);
|
|
436
|
-
const source = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion) ? "agent state" : "/status";
|
|
436
|
+
const source = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion) ? "agent state" : "/status";
|
|
437
437
|
if (!isRecord(data)) {
|
|
438
438
|
throw failure(failureCode, "swarm-activation.status", `Kimi web ${source} returned an invalid payload.`);
|
|
439
439
|
}
|
|
@@ -443,10 +443,10 @@ async function verifySwarmStatus(web, identity, active, model, expectedVersion,
|
|
|
443
443
|
if (data.plan_mode !== false) {
|
|
444
444
|
throw failure(failureCode, "swarm-activation.status", `Kimi web ${source} did not confirm plan mode is off.`);
|
|
445
445
|
}
|
|
446
|
-
if (["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion) && data.tower_mode !== false) {
|
|
446
|
+
if (["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion) && data.tower_mode !== false) {
|
|
447
447
|
throw failure(failureCode, "swarm-activation.status", "Kimi web agent state did not confirm tower mode is off.");
|
|
448
448
|
}
|
|
449
|
-
const permission = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion) ? data.permission_mode : data.permission;
|
|
449
|
+
const permission = ["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion) ? data.permission_mode : data.permission;
|
|
450
450
|
if (permission !== "auto") {
|
|
451
451
|
throw failure(failureCode, "swarm-activation.status", `Kimi web ${source} did not confirm auto permission mode.`);
|
|
452
452
|
}
|
|
@@ -462,7 +462,7 @@ async function readWebSocketAgentState(web, sessionId, expectedVersion, signal,
|
|
|
462
462
|
return await new Promise((resolve, reject) => {
|
|
463
463
|
let socket;
|
|
464
464
|
const bearerProtocol = `kimi-code.bearer.${web.token}`;
|
|
465
|
-
const legacyControl = !["2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(expectedVersion);
|
|
465
|
+
const legacyControl = !["2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(expectedVersion);
|
|
466
466
|
const helloId = `swarm-activation-hello-${randomUUID()}`;
|
|
467
467
|
const subscribeId = `swarm-activation-subscribe-${randomUUID()}`;
|
|
468
468
|
try {
|
|
@@ -7,7 +7,7 @@ export const BOUNDED_SWARM_POLICY = "bounded-waves/1";
|
|
|
7
7
|
export const SWARM_CHILD_TIMEOUT_MS = 2_147_483_647;
|
|
8
8
|
export function usesBoundedSwarmPolicy(plan) {
|
|
9
9
|
return plan.intendedEngine === "native-v2" &&
|
|
10
|
-
(plan.kimiVersion === "2.6.2" || plan.kimiVersion === "2.6.3" || plan.kimiVersion === "2.7.2") &&
|
|
10
|
+
(plan.kimiVersion === "2.6.2" || plan.kimiVersion === "2.6.3" || plan.kimiVersion === "2.7.2" || plan.kimiVersion === "2.7.3") &&
|
|
11
11
|
(plan.operationKind === "swarm" || plan.operationKind === "swarm-write");
|
|
12
12
|
}
|
|
13
13
|
function plainObject(value) {
|
|
@@ -966,7 +966,7 @@ function buildArgs(opts) {
|
|
|
966
966
|
? opts.env.KIMI_PLUGIN_CC_SMOKE_V2_CANDIDATE
|
|
967
967
|
: undefined;
|
|
968
968
|
if (opts.resumeSessionId === undefined &&
|
|
969
|
-
["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
969
|
+
["2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.6.0", "2.6.2", "2.6.3", "2.7.2", "2.7.3"].includes(opts.executionPlan.kimiVersion ?? smokeCandidate ?? "")) {
|
|
970
970
|
args.push("--environment", "local");
|
|
971
971
|
}
|
|
972
972
|
if (opts.resumeSessionId !== undefined) {
|