Skip to content

feat(setup): add Kimi Code client support - #2744

Merged
morluto merged 4 commits into
morluto:mainfrom
ysntony:feat/kimi-code-client-support
Oct 13, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
ysntony:feat/kimi-code-client-support

Conversation

@ysntony

@ysntony ysntony commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

Adds Kimi Code (kimi) as a supported client for rea setup / rea doctor.

Behavior changes

rea setup --client kimi registers REA's MCP server in ~/.kimi-code/mcp.json (or $KIMI_CODE_HOME/mcp.json when set), preserving unrelated settings and writing a .rea.backup before modifying an existing file.

The registration is command-based with no type field: Kimi Code treats a command entry as stdio. startupTimeoutMs = 30000 (Kimi's default) and toolTimeoutMs = 120000 are set from the shared MCP_STARTUP_POLICY.

Package-launcher registration reuses the shared pinned-version rule and Windows wrapping.

Config parsing is strict JSON: an empty or whitespace-only file is initialized; malformed JSON is rejected with the file left untouched and no backup created.

An explicit transport: "stdio" is treated as aligned (normalized away on write); any other explicit transport is reported as invalid.

Repeat setup is idempotent: a second run reports unchanged with the file byte-identical.

Skills

Kimi Code discovers personal skills in ~/.agents/skills and project-local .agents/skills, so the bundled skill uses the shared skill destination with no separate skill root; the files are still installed and verified through the shared-skill flow.

Validation

  • 19 Kimi-specific tests cover configuration paths, $KIMI_CODE_HOME override, registration lifecycle (register, preserve, backup, idempotent, uninstall), launchers on Linux and Windows, transport and timeout validation, and foreign-command detection.
  • Adjacent-client regression: 260 passed, 2 skipped.
  • check:fast and docs:check pass; git diff --check is clean.
  • Real-client verification: Kimi Code 2.1.1 connected to the registered server and returned Evidence from a real mcp__rea__analyze_javascript_application call.
  • With the full 173-tool catalog exposed, requests can exceed Moonshot's tool-schema size limit; scoping the server entry with enabledTools avoids this.

Registers rea in ~/.kimi-code/mcp.json (or $KIMI_CODE_HOME/mcp.json), preserving unrelated settings with a .rea.backup; registration is command-based stdio with no type field, startupTimeoutMs 30000 and toolTimeoutMs 120000 from MCP_STARTUP_POLICY.
Strict JSON parsing: empty or whitespace-only files initialize; malformed JSON is rejected untouched with no backup; explicit transport other than stdio reports invalid.
Bundled skill uses the shared ~/.agents/skills destination that Kimi Code discovers, installed and verified through the shared-skill flow.
Validated by 19 Kimi-specific tests, 260 adjacent-client regressions passing, check:fast and docs:check, and real-client verification on Kimi Code 0.40.1 (173 tools discovered, real mcp__rea__analyze_javascript_application call succeeded).
@ysntony
ysntony marked this pull request as ready for review October 13, 2026 10:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-13T10:33:58.830343Z bd9faee Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

Adds Kimi Code to rea setup and rea doctor, with strict JSON parsing, configurable paths, shared skills, and explicit timeouts.

  • Kimi Code can load REA from its own MCP settings.
  • Empty Kimi config files can be set up without relaxing JSON parsing.
  • Doctor checks Kimi’s transport and timeout settings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Select kimi"] --> B["Resolve KIMI_CODE_HOME or ~/.kimi-code"]
  B --> C["Read mcp.json with strict JSON parsing"]
  C --> D{"Valid document?"}
  D -->|No| E["Stop without changing the file"]
  D -->|Yes| F["Build launcher and timeouts; keep env and enabledTools"]
  F --> G{"Registration already matches?"}
  G -->|Yes| H["Return unchanged"]
  G -->|No| I["Back up, write, and check the file"]
Loading

Reviews (4) · Last reviewed commit: "Merge commit '94072364c7f8410b0e86e72c91..." · Reviewed by Greptile

@morluto morluto added enhancement New feature or request area: setup Setup, packaging, upgrade, install, Doctor, and client registration area: cli CLI adapter and one-shot commands area: mcp MCP server, transport, and tool registration P2: medium Medium priority issue labels Oct 13, 2026
@morluto
morluto merged commit efc491a into morluto:main Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands area: mcp MCP server, transport, and tool registration area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request P2: medium Medium priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants