Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion desktop/src-tauri/src/commands/agent_model_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions desktop/src-tauri/src/managed_agents/readiness/cli_probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
let home = dirs::home_dir();
let nvm_bin = home
Expand Down
Loading