feat(quorum): add Kimi Code (kimi) as a native CLI quorum family#373
Conversation
Kimi Code ships a `kimi` binary (~/.kimi-code/bin/kimi, v0.27.0) with a headless contract identical to gemini/antigravity: `-p/--prompt <prompt>` runs one prompt non-interactively and prints the response (verified against --help). Wires it as a quorum CLI family the same way antigravity was added (PR #274) — kimi is simpler because its family name == its binary name (no agy-style exception). Wiring (mirrors antigravity across the family registries): - provider-arg-templates.cjs: FAMILY_ARGS_TEMPLATE.kimi = ['-p','{prompt}'] (the dispatch contract — unified-mcp-server invokes `kimi -p "<prompt>"`). - install.js: both KNOWN_CLIS PATH-detection lists, NF_KEYWORD_MAP (mcp__kimi-1__ prefix), KNOWN_CLI_PREFIXES, and getInstallHint — so a `kimi` on PATH is auto-detected and wired as a slot on install. - skill-mcp-lint.cjs: VALID_TOOLS.kimi = [kimi, identity, health_check, deep_health_check, help, ping] — so `mcp__kimi-1__kimi` passes the lint gate and the wrong-tool (`ask`) class is still flagged. - nForma.cjs + update-agents.cjs: install metadata (installType 'self-update', bin 'kimi', `kimi upgrade`); unknown installType falls through to null in the updater (shows 'unknown', no crash — same as antigravity's curl-script). - token-dashboard.cjs: kimi = subscription (managed oauth, flat-fee). - update-scoreboard.cjs: 'kimi' was already in VALID_MODELS — no change. Scope: this adds kimi as a quorum SLOT (a model nForma queries), NOT as an IDE install-target (a runtime nForma installs its own commands into) — kimi-code's acp/server modes are out of scope for this change. Tests: kimi cases added to provider-arg-templates.test.cjs (template exists, -p dispatch, buildSpawnArgs), skill-mcp-lint.test.cjs (family recognized + wrong-tool flagged), update-scoreboard.test.cjs (SC-TC11c: --model kimi accepted). 68/68 in the three family suites; install-virgin, token-dashboard, nForma blast-radius suites green.
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughKimi is registered as a native quorum CLI with canonical prompt dispatch, PATH and MCP discovery, tool validation, updater metadata, subscription accounting, changelog documentation, and regression tests. ChangesKimi quorum integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bin/update-agents.cjs`:
- Around line 30-33: Implement the self-update flow before registering Kimi: in
bin/update-agents.cjs around lines 30-33, update current/latest version
detection and runUpdate to support installType self-update using Kimi’s
configured upgrade command; in bin/nForma.cjs around line 2562, dispatch
self-update explicitly to kimi upgrade instead of the generic Copilot fallback.
Add regression tests covering both update flows.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 33bdc838-dded-43ba-95fd-5aa6a62d9299
📒 Files selected for processing (10)
CHANGELOG.mdbin/install.jsbin/nForma.cjsbin/provider-arg-templates.cjsbin/provider-arg-templates.test.cjsbin/skill-mcp-lint.cjsbin/skill-mcp-lint.test.cjsbin/token-dashboard.cjsbin/update-agents.cjsbin/update-scoreboard.test.cjs
…opilot's command CodeRabbit (PR #373): the kimi self-update metadata didn't make kimi updatable, and worse — nForma.cjs's update executor ran `gh extension upgrade copilot` for EVERY non-npm-global family. That is a pre-existing bug: antigravity (curl-script) hit the same wrong branch. And update-agents.cjs's runUpdate had no branch for those types at all, so it no-op'd and reported an error. Root cause is duplication: nForma.cjs and update-agents.cjs each carried their own copy of the routing (P3). Extracted one shared `resolveUpdateCommand(meta)` in update-agents.cjs and routed both callers through it: - npm-global → npm install -g <pkg>@latest - gh-extension → gh extension upgrade copilot - curl-script / self-update / any installCommand → run meta.installCommand via shell (may contain a pipe) - unknown → null; callers surface "update manually" instead of running a wrong command So kimi now updates via `kimi upgrade`, antigravity via its curl installer, and the copilot command is reached ONLY by copilot. New bin/update-agents.test.cjs (7 cases) pins each family's command and guards the specific defect (kimi/antigravity must never resolve to copilot; a piped command must use shell; npm-global without pkg → null, never `undefined@latest`). nForma.test.cjs 112/112 (stable across 3 runs; the one transient fail was the known TUI-on-require flake).
What
Adds Kimi Code as a native quorum CLI family, so a
kimibinary on PATH is auto-detected and dispatched like codex/gemini/copilot/opencode/antigravity.Answers the user's question directly: "does nForma support Kimi Code as a slot?" — Kimi is both a Claude-Code preset (already supported as a Daintree/HTTP model slot) and a dedicated CLI. This PR adds the CLI-family half.
Verified against the real binary
~/.kimi-code/bin/kimiv0.27.0 —--helpshows-p, --prompt <prompt>("run one prompt non-interactively and print the response"), identical in shape to gemini/antigravity. Live end-to-end probe (the exact argv the quorum builds):Wiring (mirrors antigravity PR #274; kimi is simpler — family name == binary name)
provider-arg-templates.cjsFAMILY_ARGS_TEMPLATE.kimi = ['-p','{prompt}']— the dispatch contractinstall.jsKNOWN_CLISPATH-detection lists,NF_KEYWORD_MAP(mcp__kimi-1__),KNOWN_CLI_PREFIXES, install-hintskill-mcp-lint.cjsVALID_TOOLS.kimi—mcp__kimi-1__kimipasses; wrong tool (ask) still flaggednForma.cjs+update-agents.cjsself-updateviakimi upgrade; unknown installType → "unknown", no crash)token-dashboard.cjsupdate-scoreboard.cjskimialready inVALID_MODELS— no changeScope
Kimi as a quorum slot (a model nForma queries), not as an IDE install-target (a runtime nForma installs its own commands into). Kimi-code's
acp/servermodes are out of scope.Tests — mutation-proven red against a committed baseline
New kimi cases in
provider-arg-templates.test.cjs,skill-mcp-lint.test.cjs,update-scoreboard.test.cjs(SC-TC11c). I caught that the initialrecognizes the kimi familytest was vacuous (a baredeepEqual([])passes for an unknown slot too — the same anti-pattern CodeRabbit flagged on an earlier PR) and strengthened it to assert kimi is a registered family. 68/68 in the family suites; install-virgin / token-dashboard / nForma blast-radius suites green.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
kimicommand.Bug Fixes
Tests