From 3324711c966053a5f229ed81169547ecb19ef6fe Mon Sep 17 00:00:00 2001 From: Ramiro Salas Date: Fri, 6 Feb 2026 08:20:49 -0800 Subject: [PATCH] fix(codex): propagate extended PATH to codex subprocess (#6874) Signed-off-by: RamXX --- crates/goose/src/providers/codex.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/goose/src/providers/codex.rs b/crates/goose/src/providers/codex.rs index c43f3992..fc03c8a1 100644 --- a/crates/goose/src/providers/codex.rs +++ b/crates/goose/src/providers/codex.rs @@ -157,6 +157,13 @@ impl CodexProvider { let mut cmd = Command::new(&self.command); configure_command_no_window(&mut cmd); + // Propagate extended PATH so the codex subprocess can find Node.js + // and other dependencies (especially when launched from the desktop app + // where the inherited PATH is limited). + if let Ok(path) = SearchPaths::builder().with_npm().path() { + cmd.env("PATH", path); + } + // Use 'exec' subcommand for non-interactive mode cmd.arg("exec");