Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cli/azd/cmd/auto_install_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ func TestAgentDetectionIntegration(t *testing.T) {
expectedNoPrompt: true,
description: "When running under GitHub Copilot CLI, --no-prompt should be auto-enabled",
},
{
name: "GitHub Copilot CLI via COPILOT_CLI enables no-prompt automatically",
args: []string{"deploy"},
envVars: map[string]string{"COPILOT_CLI": "true"},
expectedNoPrompt: true,
description: "When running under GitHub Copilot CLI (COPILOT_CLI), --no-prompt should be auto-enabled",
},
{
name: "Gemini agent enables no-prompt automatically",
args: []string{"init"},
Expand Down Expand Up @@ -297,7 +304,7 @@ func clearAgentEnvVarsForTest(t *testing.T) {
// Claude Code
"CLAUDE_CODE", "CLAUDE_CODE_ENTRYPOINT",
// GitHub Copilot CLI
"GITHUB_COPILOT_CLI", "GH_COPILOT",
"GITHUB_COPILOT_CLI", "GH_COPILOT", "COPILOT_CLI",
// Gemini CLI
"GEMINI_CLI", "GEMINI_CLI_NO_RELAUNCH",
// OpenCode
Expand Down
6 changes: 6 additions & 0 deletions cli/azd/cmd/auto_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ func TestParseGlobalFlags_AgentDetection(t *testing.T) {
envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"},
expectedNoPrompt: true,
},
{
name: "GitHub Copilot CLI agent detected via COPILOT_CLI",
args: []string{"deploy"},
envVars: map[string]string{"COPILOT_CLI": "true"},
expectedNoPrompt: true,
},
{
name: "OpenCode agent detected",
args: []string{"provision"},
Expand Down
1 change: 1 addition & 0 deletions cli/azd/internal/runcontext/agentdetect/detect_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var knownEnvVarPatterns = []envVarPattern{
// GitHub Copilot CLI
{envVar: "GITHUB_COPILOT_CLI", agentType: AgentTypeGitHubCopilotCLI},
{envVar: "GH_COPILOT", agentType: AgentTypeGitHubCopilotCLI},
{envVar: "COPILOT_CLI", agentType: AgentTypeGitHubCopilotCLI},

// Google Gemini CLI
{envVar: "GEMINI_CLI", agentType: AgentTypeGemini},
Expand Down
8 changes: 7 additions & 1 deletion cli/azd/internal/runcontext/agentdetect/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ func TestDetectFromEnvVars(t *testing.T) {
expectedAgent: AgentTypeGitHubCopilotCLI,
detected: true,
},
{
name: "GitHub Copilot CLI via COPILOT_CLI",
envVars: map[string]string{"COPILOT_CLI": "1"},
Comment thread
tmeschter marked this conversation as resolved.
expectedAgent: AgentTypeGitHubCopilotCLI,
detected: true,
},
{
name: "Gemini CLI via GEMINI_CLI",
envVars: map[string]string{"GEMINI_CLI": "1"},
Expand Down Expand Up @@ -324,7 +330,7 @@ func clearAgentEnvVars(t *testing.T) {
// Claude Code
"CLAUDE_CODE", "CLAUDE_CODE_ENTRYPOINT",
// GitHub Copilot CLI
"GITHUB_COPILOT_CLI", "GH_COPILOT",
"GITHUB_COPILOT_CLI", "GH_COPILOT", "COPILOT_CLI",
// Gemini CLI
"GEMINI_CLI", "GEMINI_CLI_NO_RELAUNCH",
// OpenCode
Expand Down
7 changes: 6 additions & 1 deletion cli/azd/internal/terminal/terminal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func TestIsTerminal_AgentDetection(t *testing.T) {
envVars: map[string]string{"GITHUB_COPILOT_CLI": "true"},
expected: false,
},
{
name: "GitHub Copilot CLI via COPILOT_CLI disables TTY",
envVars: map[string]string{"COPILOT_CLI": "true"},
expected: false,
},
{
name: "Gemini CLI disables TTY",
envVars: map[string]string{"GEMINI_CLI": "1"},
Expand Down Expand Up @@ -88,7 +93,7 @@ func clearTestEnvVars(t *testing.T) {
"AZD_FORCE_TTY",
// Agent env vars
"CLAUDE_CODE", "CLAUDE_CODE_ENTRYPOINT",
"GITHUB_COPILOT_CLI", "GH_COPILOT",
"GITHUB_COPILOT_CLI", "GH_COPILOT", "COPILOT_CLI",
"GEMINI_CLI", "GEMINI_CLI_NO_RELAUNCH",
"OPENCODE",
// CI env vars
Expand Down
Loading