Skip to content

Add Kimi Code's default install path to managed-agent binary discovery - #5997

Merged
ngthuydiem merged 1 commit into
block:mainfrom
shawnhank:fizz/kimi-code-path-discovery
Sep 30, 2026
Merged

ngthuydiem merged 1 commit into
block:mainfrom
shawnhank:fizz/kimi-code-path-discovery

Conversation

@shawnhank

@shawnhank shawnhank commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Buzz Desktop fails to detect a freshly-installed Kimi Code CLI, even though kimi --version works fine in the terminal. Root cause is in binary discovery, not in Kimi's install.

Problem

After running Kimi Code's installer, Buzz Desktop's harness list doesn't pick up the kimi binary — it stays undetected until the user manually sources their shell config.

Repro

  1. Install Kimi Code: curl ... code.kimi.com/kimi-code/install.sh | bash — installs to ~/.kimi-code/bin, and the installer appends a PATH export only to ~/.zshrc.
  2. Open a fresh terminal or restart Buzz Desktop without source ~/.zshrc.
  3. Buzz Desktop does not detect kimi, even though it's on disk and executable.

Root cause

find_via_login_shell() in desktop/src-tauri/src/managed_agents/discovery.rs resolves binaries by spawning zsh -l -c 'command -v <bin>'. A login shell sources ~/.zprofile/~/.zshenv, but zsh only sources ~/.zshrc for interactive shells — so a PATH export that lives only in ~/.zshrc (which is where Kimi's installer puts it) is invisible to this probe. ~/.kimi-code/bin is also absent from the static fallback list in common_binary_paths().

This is the same root-cause class already handled for nvm in this file (see the find_nvm_default_bin comment) — Kimi just doesn't have an equivalent fallback yet.

Fix

Add ~/.kimi-code/bin to the Unix branch of common_binary_paths(), alongside the existing .volta/bin / .bun/bin / .asdf/shims entries.

Scope note

This PR only fixes detection (finding the binary). It does not address that Kimi shows a "Ready" badge regardless of login status — that's a separate, larger gap affecting all five preset harnesses (Kimi, OpenCode, Amp, Hermes, OpenClaw), tracked separately.

Test plan

  • just ci passes
  • Manual: fresh Kimi install per repro steps above, confirm Buzz Desktop shows it without sourcing ~/.zshrc

Buzz Desktop fails to detect a freshly-installed Kimi Code CLI even
though `kimi --version` works in the terminal. Kimi's installer places
the binary at ~/.kimi-code/bin and appends its PATH export only to
~/.zshrc, which the login-shell discovery probe (zsh -l, non-interactive)
never sources. Add the directory to the static fallback list, matching
the existing entries for volta/asdf/bun.

Signed-off-by: Shawn Hank <shawn@shawnhank.com>
@shawnhank
shawnhank requested a review from a team as a code owner August 15, 2026 23:50

@themiguelamador themiguelamador left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against Kimi Code's current official installer: KIMI_INSTALL_DIR defaults to $HOME/.kimi-code, and the script installs the executable at $HOME/.kimi-code/bin/kimi. The fallback is also ordered correctly after PATH and login-shell discovery, so it does not override a user-selected installation.

The patch is clean and the focused Tauri managed-path test passes after staging the repository's required sidecar stubs. No correctness or minor issues found.

@ngthuydiem ngthuydiem added the triage-ready Appropriate for agentic review label Sep 29, 2026
@ngthuydiem

Copy link
Copy Markdown
Contributor

checks were not triggered. closing & reopening to trigger the checks for this PR.

@ngthuydiem ngthuydiem closed this Sep 29, 2026
@ngthuydiem ngthuydiem reopened this Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 12dbb114aad72b89d17d6d1c668d8d4c3fdad2ae...2f592d7b459ad270dd68d2b3656dd01262764a3f.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 2f592d7b459ad270dd68d2b3656dd01262764a3f to authorize a new review.
Any previous review applies only to its recorded range.

@ngthuydiem ngthuydiem closed this Sep 29, 2026
@ngthuydiem ngthuydiem reopened this Sep 29, 2026
@ngthuydiem
ngthuydiem merged commit 2664d14 into block:main Sep 30, 2026
116 of 119 checks passed
wpfleger96 added a commit that referenced this pull request Sep 30, 2026
…i-port

* origin/main:
  fix(agents): stop built-in prompts from teaching sleep polling (#7992)
  feat(relay): add direct staff ban/timeout/delete with staff guard (#7883)
  fix(ci): gate security review on repo write access (#7986)
  feat(acp): wrap workers at the subprocess launch boundary (#7985)
  feat(buzz-relay): idempotent owner community deletion with quota reservation (#7969)
  feat(mobile): show contextual names in lists, Search and Pulse (#7896)
  Add Kimi Code's default install path to managed-agent binary discovery (#5997)

Co-authored-by: Will Pfleger <wpfleger@block.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants