Skip to content

Kimi engine broken with kimi-code CLI 0.27.x — SDK 0.1.8 spawns removed flags (--work-dir, --wire), new ~/.kimi-code wire format unsupported #344

Description

@leeyoung1982

Title:
Kimi engine broken with kimi-code CLI 0.27.x — SDK 0.1.8 spawns removed flags (--work-dir, --wire), new ~/.kimi-code wire format unsupported

Body:

Summary

metabot's Kimi engine fails against the current Kimi Code CLI 0.27.0. The bundled @moonshot-ai/kimi-agent-sdk@0.1.8 (the latest on npm) spawns the CLI with flags that kimi-code 0.27 has renamed/removed, so every Kimi turn dies immediately. This blocks using Kimi (including the new K3 model) as a bot engine.

Environment

  • metabot: 1.0.0 (pm2, src/index.ts, tsx + Node 22)
  • OS: Ubuntu 24.04, self-hosted
  • @moonshot-ai/kimi-agent-sdk: 0.1.8 (npm latest; also what package.json pins via ^0.1.8)
  • Kimi Code CLI: 0.27.0 (installed via curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash, lives in ~/.kimi-code, logged in via kimi login)
  • Engine config in bots.json:
    "kimi": { "executable": "/home/agentuser/.kimi-code/bin/kimi", "model": "kimi-code/k3", "thinking": true }

Reproduction

  1. Install current kimi-code CLI (0.27.0) and kimi login as the same user the bridge runs as.
  2. Set a bot's engine: "kimi" (or /model kimi in a chat).
  3. Send any prompt.

Actual result

CLI exited with code 1: error: unknown option '--work-dir'

The SDK log shows Starting Kimi execution (multi-turn) (auth/config OK), then the spawned kimi process exits 1.

Root cause

SDK 0.1.8 spawns the CLI with: --agent-file, --json, --model, --no-thinking, --session, --skills-dir, --thinking, --wire, --work-dir, --yolo.
kimi-code 0.27 --help shows these are gone/renamed:

  • --work-dirremoved (now --add-dir)
  • --wireremoved from top-level (new acp subcommand / new ~/.kimi-code wire format)
  • --agent-file, --json, --no-thinkingremoved
  • only --yolo, --session remain
    Parallel report in another tool: ccusage#1357 ("Kimi Code (~/.kimi-code) usage not detected — new wire format unsupported").

What already works (so only the wire/flags layer is the blocker)

  • Auth/config: setting KIMI_SHARE_DIR=/home/<user>/.kimi-code makes the SDK's KimiPaths/isLoggedIn/parseConfig read the new CLI's location (creds + config.toml there). No "not logged in" error.
  • Model works via the CLI directly: kimi -m kimi-code/k3 -p "..." returns K3 output fine.

Ask

  • Bump @moonshot-ai/kimi-agent-sdk to a release that speaks kimi-code 0.27's wire format (once Moonshot publishes one), or adapt the Kimi executor to the new flags/acp transport.
  • Meanwhile, could you document the last kimi-code CLI version compatible with SDK 0.1.8, so users can pin it? (K3 availability on that version would be good to note too.)

Thanks — happy to test patches on a live Moderato-plan K3 setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions