From cbaca66e23b844e8594931ed3c3e4d840f9e1bf1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 18:51:13 +0000 Subject: [PATCH 1/4] Initial plan From 44e9db9c3ff8226f9dc5aa09ec7ae7aa27ff9086 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 19:08:46 +0000 Subject: [PATCH 2/4] Define DefaultEngine constant and update usages from CopilotEngine where used as default Agent-Logs-Url: https://github.com/github/gh-aw/sessions/847c0feb-cf66-4748-81c1-dd045e07daec Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> --- pkg/cli/add_command.go | 2 +- pkg/cli/add_interactive_engine.go | 6 +++--- pkg/constants/constants_test.go | 3 +++ pkg/constants/engine_constants.go | 4 ++++ pkg/workflow/agentic_engine.go | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pkg/cli/add_command.go b/pkg/cli/add_command.go index 42e4dac980f..1d95e9de48a 100644 --- a/pkg/cli/add_command.go +++ b/pkg/cli/add_command.go @@ -397,7 +397,7 @@ func addWorkflowWithTracking(resolved *ResolvedWorkflow, tracker *FileTracker, o // the engine declaration appears above the source field in the final file. // Copilot is the default engine, so we skip adding it to avoid unnecessary noise and // prevent conflicts during later workflow updates. - if opts.EngineOverride != "" && opts.EngineOverride != string(constants.CopilotEngine) { + if opts.EngineOverride != "" && opts.EngineOverride != string(constants.DefaultEngine) { updatedContent, err := addEngineToWorkflow(content, opts.EngineOverride) if err != nil { if opts.Verbose { diff --git a/pkg/cli/add_interactive_engine.go b/pkg/cli/add_interactive_engine.go index 5207c6e5b66..5d7c17bc351 100644 --- a/pkg/cli/add_interactive_engine.go +++ b/pkg/cli/add_interactive_engine.go @@ -23,7 +23,7 @@ func (c *AddInteractiveConfig) selectAIEngineAndKey() error { // Determine default engine based on existing secrets, workflow preference, then environment // Priority order: flag override > existing secrets > workflow frontmatter > environment > default - defaultEngine := string(constants.CopilotEngine) + defaultEngine := string(constants.DefaultEngine) workflowSpecifiedEngine := "" // Check if workflow specifies a preferred engine in frontmatter @@ -52,12 +52,12 @@ func (c *AddInteractiveConfig) selectAIEngineAndKey() error { } // Priority 2: If no existing secret found, use workflow frontmatter preference - if defaultEngine == string(constants.CopilotEngine) && workflowSpecifiedEngine != "" { + if defaultEngine == string(constants.DefaultEngine) && workflowSpecifiedEngine != "" { defaultEngine = workflowSpecifiedEngine } // Priority 3: Check environment variables if no existing secret or workflow preference found - if defaultEngine == string(constants.CopilotEngine) && workflowSpecifiedEngine == "" { + if defaultEngine == string(constants.DefaultEngine) && workflowSpecifiedEngine == "" { for _, opt := range constants.EngineOptions { envVar := opt.SecretName if opt.EnvVarName != "" { diff --git a/pkg/constants/constants_test.go b/pkg/constants/constants_test.go index 2afe4b85773..128f525c215 100644 --- a/pkg/constants/constants_test.go +++ b/pkg/constants/constants_test.go @@ -107,6 +107,9 @@ func TestAgenticEngines(t *testing.T) { if string(GeminiEngine) != "gemini" { t.Errorf("GeminiEngine constant = %q, want %q", GeminiEngine, "gemini") } + if DefaultEngine != CopilotEngine { + t.Errorf("DefaultEngine = %q, want CopilotEngine (%q)", DefaultEngine, CopilotEngine) + } } func TestDefaultGitHubTools(t *testing.T) { diff --git a/pkg/constants/engine_constants.go b/pkg/constants/engine_constants.go index f4845bbc0b0..e303568ff8d 100644 --- a/pkg/constants/engine_constants.go +++ b/pkg/constants/engine_constants.go @@ -20,6 +20,10 @@ const ( CodexEngine EngineName = "codex" // GeminiEngine is the Google Gemini engine identifier GeminiEngine EngineName = "gemini" + + // DefaultEngine is the default agentic engine used when no engine is explicitly specified. + // Currently defaults to CopilotEngine. + DefaultEngine EngineName = CopilotEngine ) // AgenticEngines lists all supported agentic engine names. diff --git a/pkg/workflow/agentic_engine.go b/pkg/workflow/agentic_engine.go index f36796efd70..480e3dcab1c 100644 --- a/pkg/workflow/agentic_engine.go +++ b/pkg/workflow/agentic_engine.go @@ -6,6 +6,7 @@ import ( "strings" "sync" + "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/logger" ) @@ -457,7 +458,7 @@ func (r *EngineRegistry) IsValidEngine(id string) bool { // GetDefaultEngine returns the default engine (Copilot) func (r *EngineRegistry) GetDefaultEngine() CodingAgentEngine { - return r.engines["copilot"] + return r.engines[string(constants.DefaultEngine)] } // GetEngineByPrefix returns an engine that matches the given prefix From 8071198c63ca9cf1cd17e71637cc240762ec45fe Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 4 Apr 2026 20:26:13 +0100 Subject: [PATCH 3/4] Update pkg/workflow/agentic_engine.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/workflow/agentic_engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/workflow/agentic_engine.go b/pkg/workflow/agentic_engine.go index 480e3dcab1c..0066c8054ca 100644 --- a/pkg/workflow/agentic_engine.go +++ b/pkg/workflow/agentic_engine.go @@ -456,7 +456,7 @@ func (r *EngineRegistry) IsValidEngine(id string) bool { return exists } -// GetDefaultEngine returns the default engine (Copilot) +// GetDefaultEngine returns the default engine configured by constants.DefaultEngine func (r *EngineRegistry) GetDefaultEngine() CodingAgentEngine { return r.engines[string(constants.DefaultEngine)] } From 6a685ef3ff687ba4ff1e3856693a3d1bf4b36a69 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 4 Apr 2026 20:26:22 +0100 Subject: [PATCH 4/4] Update pkg/cli/add_command.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/cli/add_command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cli/add_command.go b/pkg/cli/add_command.go index 1d95e9de48a..2a7ead49177 100644 --- a/pkg/cli/add_command.go +++ b/pkg/cli/add_command.go @@ -395,8 +395,8 @@ func addWorkflowWithTracking(resolved *ResolvedWorkflow, tracker *FileTracker, o // Handle engine override - add/update the engine field in frontmatter before source so // the engine declaration appears above the source field in the final file. - // Copilot is the default engine, so we skip adding it to avoid unnecessary noise and - // prevent conflicts during later workflow updates. + // The default engine is omitted to avoid unnecessary noise and prevent conflicts during + // later workflow updates. if opts.EngineOverride != "" && opts.EngineOverride != string(constants.DefaultEngine) { updatedContent, err := addEngineToWorkflow(content, opts.EngineOverride) if err != nil {