Skip to content

feat(agents): add Kimi Code CLI support - #248

Open
LarryHu0217 wants to merge 2 commits into
johannesjo:mainfrom
LarryHu0217:codex/kimi-cli-109
Open

feat(agents): add Kimi Code CLI support#248
LarryHu0217 wants to merge 2 commits into
johannesjo:mainfrom
LarryHu0217:codex/kimi-cli-109

Conversation

@LarryHu0217

Copy link
Copy Markdown
Contributor

Summary

  • register Kimi Code as a built-in kimi agent with current resume and permission-bypass flags
  • install Kimi Code in the bundled Docker image and share its .kimi-code auth/config directory
  • avoid the unsupported generic --mcp-config argument and cover native, Docker, and coordinator launch behavior

Fixes #109.

Validation

  • npx vitest run electron/ipc/agents.test.ts electron/mcp/agent-args.test.ts electron/ipc/pty.test.ts src/lib/agent-args.test.ts src/store/tasks.test.ts
  • npm run check
  • npm run check:static
  • npm test
  • npm run test:security-rules
  • npm run build:frontend
  • npm run build:remote
  • npm run build:mcp

Signed-off-by: Liang Hu <lh3057@columbia.edu>

@johannesjo johannesjo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one merge-blocking coordinator-path issue.

electron/mcp/agent-args.ts:62 — Coordinator-created Kimi children never load their per-task MCP config.

Coordinator.createTask writes each child config to /tmp/parallel-code-subtask-.json natively or the coordinator .parallel-code/subtask-.json in Docker, then relies on buildMcpLaunchArgs to pass that path. This new Kimi branch returns an empty argument list. Kimi Code 0.31.1 discovers only its user mcp.json, project-root .mcp.json, and cwd/.kimi-code/mcp.json (published loader source), so neither generated child path is read. The child therefore starts without the parallel-code MCP server and cannot call land_self or signal_done, breaking the default Kimi coordinator-child flow in both native and Docker modes.

Please write or merge the unique child config into an auto-discovered child-worktree location while preserving token isolation and cleanup/restoration, and add coordinator child-creation coverage for Kimi. The new store test exercises top-level coordinator restoration only; it does not cover Coordinator.createTask.

Signed-off-by: Liang Hu <lh3057@columbia.edu>
@LarryHu0217

Copy link
Copy Markdown
Contributor Author

Addressed the coordinator-child blocker in 69a9fad.

  • Kimi children now merge their per-task parallel-code MCP entry into the child worktree's auto-discovered .mcp.json before spawn, in both native and Docker flows.
  • Per-child task IDs and done tokens remain isolated.
  • Existing MCP servers and any previous parallel-code entry are preserved and restored during teardown; concurrent edits are not overwritten.
  • Hydration/server-info refreshes also update the auto-discovered config.
  • Added coordinator creation, isolation, restoration, and concurrent-edit coverage.

Validation:

  • npm test (1637 passed, 23 skipped)
  • npm run check
  • npm run check:static
  • npm run build:frontend && npm run build:mcp
  • targeted Semgrep scan of the changed production files (0 findings)

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.

Add native support for Kimi CLI / Kimi K2.6 agent

2 participants