fix: unified system dependency check; start without Git Bash (#291)#305
fix: unified system dependency check; start without Git Bash (#291)#305fancyboi999 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 023a33f The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e58592bb9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1e58592 to
6db4699
Compare
|
Heads-up on CI: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6db4699d94
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
6db4699 to
ecdad28
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecdad282ab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ecdad28 to
d8c74e0
Compare
…tAI#291) External CLI tools (ripgrep, fd, Git Bash on Windows) were each probed, degraded, and described in a different corner of the codebase, with inconsistent severity: ripgrep auto-downloads, fd degraded silently, and a missing Windows Git Bash crashed the whole CLI at core construction (MoonshotAI#259) even though only the Bash tool needs a shell. - kaos: detectEnvironment returns shellAvailable / shellUnavailableReason metadata instead of throwing, so the CLI starts without Git Bash. - agent-core: ToolManager omits the Bash tool when the shell is unavailable; the system prompt explains why. Removes the now-dead KaosShellNotFoundError, ErrorCodes.SHELL_GIT_BASH_NOT_FOUND, and the core-impl catch that translated them. - node-sdk: expose KimiHarness.getEnvironment() over the RPC seam. - app: a declarative system-dependency registry + pure check + report (apps/kimi-code/src/cli/system-deps). Startup warns when fd is missing outside a git repo or the shell is unavailable; /status reports the health of all three. fd absence is no longer silent. - docs: declare the system dependencies (getting-started, tools). Supersedes the piecemeal approaches in MoonshotAI#261 (git bash) and MoonshotAI#290 (fd).
d8c74e0 to
023a33f
Compare
|
Hi @liruifengv 👋 — a gentle ping on this one, no rush at all. This PR takes #291 ("check system dependencies at startup") and unifies the A few questions so I can make this easy to review (or close cleanly if it's not the right fit):
Status: rebased on latest |
Related Issue
Resolves #291. Also fixes the crash in #259 and supersedes the piecemeal approaches in #261 (Git Bash) and #290 (fd).
Problem
Kimi Code CLI depends on three external command-line tools —
ripgrep,fd, and a POSIX shell (Git Bash on Windows) — but they are not standard system dependencies and were handled by three inconsistent, scattered strategies:ripgrep(rg)rg-locator).fdfd-detect, then degraded silently — users never knew@completion was reduced.detectEnvironmentthrew, soKimiCoreconstruction failed and the whole CLI crashed at startup (#259) — even though only theBashtool needs a shell.There was no single place that answered "is X a dependency, and what happens when it is missing?", and the docs never declared these dependencies.
What changed
Start without Git Bash (root cause of #259)
kaos:detectEnvironmentnow returnsshellAvailable/shellUnavailableReasonmetadata instead of throwing.agent-core:ToolManageromits theBashtool when the shell is unavailable; the system prompt explains the Bash tool is unavailable and to use the built-in file tools. Removed the now-deadKaosShellNotFoundError,ErrorCodes.SHELL_GIT_BASH_NOT_FOUND, and thecore-implcatch that translated them.Unified system-dependency check (the core of #291)
apps/kimi-code/src/cli/system-deps/: a declarativeregistry(single source of truth: purpose, required/optional, auto-bootstrap, fallback, fix hint, warning policy), a purecheck(evaluateDependencies), and areportrenderer.fdis missing outside a git repository (inside one, thegit ls-filesfallback keeps it quiet) or when the shell is unavailable./statusreports the health of all three.fdabsence is no longer silent.node-sdk:KimiHarness.getEnvironment()exposes the resolved environment over the RPC seam so the check reads the core's single source of truth instead of re-probing.Docs
getting-started(en/zh) andtools.md(en/zh).Checklist
gen-changesetsskill, or this PR needs no changeset. (changeset added)gen-docsskill, or this PR needs no doc update. (docs updated)Validation
Verified before (baseline green) and after each layer:
corepack pnpm exec vitest run— 5176 passed / 25 skipped (opt-in e2e) / 2 todo, zero failures.corepack pnpm run build:packages— exit 0 (kaos → agent-core → node-sdk compile).corepack pnpm --filter @moonshot-ai/kimi-code run typecheck— exit 0.corepack pnpm exec oxlint --type-awareon changed files — 0 warnings, 0 errors.fdabsent andrgpresent, ran the realdetectEnvironment(win32, no bash)→ returnsshellAvailable=falsewithout throwing; a realKimiHarness.getEnvironment()round-trip succeeds; the unified check correctly produces no warning forfdinside a git repo, a warning outside one, and reportsrg/shellhealth.New tests: Windows shell detection (kaos), Bash-tool omission + unavailable-shell prompt rendering (agent-core), the dependency decision matrix and renderer (
system-deps), and startup-warning scenarios (TUI).