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("CANARY", canary.to_string())
|
||||||
.env("CONFIGURE", reconfigure.to_string())
|
.env("CONFIGURE", reconfigure.to_string())
|
||||||
.env("GOOSE_TERMINAL", "1")
|
.env("GOOSE_TERMINAL", "1")
|
||||||
|
.env("AGENT", "goose")
|
||||||
.spawn()?;
|
.spawn()?;
|
||||||
|
|
||||||
update.wait_with_output()?;
|
update.wait_with_output()?;
|
||||||
|
|||||||
@@ -709,6 +709,7 @@ impl ComputerControllerServer {
|
|||||||
.arg("-File")
|
.arg("-File")
|
||||||
.arg(&command)
|
.arg(&command)
|
||||||
.env("GOOSE_TERMINAL", "1")
|
.env("GOOSE_TERMINAL", "1")
|
||||||
|
.env("AGENT", "goose")
|
||||||
.output()
|
.output()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
@@ -723,6 +724,7 @@ impl ComputerControllerServer {
|
|||||||
.arg(shell_arg)
|
.arg(shell_arg)
|
||||||
.arg(&command)
|
.arg(&command)
|
||||||
.env("GOOSE_TERMINAL", "1")
|
.env("GOOSE_TERMINAL", "1")
|
||||||
|
.env("AGENT", "goose")
|
||||||
.output()
|
.output()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ impl SystemAutomation for WindowsAutomation {
|
|||||||
.arg("-Command")
|
.arg("-Command")
|
||||||
.arg(script)
|
.arg(script)
|
||||||
.env("GOOSE_TERMINAL", "1")
|
.env("GOOSE_TERMINAL", "1")
|
||||||
|
.env("AGENT", "goose")
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
Ok(String::from_utf8_lossy(&output.stdout).into_owned())
|
Ok(String::from_utf8_lossy(&output.stdout).into_owned())
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ pub fn configure_shell_command(
|
|||||||
.stdin(Stdio::null())
|
.stdin(Stdio::null())
|
||||||
.kill_on_drop(true)
|
.kill_on_drop(true)
|
||||||
.env("GOOSE_TERMINAL", "1")
|
.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_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("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'")
|
.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");
|
let mut cmd = Command::new("cmd");
|
||||||
cmd.args(["/C", command]);
|
cmd.args(["/C", command]);
|
||||||
cmd.env("GOOSE_TERMINAL", "1");
|
cmd.env("GOOSE_TERMINAL", "1");
|
||||||
|
cmd.env("AGENT", "goose");
|
||||||
cmd
|
cmd
|
||||||
} else {
|
} else {
|
||||||
let mut cmd = Command::new("sh");
|
let mut cmd = Command::new("sh");
|
||||||
cmd.args(["-c", command]);
|
cmd.args(["-c", command]);
|
||||||
cmd.env("GOOSE_TERMINAL", "1");
|
cmd.env("GOOSE_TERMINAL", "1");
|
||||||
|
cmd.env("AGENT", "goose");
|
||||||
cmd
|
cmd
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user