From db7ef65e4a41c17512426f6376c61b53374506bd Mon Sep 17 00:00:00 2001 From: Johannes Kresner Date: Sun, 15 Nov 2026 22:51:24 +0100 Subject: [PATCH] fix: sandbox mode not working --- src/acp.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acp.rs b/src/acp.rs index caa3803..0151b9b 100644 --- a/src/acp.rs +++ b/src/acp.rs @@ -63,17 +63,17 @@ impl Acp { pub fn spawn(p: &Profile, worktree: &Path, id: &str) -> Result { let mut parts = p.hx.split_whitespace(); let mut cmd = Command::new(parts.next().context("empty hx command")?); - cmd.args(parts) - .args(["serve", "--acp", "--cwd"]) - .arg(worktree) - .args(["--session", id]); + // sandbox and permission flags are options of the root command, so they go before `serve` // the TUI answers permission requests itself, so yolo only when the profile asks for it explicitly let flags = p.hx_flags(); - cmd.args( + cmd.args(parts).args( flags .iter() .filter(|f| **f != "--yolo" || p.yolo == Some(true)), ); + cmd.args(["serve", "--acp", "--cwd"]) + .arg(worktree) + .args(["--session", id]); // same cleared environment as the batch runner: orch's secrets never reach the agent cmd.env_clear().envs(hx_env(std::env::vars(), p)); if let Some(h) = &p.home {