Skip to content

Set AI_AGENT env var for agent terminals - #320129

Merged
Megan Rogge (meganrogge) merged 1 commit into
microsoft:mainfrom
meganrogge:merogge/ai-agent-env-var
Jun 5, 2026
Merged

Megan Rogge (meganrogge) merged 1 commit into
microsoft:mainfrom
meganrogge:merogge/ai-agent-env-var

Conversation

@meganrogge

Copy link
Copy Markdown
Collaborator

Adopts the cross-vendor AI_AGENT=github_copilot_vscode_agent environment variable on agent-initiated terminals. COPILOT_AGENT=1 is kept alongside it for back-compat with CLIs that already adopted it.

Fixes #320127

Adopt the cross-vendor 'AI_AGENT=github_copilot_vscode_agent' env var on agent-initiated terminals. Keeps COPILOT_AGENT=1 for back-compat with CLIs that already adopted it.

Fixes microsoft#320127
Copilot AI review requested due to automatic review settings June 5, 2026 15:48
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the environment passed to agent-initiated (Copilot tool) terminals to include the cross-vendor AI_AGENT=github_copilot_vscode_agent marker, while retaining COPILOT_AGENT=1 for backwards compatibility with existing tooling.

Changes:

  • Add AI_AGENT=github_copilot_vscode_agent to the env set for agent terminals.
  • Keep COPILOT_AGENT=1 alongside the new variable for compatibility.
Show a summary per file
File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts Adds AI_AGENT env var (and documents back-compat with COPILOT_AGENT) for agent-created terminals.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@meganrogge
Megan Rogge (meganrogge) merged commit 95744c7 into microsoft:main Jun 5, 2026
25 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 5, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jul 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update agent aware terminal environment variable

3 participants