From 7d02575d71dd09bbc0319533ac29787fec326c5b Mon Sep 17 00:00:00 2001 From: npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw <4a1bfa0013bc6d14a8d600d8bf6392efefbd2a26ac3c96c9b2a106b0d12297ca@buzz.block.builderlab.xyz> Date: Fri, 24 Jul 2026 15:47:14 -0400 Subject: [PATCH] fix(desktop): use augmented PATH for model discovery subprocess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model discovery spawns buzz-acp models with PATH from login_shell_path(), which is always None on Windows by design — the child inherited a raw process PATH missing the Buzz-managed Node/npm dirs, so the ACP adapter's .cmd shims failed to find node and the model dropdown stayed empty (works on macOS only because a login-shell PATH exists there). Reuse the same augmented-PATH helper the CLI probes and launched agents use, so model discovery resolves the identical toolchain the agent will actually run with. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/src-tauri/src/commands/agent_model_process.rs | 8 +++++++- .../src-tauri/src/managed_agents/readiness/cli_probe.rs | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/desktop/src-tauri/src/commands/agent_model_process.rs b/desktop/src-tauri/src/commands/agent_model_process.rs index ea9a771dea..998edeca27 100644 --- a/desktop/src-tauri/src/commands/agent_model_process.rs +++ b/desktop/src-tauri/src/commands/agent_model_process.rs @@ -27,7 +27,13 @@ pub(super) async fn run_agent_models_command( if let Some(home) = default_agent_workdir() { cmd.current_dir(home); } - if let Some(ref path) = crate::managed_agents::login_shell_path() { + // Inject the same augmented PATH used for launched agents and CLI + // probes: managed Node/npm dirs, exe-parent sidecars, login-shell + // PATH, and (Windows) the inherited process PATH. login_shell_path() + // alone is always None on Windows, which left this child with no + // managed Node dirs — the ACP adapter's `.cmd` shims then failed with + // `'node' is not recognized` and the model dropdown stayed empty. + if let Some(ref path) = crate::managed_agents::readiness::cli_probe::augmented_path() { cmd.env("PATH", path); } cmd.arg("models") diff --git a/desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs b/desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs index 45db7fd669..513da4e2a8 100644 --- a/desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs +++ b/desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs @@ -2,8 +2,10 @@ use std::path::Path; use crate::managed_agents::runtime::build_augmented_path; -/// Build the augmented PATH for CLI probes, including nvm's default Node.js -/// bin directory so `#!/usr/bin/env node` shims (e.g. codex-acp) resolve. +/// Build the augmented PATH for CLI probes and other native child processes +/// (auth commands, `buzz-acp models` discovery), including nvm's default +/// Node.js bin directory so `#!/usr/bin/env node` shims (e.g. codex-acp) +/// resolve. pub(crate) fn augmented_path() -> Option { let home = dirs::home_dir(); let nvm_bin = home