From 9210de0a1849286bf609bf586660d77bfdf3445d Mon Sep 17 00:00:00 2001 From: Bradley Axen Date: Thu, 9 Jan 2025 19:45:40 -0800 Subject: [PATCH] fix: Set stdin to null in shell/bash tools (#568) --- crates/goose-mcp/src/developer/mod.rs | 1 + crates/goose-mcp/src/developer2/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/goose-mcp/src/developer/mod.rs b/crates/goose-mcp/src/developer/mod.rs index 466ae75b86..c50fc32d32 100644 --- a/crates/goose-mcp/src/developer/mod.rs +++ b/crates/goose-mcp/src/developer/mod.rs @@ -271,6 +271,7 @@ impl DeveloperRouter { let child = Command::new("bash") .stdout(Stdio::piped()) // These two pipes required to capture output later. .stderr(Stdio::piped()) + .stdin(Stdio::null()) .kill_on_drop(true) // Critical so that the command is killed when the agent.reply stream is interrupted. .arg("-c") .arg(cmd_with_redirect) diff --git a/crates/goose-mcp/src/developer2/mod.rs b/crates/goose-mcp/src/developer2/mod.rs index 451305aa4e..730b3e54b6 100644 --- a/crates/goose-mcp/src/developer2/mod.rs +++ b/crates/goose-mcp/src/developer2/mod.rs @@ -169,6 +169,7 @@ impl Developer2Router { let child = Command::new("bash") .stdout(Stdio::piped()) // These two pipes required to capture output later. .stderr(Stdio::piped()) + .stdin(Stdio::null()) .kill_on_drop(true) // Critical so that the command is killed when the agent.reply stream is interrupted. .arg("-c") .arg(cmd_with_redirect)