feat: add AGENT=goose environment variable for cross-tool compatibility#7017
Merged
dianed-square merged 2 commits intoblock:mainfrom Feb 10, 2026
Merged
Conversation
Set AGENT=goose alongside GOOSE_TERMINAL=1 in all shell command executions. This enables scripts and tools to detect AI agent execution without hardcoding specific agent names. The AGENT variable is set in developer extension, retry manager, computer controller, and CLI update commands. Documentation updated with usage examples.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a generic AGENT=goose environment variable to complement the existing GOOSE_TERMINAL=1 variable for better cross-tool compatibility. This enables users to write shell configuration that works across multiple AI agents without hardcoding agent-specific checks, following a pattern established by other agents like amp.
Changes:
- Added
AGENT=gooseenvironment variable to all shell command executions alongsideGOOSE_TERMINAL=1 - Updated documentation to explain the new variable's purpose and provide usage examples
- Maintains backward compatibility with existing
GOOSE_TERMINALchecks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| documentation/docs/guides/environment-variables.md | Documents the new AGENT variable with clear examples and use cases |
| crates/goose/src/agents/retry.rs | Adds AGENT=goose to shell command execution for both Windows (cmd) and Unix (sh) |
| crates/goose-mcp/src/developer/shell.rs | Adds AGENT=goose to the shell command configuration |
| crates/goose-mcp/src/computercontroller/platform/windows.rs | Adds AGENT=goose to Windows PowerShell automation commands |
| crates/goose-mcp/src/computercontroller/mod.rs | Adds AGENT=goose to both PowerShell and Unix shell executions |
| crates/goose-cli/src/commands/update.rs | Adds AGENT=goose to the update script execution |
jh-block
approved these changes
Feb 10, 2026
jh-block
approved these changes
Feb 10, 2026
Documentation will be added back when the feature is released.
dianed-square
approved these changes
Feb 10, 2026
tlongwell-block
added a commit
that referenced
this pull request
Feb 10, 2026
* origin/main: feat: add AGENT=goose environment variable for cross-tool compatibility (#7017) fix: strip empty extensions array when deeplink also (#7096) [docs] update authors.yaml file (#7114) Implement manpage generation for goose-cli (#6980) docs: tool output optimization (#7109) Fix duplicated output in Code Mode by filtering content by audience (#7117) Enable tom (Top Of Mind) platform extension by default (#7111) chore: added notification for canary build failure (#7106) fix: fix windows bundle random failure and optimise canary build (#7105) feat(acp): add model selection support for session/new and session/set_model (#7112) fix: isolate claude-code sessions via stream-json session_id (#7108) ci: enable agentic provider live tests (claude-code, codex, gemini-cli) (#7088) docs: codex subscription support (#7104) chore: add a new scenario (#7107) fix: Goose Desktop missing Calendar and Reminders entitlements (#7100) Fix 'Edit In Place' and 'Fork Session' features (#6970) Fix: Only send command content to command injection classifier (excluding part of tool call dict) (#7082) # Conflicts: # crates/goose/src/agents/extension.rs
jh-block
added a commit
that referenced
this pull request
Feb 10, 2026
* origin/main: (30 commits) docs: GCP Vertex AI org policy filtering & update OnboardingProviderSetup component (#7125) feat: replace subagent and skills with unified summon extension (#6964) feat: add AGENT=goose environment variable for cross-tool compatibility (#7017) fix: strip empty extensions array when deeplink also (#7096) [docs] update authors.yaml file (#7114) Implement manpage generation for goose-cli (#6980) docs: tool output optimization (#7109) Fix duplicated output in Code Mode by filtering content by audience (#7117) Enable tom (Top Of Mind) platform extension by default (#7111) chore: added notification for canary build failure (#7106) fix: fix windows bundle random failure and optimise canary build (#7105) feat(acp): add model selection support for session/new and session/set_model (#7112) fix: isolate claude-code sessions via stream-json session_id (#7108) ci: enable agentic provider live tests (claude-code, codex, gemini-cli) (#7088) docs: codex subscription support (#7104) chore: add a new scenario (#7107) fix: Goose Desktop missing Calendar and Reminders entitlements (#7100) Fix 'Edit In Place' and 'Fork Session' features (#6970) Fix: Only send command content to command injection classifier (excluding part of tool call dict) (#7082) Docs: require auth optional for custom providers (#7098) ...
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a generic
AGENT=gooseenvironment variable that is set alongsideGOOSE_TERMINAL=1in all shell command executions.Motivation
There's quite a bit of setup in my configuration files that I don't want AI agents to use. It's quite annoying having to check for each individual agent's environment variables:
I noticed that amp uses
AGENT=amp, and I figured that's a good environment variable name to standardize on. This PR adds that in.Note that this complements the
GOOSE_TERMINAL=1environment variable; it might be nice to eventually removeGOOSE_TERMINALifAGENTbecomes standardized.