Skip to content

feat(adapters): add Kimi Code via native ACP - #2

Closed
delete-cloud wants to merge 5 commits into
mainfrom
kimi-code-acp
Closed

delete-cloud wants to merge 5 commits into
mainfrom
kimi-code-acp

Conversation

@delete-cloud

Copy link
Copy Markdown
Owner

Summary

Adds Kimi Code as a Confer seat agent and MCP host, using native ACP (kimi acp), same transport class as Grok / Cursor / Copilot.

This draft is on delete-cloud/confer for review. It is not the squash PR for samzong/confer yet. History still contains the earlier CLI-bridge commit (5bef033) and the later ACP replacement; squash before offering upstream.

What changed

New kimi agent (src/types.rs)

  • IDs: kimi, kimi-code, kimi-code-cli, kimi-cli; binary kimi; Skill host id kimi-cli (kitup’s adapter name for Kimi Code, not legacy kimi-cli).

Execution (src/adapters/native.rs, src/adapters/acp.rs)

  • Runs kimi acp over native ACP; pins absolute KIMI_CODE_HOME on the child.
  • Resume uses session/resume (Kimi advertises both loadSession and resume; Confer prefers resume so replayed history is not mixed into the current answer).
  • Permission: session/set_config_option mode=auto. Kimi 0.41.0 maps ACP auto → engine Never Ask; advertised yolo is Ask When Needed and is not used. kimi --auto acp does not change session/new off mode=default.
  • model then thinking via set_config_option. Confer reasoning_effort maps to thinking. Locally accepted: on, low, high, max. Kimi-only: none / off fail at seat config (current models cannot disable thinking; Copilot none is unchanged). K2.7 picker is on-only; K3 is low/high/max (on aliases to high). A locally accepted level the current picker does not list fails before the prompt and records no native session.

Readiness

  • Data root only ($KIMI_CODE_HOME, default ~/.kimi-code): credentials/*.json excluding credentials/mcp/, or a non-empty api_key in config.toml. Does not read KIMI_API_KEY / MOONSHOT_API_KEY.

MCP host

  • Writes $KIMI_CODE_HOME/mcp.json (Cursor-style). Explicit --agent kimi does not require kimi on PATH.

Host detection

  • No session env marker. Skill: pass "host_agent": "kimi" when the host is Kimi Code.

Skill install / kitup

  • crates.io kitup 0.1.4 still prefers ~/.config/agents/skills for host id kimi-cli; Kimi Code scans ~/.agents/skills and $KIMI_CODE_HOME/skills. Fixed on kitup main (lathe-cli/kitup#41). This branch patches crates.io kitup to lathe-cli/kitup main until the next crates.io release. Existing ~/.config/agents/skills installs are not migrated.

Testing

  • cargo test — 62 passed (Kimi ACP wire order, resume vs load, unknown thinking fails before prompt, thinking allowlist, MCP file install, native kimi acp argv).
  • This machine has no rustfmt/clippy components; upstream CI should run fmt / clippy.
  • Live Kimi Code 0.41.0 through confer mcp: create_room → first message CONFER_KIMI_ACP_OK → resume RECALL_OK → echo tool output. thinking=high accepted on k3; thinking=off native error.

Docs

README, SPEC, bundled Skill (host_agent + thinking levels), architecture SVG.

Add `kimi` as a seat agent and MCP host, alongside Claude Code, Codex,
Cursor, Grok, Antigravity, and Copilot.

Seats run `kimi -p <prompt> --output-format stream-json` over the CLI
bridge; resume uses `-S <session-id>` and model selection uses `-m`.
Kimi Code exposes no reasoning-effort flag, so effort is rejected
explicitly. A successful run without an observed session id
(session.resume_hint) is treated as an error.

Readiness checks the Kimi Code data root ($KIMI_CODE_HOME, default
~/.kimi-code) for credentials/kimi-code.json or config.toml; Kimi Code
does not consume API keys from the shell environment. Relative
KIMI_CODE_HOME values anchor to the current directory and are pinned on
the child process so confer and the seat resolve the same data root.
`confer mcp install` writes $KIMI_CODE_HOME/mcp.json.

The bundled Skill installs to kitup's `kimi-cli` host, whose user skill
dir upstream 0.1.4 prefers ~/.config/agents/skills — a directory Kimi
Code never scans (its user roots are $KIMI_CODE_HOME/skills and
~/.agents/skills). Until kitup fixes that host data, `skill install
--agent kimi` may target a directory Kimi Code does not read.
Move Kimi seats from the CLI print-bridge to native ACP (`kimi acp`),
matching Grok, Cursor, and Copilot.

Resume uses `session/resume`. Model and unattended permission are
applied through `session/set_config_option`: Kimi 0.41.0 maps ACP
`mode=auto` to engine Never Ask (advertised `yolo` is Ask When Needed).
`reasoning_effort` remains rejected. KIMI_CODE_HOME is pinned on the
ACP child.

Patch kitup to delete-cloud/kitup@716a744 so kimi-cli user skills
install to ~/.agents/skills.
Send Confer reasoning_effort as session/set_config_option thinking
after mode=auto and model. Kimi-only: accept on/low/high/max; reject
none/off at seat config because current models cannot disable
thinking (Copilot none stays valid). A picker that does not list the
level still fails before the prompt and records no session.
Point the crates.io kitup override at lathe-cli/kitup main after #41
instead of delete-cloud/kitup. Note that Kimi Code seats use thinking
levels on/low/high/max.
SPEC and nearby comments now match Copilot's sentence shape: no Kimi
version, picker, or kitup host-path essays. Those details belong in the
upstream PR, not the contract.
@lodyai
lodyai Bot deleted the kimi-code-acp branch September 23, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant