From 2303527a96f1da110e6e7da06dc9bdaf343d9eed Mon Sep 17 00:00:00 2001 From: AkitaOnRails Date: Thu, 1 Oct 2026 12:24:39 -0300 Subject: [PATCH] fix(run): make jail preflight path portable --- crates/ai-memory-workstream/src/jail.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ai-memory-workstream/src/jail.rs b/crates/ai-memory-workstream/src/jail.rs index b4b7cb23..2234ef3e 100644 --- a/crates/ai-memory-workstream/src/jail.rs +++ b/crates/ai-memory-workstream/src/jail.rs @@ -76,8 +76,12 @@ fn preflighted_ai_jail( /// protected-Nix-store exception) so our offer cannot lead directly to a /// refusal that the shallower PATH probe missed. fn ai_jail_preflight(ai_jail: &Path) -> bool { + let Ok(current_exe) = std::env::current_exe() else { + return false; + }; std::process::Command::new(ai_jail) - .args(["--dry-run", "--", "/bin/true"]) + .args(["--dry-run", "--"]) + .arg(current_exe) .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null())