Skip to content
UHPUHPDeveloper Guide
Independent developer guide. Not affiliated with HarnessRouter or the official UHP project.

Kimi Code CLI

Kimi Code CLI upstream is 2.1.1; HarnessRouter v0.29.0 separately retains the 2.0.0 adapter pin. The September integration history explains the predecessor CLI replacement, session behavior and tool policy without implying native UHP adoption.

Page reviewed 4 Oct 2026 Source and review policy

Historical UHP context: 2026-09-12HarnessRouter checked 4 Oct: v0.29.0

Migrate the product, then re-establish credentials

Section titled “Migrate the product, then re-establish credentials”

The predecessor Kimi CLI repository is now explicitly archived and redirects users to Kimi Code CLI. Its latest 1.52.0 release short-circuits entrypoints to the new installer; it is not a later release of the 2.x product that HarnessRouter runs.

The migration documentation linked from that repository describes three separate actions: install Kimi Code CLI, import legacy data, then log in again and reauthorize MCP servers. Importing session/config history is not credential migration. The predecessor’s ~/.kimi/ data is preserved, and kimi migrate can initiate migration later.

StateWhat to verify after migration
Sessions/history importedA chosen historical session opens under the new product
Provider loginA new authenticated native turn can run
MCP server definitions importedServer authorization and a required tool work independently
HarnessRouter backend selectedCE still uses its installed 2.0.0 runtime and workspace state

The latest Kimi Code release observed remains @moonshot-ai/kimi-code@2.1.1. Its filesystem watchers are on by default; a saved config change can therefore affect a live native runtime. The older CE pin and its isolated session lifecycle need separate evidence.

Do not point a migration command at a CE data volume merely because both products use the kimi executable name. Back up the intended native data and follow the upstream migration path. Use profile isolation to scope credentials and instruction provenance to distinguish imported configuration from what a turn actually applied.

The latest stable release observed in the upstream GitHub release API is @moonshot-ai/kimi-code@2.1.1, published 2026-09-24. This patch restores config/workspace filesystem watchers by default and rolls back some defensive changes from 2.1.0. It is a Kimi Code release; the historical HarnessRouter 2.0.0 adapter pin below is a separate coordinate.

HarnessRouter integration, checked 4 October 2026: the v0.29.0 entrypoint retains the default pin Kimi Code CLI 2.0.0. This is source-verified adapter configuration, not a fresh runtime or provider test. HarnessRouter now has 20 released backends; the earlier counts and measurements below retain their dated scope.

Evidence scope: the integration details, commands, measurements and development-head references below preserve the 18 Sep 2026 source snapshot. They are not presented as a fresh test of this newer release. For the current UHP protocol, HarnessRouter release and suite coordinates, use the release tracker and conformance guide. Adapter support does not establish upstream-native UHP adoption.

HarnessRouter stable v0.18.4 retains Kimi Code CLI 2.0.0 for backend kimi. PR #206 merged on 17 September 2026 as a27df946d77eae5efb6e765fcfb1645a4875731b, replacing the earlier wiring to the predecessor Python-based Kimi CLI 1.50.0 from PR #191. PR #210, released as v0.18.2 at bf3b0c64, fixes the common local UHP file-upload path and adds X-09 conformance coverage without changing the Kimi adapter. Later v0.18.3 and v0.18.4 likewise retain the Kimi adapter unchanged.

The release boundary changed twice on 17 September. v0.18.0 points to f895f1b6 and first makes backend kimi part of stable software using Kimi CLI 1.50.0. v0.18.1 points to a27df946 and immediately supersedes it with Kimi Code CLI 2.0.0. PR #208 later fixes the publication workflow. Current v0.18.4 and checked main point to efd320b313891191967871de28ff4757528ae6a7 with the same Kimi runtime.

MoonshotAI publishes Kimi Code CLI 2.0.0 from the MoonshotAI/kimi-code repository. The upstream README also documents a native Agent Client Protocol (ACP) server through kimi acp. That is native ACP capability; it does not establish native UHP support.

PR #206 explicitly replaces one upstream product with another. The v0.18.0 adapter used MoonshotAI/kimi-cli 1.50.0; the adapter introduced in v0.18.1 and retained in current v0.18.4 uses the TypeScript rewrite distributed as Kimi Code CLI 2.0.0. The backend id remains kimi, but several integration contracts change.

Boundaryv0.18.0 predecessorv0.18.1+ current adapter
Upstream productKimi CLI 1.50.0Kimi Code CLI 2.0.0
Provider/model configurationmanaged config fileKIMI_MODEL_* environment
Persistent homeKIMI_SHARE_DIRKIMI_CODE_HOME
Session identityrunner-minted because stream omitted itCLI session id on the final stream line
Unknown resume idcould silently start a fresh sessionCLI exits non-zero; runner still verifies store presence first
Tool policyinternal tool pathstool names plus an empty subagent allowlist
MCP statemanaged config/flag$KIMI_CODE_HOME/mcp.json
Step budget--max-steps-per-turnKIMI_LOOP_MAX_STEPS_PER_TURN

Kimi Code’s stream supplies its own session id on the final line. HarnessRouter therefore no longer needs the deterministic session id synthesis used for the predecessor adapter. Resume validation remains store-backed before launch, and an unknown session now fails instead of silently becoming a new conversation.

HarnessRouter places KIMI_CODE_HOME in the runner-owned workspace/checkpoint domain so Kimi Code state survives sandbox recycle without being treated as a produced artifact. The installer pins Kimi Code 2.0.0 release assets by digest and checks kimi --version, allowing an existing volume containing the predecessor binary to be upgraded in place.

Kimi Code receives MCP configuration through $KIMI_CODE_HOME/mcp.json; HarnessRouter writes SSE transport explicitly instead of relying on URL-shape inference. One important upstream behavior is different from the predecessor: an unreachable MCP server can be skipped silently with exit code 0. HarnessRouter therefore reads the current turn’s Kimi Code log and appends a note naming an unreachable server rather than treating silence as proof that MCP started correctly.

Hard tool exclusion also changed. Kimi Code policy uses tool names, not the predecessor’s internal tool paths. Product testing found that withholding Bash alone was insufficient because a subagent could regain shell capability by delegation. The stable adapter therefore writes an empty subagent allowlist alongside the disabled-tool policy so a prohibited capability cannot be recovered indirectly through a delegated agent.

Kimi Code sends request fields that are not necessarily valid for every routed provider/model: the measured 2.0.0 client supplied a very large token limit across tested model families and supplied reasoning_effort: "high" for Claude-named models. HarnessRouter registers a Kimi-specific relay route that removes the problematic generated token-limit fields and reasoning-effort field before forwarding the request.

PR #206 reports that this reduced repeated flat-400 retries and was validated across multiple model families. This is adapter/runtime normalization, not UHP protocol behavior and not a statement that every provider/model combination is universally compatible.

PR #191 remains useful historical predecessor evidence: it introduced backend kimi and reported 48/48 across twelve backend bases × four Harness Plugins columns using Kimi CLI 1.50.0. That implementation became the short-lived stable v0.18.0 coordinate. PR #206 supersedes it in v0.18.1 and reports product-path testing including the four plugin columns plus a 248/250 console-scenario result across 50 model ids; its two misses were attributed in the PR to scenario wording interacting with one provider/model safety policy. v0.18.4 inherits that Kimi adapter without a new Kimi-specific measurement.

Neither number is UHP conformance. Current HarnessRouter source contains 75 checks under package metadata 2026.9.12 because PR #210 added X-09 in v0.18.2; v0.18.3 and v0.18.4 retain that check set. The latest checked-in Full result still identifies Community Edition 0.17.3 from PR #190 at 74/74 Full. That 74/74 result predates X-09 and must not be projected onto current v0.18.4; no checked-in 75/75 Full remeasurement was observed at this cutoff.

Kimi Code CLI natively supports ACP through kimi acp, allowing ACP-compatible editors and IDEs to drive a Kimi Code session over stdio. HarnessRouter’s kimi backend is a different interoperability layer: a UHP client talks to HarnessRouter, which adapts the request to Kimi Code and normalizes lifecycle, persistence, MCP/tool policy and provider routing.

Native ACP path:
ACP client/editor -> kimi acp -> Kimi Code CLI
HarnessRouter path:
UHP client -> HarnessRouter -> Kimi Code CLI 2.0.0 -> provider/model

At this cutoff:

  • UHP: 2026-09-12 Draft.
  • HarnessRouter stable/current main: v0.18.4 / efd320b3 — twelve released backends, including kimi on Kimi Code CLI 2.0.0.
  • HarnessRouter v0.18.3: 0fcd90b5 — runtime/accounting/defaults corrections; no Kimi adapter change.
  • HarnessRouter v0.18.2: bf3b0c64 — local UHP file-upload fix and X-09; no Kimi adapter change.
  • HarnessRouter v0.18.1: a27df946 — introduced the current Kimi Code CLI 2.0.0 adapter.
  • HarnessRouter v0.18.0: f895f1b6 — first stable twelve-backend release, using predecessor Kimi CLI 1.50.0.
  • Kimi Code CLI latest observed upstream release: 2.0.0, published 17 September 2026.
  • Native Kimi Code ACP: verified upstream.
  • Native Kimi Code UHP adoption: not established.
  • Current conformance source: 75 checks under package metadata 2026.9.12; latest checked Full evidence remains pre-X-09 CE 0.17.3 at 74/74 Full.

See HarnessRouter for reference-implementation state, release tracker for version boundaries, and UHP vs ACP for the protocol boundary.