fix(desktop): discover bun-installed agent CLIs in ~/.bun/bin - #3343
Open
linxule wants to merge 4 commits into
Open
fix(desktop): discover bun-installed agent CLIs in ~/.bun/bin#3343linxule wants to merge 4 commits into
linxule wants to merge 4 commits into
Conversation
common_binary_paths() probes mise, volta, asdf, nvm and ~/.local/bin, but not bun's global bin directory. bun's installer appends ~/.bun/bin to ~/.zshrc (interactive), which a login shell does not source, so the login-shell fallback in find_via_login_shell() cannot recover it either -- the same failure mode already documented for nvm. The result is that agent CLIs installed via bun are undiscoverable from a GUI-launched desktop app, and the runtime shows "CLI needed" for tools that run fine in an interactive terminal. Appended last so it cannot shadow a directory that already resolves. Signed-off-by: Xule Lin <43122877+linxule@users.noreply.github.com>
wpfleger96
approved these changes
Jul 28, 2026
wpfleger96
enabled auto-merge (squash)
July 28, 2026 20:06
Co-authored-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com> Signed-off-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com> * origin/main: chore(ci): bump desktop smoke E2E timeout to 30 minutes (block#3409) release(chart): publish 0.1.7 (block#3393) feat(acp): steer claude-code and codex agents via _session/steering (block#3007) feat(desktop): apply WebKit rendering workarounds at startup on Linux (block#3271) fix(desktop): stabilize flaky DM expansion E2E ordering assertions (block#2004) docs(contributing): document the Linux system libraries just ci requires (block#3396) fix(desktop): paint community rail full height (block#3382) fix(acp): disable goose cron scheduler in managed agent children (block#3144) feat(desktop): add custom harness inline from agent dialogs (block#3252) chore(compose): remove stale typesense env vars (block#3332) feat(desktop): refine agent catalog sharing (block#2439) fix(desktop): keep drafts out of the Inbox All view (block#3217) docs: restructure DCO guidance into scannable subsection (block#3337) Unify mobile loading spinners (block#3314) fix(desktop): restore the inbox icon in the sidebar (block#3341) fix(desktop): gate codex-acp on a minimum supported version (block#3254) feat(cli): add users set-status command for NIP-38 profile status (block#3253) fix(composer): scope multiline block formatting (block#3246)
Adding ~/.bun/bin to the discovery paths takes discovery.rs to 1861 lines after merging main. Bump the existing override by one to match. Co-authored-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com> Signed-off-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com>
* origin/main: feat: add explicit entry for claude-opus-5 in model config (block#2831) fix(desktop): clear stale thread new-message pill (block#3411) fix(ci): ratchet file sizes against the base tree (block#3352) Co-authored-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com> Signed-off-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com> # Conflicts: # desktop/scripts/check-file-sizes.mjs
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.
Problem
common_binary_paths()probes mise shims,~/.local/bin, volta, asdf, and (further downresolve_command_uncached) nvm's default bin dir — but not bun's global bin directory,~/.bun/bin.bun's installer appends its bin dir to
~/.zshrc/~/.bashrc, which are interactive-only. A login shell never sources them, sofind_via_login_shell()can't recover the path either. That's the same failure mode already called out in this file for nvm:So for a GUI-launched desktop app, every rung of the resolution ladder misses a bun-installed CLI:
command_looks_like_path— no, presets use bare namesfind_via_login_shell—.zshrcnot sourcedcommon_binary_paths()—~/.bun/binabsentThis matters because bun is a common install route for the agent CLIs Buzz targets. Kimi Code in particular ships as an npm package (
@moonshot-ai/kimi-code), sobun add -gputs it at~/.bun/bin/kimi— exactly where discovery doesn't look.Reproduction
On macOS with
codexandkimiinstalled via bun, launching Buzz from Finder:Probing the way
find_via_login_shelldoes, in a clean environment:Launching the app with the bun dir on PATH resolves both immediately:
$ env PATH="$HOME/.bun/bin:$PATH" /Applications/Buzz.app/Contents/MacOS/buzz-desktopChange
One entry appended to the home-relative list in
common_binary_paths(). It goes last so it cannot shadow a directory that already resolves — the change can only add resolutions, never alter existing ones.Testing
cargo fmt --checkpasses.I was not able to run the full
just cigate locally:ring 0.17.14fails to build in this environment against the macOS 26.2 SDK (ccerror compilingp256-nistz.c), which is unrelated to this change. Relying on CI for the rest — the diff adds onePathBufto an existingVec<PathBuf>and introduces no new API.Notes
~/.kimi-code/binfor the same class of GUI-launch discovery failure. That covers Kimi's standalone installer; this covers the bun/npm-global install route. They're complementary — I've left a note on that PR.~/.bun/binis added. bun's global packages live under~/.bun/install/global/node_modulesbut are symlinked into~/.bun/bin, so the single directory is sufficient.~/.bun/bincontains nonode/npm/npx, so appending it can't shadow a system Node toolchain.