v0.2.3: add Kimi Code as a fourth scanned harness - #16
Conversation
Kimi Code joins Claude Code, Codex, and Cursor as a fourth scanned harness across the terminal report, --markdown, --json, and the empty-state listing — detection parity only, no product expansion. MCP servers are read from mcp.json (Kimi's actual config shape — JSON, not TOML; config.toml holds Kimi's own settings and never MCP declarations, verified against the installed CLI's own bundled skill source and MCP path resolver): ~/.kimi-code/mcp.json at user scope, and a literal <cwd>/.kimi-code/mcp.json at project scope, read from the exact working directory rather than found by an upward walk, matching Kimi's documented behavior. Skills are read from both roots Kimi auto-discovers — .kimi-code/skills and .agents/skills — at user and project scope. ~/.agents/skills is the same shared shelf Claude Code and Codex already reach through their own link farms, so the existing canonical-path dedupe now collapses a skill across all three harnesses. Not scanned: Kimi's .agents/agents / .kimi-code/agents subagent roots (real and auto-discovered the same way, but out of this change's scope). Version 0.2.3. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53c4c30ec9
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * Claude Code's project detector already reads. Not re-scanned here: | ||
| * Claude Code is scanned before Kimi Code in detect(), so a second | ||
| * read of this file would only ever dedupe away on the (type, name) |
There was a problem hiding this comment.
Scan Kimi's git-root MCP file independently
When a directory between the current working directory and the Git root contains its own .mcp.json, Claude's upward scan stops at that nearer file, so it does not cover Kimi's <git-root>/.mcp.json as claimed here. Skipping Kimi's scan then omits any uniquely named servers from the Git-root file; resolve the Git root and scan that file rather than relying on Claude's nearest-file result.
Useful? React with 👍 / 👎.
| if (opts.scope === 'user') { | ||
| return readMcpServersJson(join(homedir(), '.kimi-code', 'mcp.json'), 'user'); |
There was a problem hiding this comment.
Honor KIMI_CODE_HOME when locating user config
When Kimi is configured with KIMI_CODE_HOME, its user-global MCP file lives at $KIMI_CODE_HOME/mcp.json, but this branch always reads ~/.kimi-code/mcp.json. Those users therefore get a false empty Kimi MCP inventory and an incorrect pathsScanned entry despite the supported override being documented above.
Useful? React with 👍 / 👎.
Summary
src/manifest/kimi.ts, modeled oncodex.ts) detects MCP servers and skills.mcp.json(JSON,{ "mcpServers": {...} }shape) — notconfig.toml, which holds only Kimi's own settings. Verified against the installed CLI's own bundledimport-from-cc-codexskill source and itsresolveMcpJsonPathsresolver (kimi 0.31.1). Three files exist; only two are scanned:~/.kimi-code/mcp.json(user)<cwd>/.kimi-code/mcp.json(project — read from the literal working directory, not an upward walk, matching Kimi's own documented behavior)<git-root>/.mcp.json(project-root) is real but deliberately not re-scanned here — it's the same file Claude Code's project detector already reads, Claude Code is scanned first, and a second read would only ever dedupe away.PROJECT_BRAND_DIRS/PROJECT_GENERIC_DIRS/USER_BRAND_DIRS/USER_GENERIC_DIRSembedded in the installed binary):.kimi-code/skillsand.agents/skills, at both scopes.~/.agents/skillsis the same shared shelf Claude Code and Codex already reach through their own link farms — the existing canonical-path dedupe now collapses a skill across all three harnesses, deterministically, under whichever clientdetect()scans first (Claude Code).--markdown,--json(schema shape unchanged — just anotherclients[]entry), the empty-state "Looked in" listing and closing hint, README (supported-tools claims, "What it reads" table, scan-order/dedupe docs, demo example + SVG regenerated byte-verbatim from a real run), CHANGELOG..agents/agents/.kimi-code/agentssubagent roots. Confirmed real and auto-discovered the same way the skill roots are, but subagent detection is outside this change's scope — flagged for a follow-up, not silently dropped.credentials/,oauth/,sessions/,logs/, oruser-history/is ever touched; the compile-time no-skills-to-server guarantee (skills/subagents never reach/api/sync) is untouched.Verified kimi surfaces (evidence)
Investigated the real installed
~/.kimi-code/on this machine (kimi 0.31.1) — inspectedconfig.toml's actual schema, rankimi --help/kimi doctor --help, and reverse-checked the installed binary's embedded skill source and path-resolution code. No real config values were copied into code, tests, fixtures, or this PR — all fixture/demo values are invented placeholders.Test plan
npm run lint— cleannpm run build— cleannpm test— 306/306 passing (30 new:kimi.test.ts,kimi.skills.test.ts, +1 three-way dedupe test indedupe.test.ts, +1 empty-state string update inreport.test.ts)<cwd>/.kimi-code/mcp.json(a parent directory's file is correctly invisible)npm pack --dry-run+ real-tarball extraction grep — no leaked credentials/oauth/sessions/logs/user-history paths, no real config valuesassets/devcat-report.svgregenerated from one real run of the built CLI against an isolated placeholder-value fixture (not this machine's real config); cross-reviewed by extracting the SVG's visible text and byte-diffing it against the real captured plain output — exact match. The unchanged Claude Code/Codex portion of the SVG diffs byte-identical against the prior file (only the genuinely-changed total/dimensions/new section differ)Judgment calls (flagged for review, not silently decided)
.mcp.jsonnot re-scanned under thekimi-codeclient — real (Kimi does read it, confirmed via git-root walk in the binary), but always dedupes away since Claude Code's existing detector already covers it and scans first. Modeling Kimi's git-root walk a second time for an always-redundant result felt like scope creep; flagging in case a reviewer wants explicitkimi-code-attributed coverage of that file regardless..agents/agents/.kimi-code/agentssubagent roots deliberately excluded — confirmed real and auto-discovered by Kimi, symmetric with the skill roots, but the mission scope was MCP + skills only. Natural follow-up if subagent parity is wanted.merge_all_available_skills/extra_skill_dirsconfig.toml settings not modeled — the scanner always checks both.kimi-code/skillsand.agents/skillsunconditionally, same as how no other scanner in this codebase reads a client's own settings to conditionally change what it looks for.findUpwardDirwalk, not Kimi's real git-root resolution — this mirrors the codebase's existing, pre-existing simplification for every other client's project-scope resolution (none of which are git-root-exact either), not a new approximation introduced here.🤖 Generated with Claude Code