feat!: rebuild as a generic Kimi CLI wrapper - #1
Open
userFRM wants to merge 1 commit into
Open
Conversation
Replace the 14-tool file/shell/web passthrough surface — which duplicated capabilities the MCP client already has — with a thin, generic wrapper over the Kimi CLI's headless print mode. Tools: kimi_run (send a prompt, optional working directory), kimi_resume (continue a session by id), kimi_status (installed binary, version, auth health). The runner classifies Kimi's documented exit codes (0 ok, 1 permanent, 75 transient), retries transient failures with backoff, enforces a wall-clock timeout via a process-group kill, and detects quota/balance failures even when the CLI exits 0. Binary resolution prefers the native installer path (~/.kimi-code/bin/kimi) and falls back to the legacy uv install and PATH. Auth detection covers OAuth credentials, kimi.json, and an api_key in config.toml. Tool auto-approval (-y) is off by default and opt-in per-call (yolo) or via KIMI_YOLO, so an unsupervised agent cannot mutate a repo or run shell without consent. BREAKING CHANGE: all previous tools are removed and replaced. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Complete breaking rebuild. The old surface mirrored Kimi's internal file/shell/web tools (14 of them), duplicating what the MCP client already has. This replaces it with a thin, generic wrapper over the Kimi CLI's headless print mode.
Tools
kimi_run— send a prompt to the Kimi agent, optionally scoped to a working directory; returns the final answer.kimi_resume— continue a prior session by id with a follow-up prompt.kimi_status— installed binary (native vs legacy), version, and auth health.Robustness
~/.kimi-code/bin/kimi, then legacy~/.local/bin/kimi, then$PATH.kimi.json, and anapi_keyinconfig.toml.Safety
Tool auto-approval (
-y) is off by default and opt-in per-call (yolo) or viaKIMI_YOLO, so an unsupervised agent cannot mutate a repo or run shell without consent.Verification
kimi_statusreports installed + authenticated.🤖 Generated with Claude Code