Skip to content

Improve Kimi Code runtime discovery - #3084

Open
ninjusai wants to merge 1 commit into
block:mainfrom
ninjusai:feat/kimi-runtime
Open

Improve Kimi Code runtime discovery#3084
ninjusai wants to merge 1 commit into
block:mainfrom
ninjusai:feat/kimi-runtime

Conversation

@ninjusai

Copy link
Copy Markdown

Summary

  • probe Kimi Code's standalone ~/.kimi-code/bin install directory so GUI-launched Desktop processes can resolve kimi
  • keep the Kimi preset on kimi acp and point its setup guidance to the official Kimi Code CLI documentation
  • document the harness configuration and add regression coverage for discovery and preset arguments

Tests

  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml -- --check
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml kimi -- --test-threads=1 — 2 passed
  • full serial Tauri suite — 1,693 passed, 10 ignored; the existing order-dependent managed_agents::runtime::tests::claude_spawn_uses_the_probed_cli_executable test failed in-suite and passed immediately in isolation on the same commit

Co-authored-by: ninjusai <192658217+ninjusai@users.noreply.github.com>

Signed-off-by: ninjusai <192658217+ninjusai@users.noreply.github.com>
@linxule

linxule commented Jul 28, 2026

Copy link
Copy Markdown

One data point on the discovery path, in case it's useful for scoping this.

I hit this exact symptom (Kimi Code showing "CLI needed" on a GUI-launched Buzz while kimi worked fine in a terminal), but ~/.kimi-code/bin wouldn't have resolved it. Kimi Code also ships as an npm package (@moonshot-ai/kimi-code), so a bun add -g / npm-global install puts the executable in the package manager's bin dir instead:

$ ls ~/.kimi-code/bin
rg

$ command -v kimi
/Users/…/.bun/bin/kimi -> ../install/global/node_modules/@moonshot-ai/kimi-code/dist/main.mjs

~/.kimi-code exists and holds config/credentials/cache, but bin/ only has a vendored rg — no kimi. So the standalone-installer probe here and the package-manager install route are two separate cases.

The underlying cause is the same one this PR's comment describes, and it isn't Kimi-specific: ~/.bun/bin isn't in common_binary_paths(), and bun's installer writes its PATH export to ~/.zshrc (interactive), so find_via_login_shell() can't recover it either — same as the nvm situation already documented in resolve_command_uncached.

I opened #3343 to add ~/.bun/bin to common_binary_paths(), which should be complementary to this rather than overlapping: this PR covers the standalone installer, that one covers bun-installed CLIs generally (it fixed Codex on my machine too, for the same reason).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants