fix(client): gate Kimi capability on official CLI install#2018
fix(client): gate Kimi capability on official CLI install#2018yuezengwu wants to merge 3 commits into
Conversation
Computer availability for kimi-code now tracks a real host `kimi` binary (PATH / well-known dirs / login-shell PATH). The bundled SDK remains the execution engine and no longer alone reports state=ok. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
baixiaohang
left a comment
There was a problem hiding this comment.
Recommendation: request changes
- Rationale: The new gate implements the intended install-only Kimi contract, but it misses the official installer's default binary directory, so a supported installation can remain falsely unavailable.
Risk level: A
- Path baseline: includes
packages/client/**→ A - Semantic lift: none (already A)
PR summary
- Author / repo: yuezengwu / agent-team-foundation/first-tree
- Problem: A user could previously select Kimi from a Computer merely because First Tree bundled the SDK, even when the host lacked the official CLI needed for provider-owned login and recovery.
- Approach: Gate the Kimi capability on an existence-only host
kimilookup, keep execution on the bundled SDK, and align Computer recovery copy plus the QA checklist with that split. - Impacted modules: Client capability/binary discovery, Computer provider setup surfaces, and runtime QA guidance.
Review findings
❌ 1. The resolver does not search the official installer's default directory. The official macOS/Linux and Windows installers place the binary under $HOME/.kimi-code/bin / %USERPROFILE%\.kimi-code\bin, but wellKnownBinDirs(home) does not include that location. A running daemon keeps its pre-install process.env.PATH, and Windows deliberately has no login-shell PATH fallback, so installing Kimi through the recommended official script can leave every background re-probe at state=missing until a restart (and potentially beyond it, depending on service PATH propagation). Please add the Kimi-specific official install directory to the cheap well-known lookup and cover the empty-daemon-PATH / empty-login-shell case, including Windows naming. [R5 / packages/client/src/runtime/kimi-binary.ts:69]
Action taken
- Submitted request changes.
The official install.sh/install.ps1 place the CLI under $HOME/.kimi-code/bin, which a frozen daemon PATH (and Windows, which has no login-shell PATH probe) would otherwise miss until restart. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the request-changes finding in
|
Independent QA — exact head
|
|
@baixiaohang Ready for re-review on current head Your CHANGES_REQUESTED finding (official installer dir Independent QA locked that same head and reported no defects in the change scope (check/typecheck/build, focused + full client tests, all GitHub CI green, final built CLI probe behavior). Please re-review when you can. |
Summary
kimiCLI (daemon PATH → well-known install dirs including official$HOME/.kimi-code/bin→ login-shell PATH), matching other provider binary discovery.state=missing/available=false. Present CLI →state=ok/available=true, still withruntimeSource: bundledbecause@botiverse/kimi-code-sdkremains the execution engine.Cross-links Context Tree decision: https://github.com/agent-team-foundation/first-tree-context/pull/822
Test plan
pnpm exec vitest run src/__tests__/kimi-code-capability.test.ts src/__tests__/kimi-binary.test.ts(packages/client) — 13 passedpnpm typecheck(packages/client)pnpm testin packages/client — 1652 passedpnpm testin packages/web — 1738 passed (includes kimi provider surface copy)c1dbcea90af77901db1fe9d9a171a6963f5841fa— change-scoped PASS (see QA comment); formal first-tree-qa remains BLOCKED for full product matrix