Repository navigation
Conversation
Add kimi_code to the supported setup clients with the JSON mcpServers dialect at ~/.kimi-code/mcp.json, following a nonempty KIMI_CODE_HOME and falling back when it is empty. Skills stay in the shared ~/.agents/skills destination, and a project .kimi-code/mcp.json can override the user entry, so setup writes user scope only. Seed REA_MCP_INPUT_SCHEMA_PROFILE=compact through the existing registration environment merge: an explicitly configured profile in the entry still wins, and discovered provider settings still override their own keys. Moonshot's API rejects a whole request while one tool input schema exceeds its per-schema cap (morluto#1484); the full profile in 6.4.0 put five schemas over it, the compact profile put none.
Mirror the Qwen Code client tests: boundary coverage for path resolution (default home and KIMI_CODE_HOME), register -> aligned read -> idempotent reconfigure -> unregister, compact profile seeding with an explicit profile preserved, and an acceptance CLI plan/setup/doctor/uninstall pass asserting the seeded compact environment and shared skill. Extend the detected-client order with kimi_code.
Add the Kimi Code row to the supported agents table and a section covering the user-level mcp.json target, the KIMI_CODE_HOME override, project-level overrides, the seeded compact schema profile justified by the Moonshot per-schema cap (morluto#1484), and the session restart required after MCP changes. Scope the 17-client dry-run checkpoint sentence to the 6.4.0 release.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 of 5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Kimi Code (kimi-cli, Moonshot's coding agent) is the one major local MCP client with no
rea setupintegration, so its users hand-writemcpServers.reainto~/.kimi-code/mcp.json(the exact path #1484's reproduction uses). That leaves setup detection,doctor, anduninstallblind to the registration,rea updatenever re-pins it, and a naive entry reproduces the Moonshot per-schema 400s of #1484 on current releases. This PR registers Kimi Code as a supported client and seeds the compact schema presentation into its entry so the first prompt after setup works. Fixes #1791.Problem and expected behavior
npx rea-agents setupand gets a Kimi Code checkbox the way OMP (Support OMP (oh-my-pi) in rea setup client integrations #1257 → feat(setup): register OMP during setup #1301) and Qwen Code ([Feature] Support Qwen Code in rea setup client integrations #1409) did, then loads both the MCP server and thereverse-engineer-anythingworkflow with no manual file edits.rea setup --client kimi_codewrites a pinnedmcpServers.reaentry to user-level~/.kimi-code/mcp.jsonwith"env": { "REA_MCP_INPUT_SCHEMA_PROFILE": "compact" };doctor --client kimi_codereports the registration;uninstall --client kimi_coderemoves it. No [Bug] Moonshot clients reject every request while REA is connected: advertised tool schemas exceed the per-schema size cap (kimi-cli unusable) #1484-style 400 cascade on the first prompt.Change and scope
SupportedClients.ts—kimi_codedefinition (configPathmcp.jsonunder the Kimi home,markerPaththe same directory,format: "json"). The existing JSON dialect writes exactly themcpServers.<name>→{command, args, env}shape Kimi Code loads; no new dialect.KIMI_CODE_HOMEwith codex-style semantics (non-empty override used as-is, empty falls back to~/.kimi-code, no tilde expansion) — matched to Kimi's own resolution and pinned by tests.ClientRegistrationEnvironment.ts— the existing environment-retention merge gains a lowest-precedencedefaultslayer ({...defaults, ...existing, ...overrides}), so seeded values never clobber explicitly configured ones (preserves the "explicitly configured server settings" invariant).SetupClientConfiguration.ts—clientRegistrationDefaults(client)returns the compact profile seed forkimi_code(empty map otherwise) at the singleclientConfigurationDesiredconvergence point, so register/inspect/aligned/update all seed it and stay idempotent.SetupSkill.ts— unchanged: Kimi Code discovers the shared~/.agents/skills, the existing fallback destination; no client skill family needed (simpler than [Feature] Support Qwen Code in rea setup client integrations #1409's Qwen case).docs/installation.md(table row, Kimi Code section, restart note).verify:kimi-clientscript, project-level config writes, tool-contract changes, Windows Kimi verification.Contract and boundary impact
SetupClientConfiguration/ClientRegistrationEnvironment).REA_MCP_INPUT_SCHEMA_PROFILEis presentation-only advertising; canonical schemas and server-side validation are untouched (catalog still 170 tools).setup_clientsclient metadata derives fromSUPPORTED_CLIENT_DEFINITIONS(CI-generated; nothing committed);npm pack --dry-runandverify:packagepass;docs/installation.mdupdated.Evidence and regression coverage
tests/boundary/filesystem/kimiClientConfiguration.test.ts(9 tests: path resolution on linux/darwin,KIMI_CODE_HOMEsemantics incl. empty/~//relative cases, register → preserve-unrelated → aligned-read → idempotent-reconfigure → uninstall round trip, compact seed + explicitfullprecedence + provider-key stacking);tests/acceptance/setup/kimiClientSetup.test.ts(CLI dry-run plan →--yesapply →.rea.backup→ compact env →doctor --skill→ idempotent re-run → uninstall, underKIMI_CODE_HOME);clientLifecycle.test.tsdetection-order list;clientEnvironment.tsfixture.kimi_codeclient exists inSUPPORTED_CLIENT_DEFINITIONS(setup multi-select and--clienthave no Kimi Code option); [Bug] Moonshot clients reject every request while REA is connected: advertised tool schemas exceed the per-schema size cap (kimi-cli unusable) #1484 documents the schema-cap failure mode. Schema-size table in [Feature] Support Kimi Code in rea setup client integrations #1791 (2026-10-11,rea-agents@6.4.0): full profile 5inputSchemas over ~14 KB (largest 61,876 B); compact profile 0 over (largest 12,090 B).doctor --client kimi_codecovers it like other clients; docs section shows the written entry shape.verify:kimi-clientlane here); Moonshot cap behavior measured previously, not re-triggered from this host; Windows unverified; fulltest:acceptance/test:integrationanddocs:buildnot run; dev toolchain is Node 24.14.0 vs.nvmrc24.18.0 (nvm unavailable on the host).For evidence-bearing changes:
Validation performed
npm ci— passnpm run test:focused -- tests/boundary/filesystem/kimiClientConfiguration.test.ts tests/acceptance/setup/kimiClientSetup.test.ts(plus clientLifecycle, qwen, clientConfigurationEnvironment, productCatalog) — 6 files / 90 tests passnpm run check:fast— pass (typecheck + lint incl. module boundaries)npm run verify:test-discovery— pass (821 test files, each discovered once)npm run verify:package— pass (setup planned→idempotent, backupReadback, skill, mcpTools=170)npm pack --dry-run— pass (1162 files, no artifacts written)npm run docs:check— passnpm run test:fast— 4298 passed / 7 skippednpm run test:boundary— 27 failed / 3039 passed; the failing set is identical on themainbaseline of this host (missingibtool,hdiutilbehavior, Ghidra MCP fixture, JS inspector fixture); one additional 30 s timeout flake passes standalone 8/8. Unrelated to this change; no assertion weakened.Compatibility, safety, and release
kimi_coderegistrations seed the compact profile; explicitly configuredREA_MCP_INPUT_SCHEMA_PROFILEvalues keep precedence over the seed. Existing manual entries are only touched if the user runs setup forkimi_code(standard reviewed transaction).Review checklist
type(scope): outcome.Fixes #1791).