mirror of
https://github.com/block/goose.git
synced 2026-06-02 06:19:33 +02:00
feat: add AGENT=goose environment variable for cross-tool compatibility (#7017)
This commit is contained in:
@@ -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()?;
|
||||
|
||||
@@ -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| {
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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'")
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user