diff --git a/server/src/agents/pool/pipeline/completion.rs b/server/src/agents/pool/pipeline/completion.rs index 182ad145..a0aa40b8 100644 --- a/server/src/agents/pool/pipeline/completion.rs +++ b/server/src/agents/pool/pipeline/completion.rs @@ -201,19 +201,18 @@ pub(in crate::agents::pool) async fn run_server_owned_completion( // Kill any in-flight cargo test processes for this worktree so they don't // hold the build lock while gates try to run. - if let Some(wt_path) = worktree_path.as_ref() { - if let Ok(output) = std::process::Command::new("pgrep") + if let Some(wt_path) = worktree_path.as_ref() + && let Ok(output) = std::process::Command::new("pgrep") .args(["-f", &format!("--manifest-path {}/Cargo.toml", wt_path.display())]) .output() - { - let pids = String::from_utf8_lossy(&output.stdout); - for pid_str in pids.lines() { - if let Ok(pid) = pid_str.trim().parse::() { - crate::slog!( - "[agents] Killing stale cargo process (pid {pid}) for '{story_id}' before running gates" - ); - unsafe { libc::kill(pid, libc::SIGKILL); } - } + { + let pids = String::from_utf8_lossy(&output.stdout); + for pid_str in pids.lines() { + if let Ok(pid) = pid_str.trim().parse::() { + crate::slog!( + "[agents] Killing stale cargo process (pid {pid}) for '{story_id}' before running gates" + ); + unsafe { libc::kill(pid, libc::SIGKILL); } } } } diff --git a/server/src/http/mcp/shell_tools.rs b/server/src/http/mcp/shell_tools.rs index 7d5e82e3..302b3fee 100644 --- a/server/src/http/mcp/shell_tools.rs +++ b/server/src/http/mcp/shell_tools.rs @@ -399,11 +399,11 @@ pub(super) async fn tool_run_tests(args: &Value, ctx: &AppContext) -> Result