Skip to content

Commit 28c091a

Browse files
author
超渡法師
committed
fix(acp): prepend $HOME/.local/bin to agent subprocess PATH
agentcore clears env and rebuilds PATH for spawned agents, but the fallback did not include ~/.local/bin where user-installed tools like uv live. This caused 'uv: not found' errors at runtime. Prepend $HOME/.local/bin to PATH so agents can find tools installed via standard user-local paths without requiring absolute paths in skill definitions.
1 parent fd1d734 commit 28c091a

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/acp/connection.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,11 @@ impl AcpConnection {
296296
// Preserve the real HOME so agents can find OAuth/auth files (~/.codex,
297297
// ~/.claude, ~/.config/gh, etc.). working_dir is already set via
298298
// current_dir() above and is not necessarily the user's home directory.
299-
cmd.env(
300-
"HOME",
301-
std::env::var("HOME").unwrap_or_else(|_| working_dir.into()),
302-
);
303-
cmd.env(
304-
"PATH",
305-
std::env::var("PATH").unwrap_or_else(|_| "/usr/local/bin:/usr/bin:/bin".into()),
306-
);
299+
let home = std::env::var("HOME").unwrap_or_else(|_| working_dir.into());
300+
cmd.env("HOME", &home);
301+
let base_path =
302+
std::env::var("PATH").unwrap_or_else(|_| "/usr/local/bin:/usr/bin:/bin".into());
303+
cmd.env("PATH", format!("{}/.local/bin:{}", home, base_path));
307304
#[cfg(unix)]
308305
{
309306
cmd.env(

0 commit comments

Comments
 (0)