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