Skip to content

Commit bf8a73a

Browse files
wpfleger96npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw
andauthored
fix(desktop): use augmented PATH for model discovery subprocess (#2753)
On Windows, the model dropdown never populates for CLI harnesses (Claude Code, Codex) while the same flow works on macOS. Model discovery spawns `buzz-acp models` with `PATH` taken from `login_shell_path()` — which by design always returns `None` on Windows (Git Bash's POSIX-shaped PATH would poison native children). The discovery child therefore ran with only the raw inherited process PATH, missing the Buzz-managed Node/npm directories and exe-parent sidecar dir, so the ACP adapter's `.cmd` shims failed to resolve `node` and discovery returned nothing. macOS worked only because a login-shell PATH exists there. The fix reuses the existing `augmented_path()` helper (already used by CLI login probes and auth commands, built on the same `build_augmented_path` kernel as the real agent spawn), so model discovery resolves the identical toolchain the agent will actually run with. `login_shell_path()` remains the login-shell component inside that composition — on macOS the composed PATH is a superset of the previous value. Related: #2661 (managed Node fallback these entries point at), reported in the Windows install-issues follow-up. Signed-off-by: Will Pfleger <[email protected]> Co-authored-by: npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw <4a1bfa0013bc6d14a8d600d8bf6392efefbd2a26ac3c96c9b2a106b0d12297ca@buzz.block.builderlab.xyz>
1 parent a555f9e commit bf8a73a

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎desktop/src-tauri/src/commands/agent_model_process.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ pub(super) async fn run_agent_models_command(
2727
if let Some(home) = default_agent_workdir() {
2828
cmd.current_dir(home);
2929
}
30-
if let Some(ref path) = crate::managed_agents::login_shell_path() {
30+
// Inject the same augmented PATH used for launched agents and CLI
31+
// probes: managed Node/npm dirs, exe-parent sidecars, login-shell
32+
// PATH, and (Windows) the inherited process PATH. login_shell_path()
33+
// alone is always None on Windows, which left this child with no
34+
// managed Node dirs — the ACP adapter's `.cmd` shims then failed with
35+
// `'node' is not recognized` and the model dropdown stayed empty.
36+
if let Some(ref path) = crate::managed_agents::readiness::cli_probe::augmented_path() {
3137
cmd.env("PATH", path);
3238
}
3339
cmd.arg("models")

‎desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ use std::path::Path;
22

33
use crate::managed_agents::runtime::build_augmented_path;
44

5-
/// Build the augmented PATH for CLI probes, including nvm's default Node.js
6-
/// bin directory so `#!/usr/bin/env node` shims (e.g. codex-acp) resolve.
5+
/// Build the augmented PATH for CLI probes and other native child processes
6+
/// (auth commands, `buzz-acp models` discovery), including nvm's default
7+
/// Node.js bin directory so `#!/usr/bin/env node` shims (e.g. codex-acp)
8+
/// resolve.
79
pub(crate) fn augmented_path() -> Option<String> {
810
let home = dirs::home_dir();
911
let nvm_bin = home

0 commit comments

Comments
 (0)