diff --git a/crates/goose-cli/src/commands/update.rs b/crates/goose-cli/src/commands/update.rs index 0b2db399bd..dadafb699c 100644 --- a/crates/goose-cli/src/commands/update.rs +++ b/crates/goose-cli/src/commands/update.rs @@ -30,6 +30,7 @@ pub fn update(canary: bool, reconfigure: bool) -> Result<()> { .env("CANARY", canary.to_string()) .env("CONFIGURE", reconfigure.to_string()) .env("GOOSE_TERMINAL", "1") + .env("AGENT", "goose") .spawn()?; update.wait_with_output()?; diff --git a/crates/goose-mcp/src/computercontroller/mod.rs b/crates/goose-mcp/src/computercontroller/mod.rs index 297d252491..f8a720883c 100644 --- a/crates/goose-mcp/src/computercontroller/mod.rs +++ b/crates/goose-mcp/src/computercontroller/mod.rs @@ -709,6 +709,7 @@ impl ComputerControllerServer { .arg("-File") .arg(&command) .env("GOOSE_TERMINAL", "1") + .env("AGENT", "goose") .output() .await .map_err(|e| { @@ -723,6 +724,7 @@ impl ComputerControllerServer { .arg(shell_arg) .arg(&command) .env("GOOSE_TERMINAL", "1") + .env("AGENT", "goose") .output() .await .map_err(|e| { diff --git a/crates/goose-mcp/src/computercontroller/platform/windows.rs b/crates/goose-mcp/src/computercontroller/platform/windows.rs index 8ea17f461c..95dc317046 100644 --- a/crates/goose-mcp/src/computercontroller/platform/windows.rs +++ b/crates/goose-mcp/src/computercontroller/platform/windows.rs @@ -12,6 +12,7 @@ impl SystemAutomation for WindowsAutomation { .arg("-Command") .arg(script) .env("GOOSE_TERMINAL", "1") + .env("AGENT", "goose") .output()?; Ok(String::from_utf8_lossy(&output.stdout).into_owned()) diff --git a/crates/goose-mcp/src/developer/shell.rs b/crates/goose-mcp/src/developer/shell.rs index 2e0a56b80a..fcbcbc7714 100644 --- a/crates/goose-mcp/src/developer/shell.rs +++ b/crates/goose-mcp/src/developer/shell.rs @@ -122,6 +122,7 @@ pub fn configure_shell_command( .stdin(Stdio::null()) .kill_on_drop(true) .env("GOOSE_TERMINAL", "1") + .env("AGENT", "goose") .env("GIT_EDITOR", "sh -c 'echo \"Interactive Git commands are not supported in this environment.\" >&2; exit 1'") .env("GIT_SEQUENCE_EDITOR", "sh -c 'echo \"Interactive Git commands are not supported in this environment.\" >&2; exit 1'") .env("VISUAL", "sh -c 'echo \"Interactive editor not available in this environment.\" >&2; exit 1'") diff --git a/crates/goose/src/agents/retry.rs b/crates/goose/src/agents/retry.rs index f185c0f55e..71f6238622 100644 --- a/crates/goose/src/agents/retry.rs +++ b/crates/goose/src/agents/retry.rs @@ -233,11 +233,13 @@ pub async fn execute_shell_command( let mut cmd = Command::new("cmd"); cmd.args(["/C", command]); cmd.env("GOOSE_TERMINAL", "1"); + cmd.env("AGENT", "goose"); cmd } else { let mut cmd = Command::new("sh"); cmd.args(["-c", command]); cmd.env("GOOSE_TERMINAL", "1"); + cmd.env("AGENT", "goose"); cmd };