From d7408f08ab8b94df6c93d15eb86b7b44facb4bef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 20:30:32 +0000 Subject: [PATCH 1/2] Initial plan From 3cb345209edc856a5366366029970ccf59933401 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 20:43:36 +0000 Subject: [PATCH 2/2] fix: correct test conditions for preflight step count checks Fix two categories of incorrectly written tests introduced with the Copilot pre-flight diagnostic step: 1. copilot_engine_test.go: Two "skips preflight" sub-tests checked `len(steps) != 2` but preflight is intentionally skipped, returning only 1 step. Change condition to `!= 1`. 2. engine_agent_import_test.go: Claude and Codex tests expected 2 steps (preflight + execution) like Copilot, but those engines only return 1 execution step. Change to `!= 1` and use `steps[0]`. Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --- pkg/workflow/copilot_engine_test.go | 4 ++-- pkg/workflow/engine_agent_import_test.go | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/workflow/copilot_engine_test.go b/pkg/workflow/copilot_engine_test.go index 7f9a2caa907..4a00755fdfd 100644 --- a/pkg/workflow/copilot_engine_test.go +++ b/pkg/workflow/copilot_engine_test.go @@ -1679,7 +1679,7 @@ func TestCopilotPreflightDiagnosticStep(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") // Should have only 1 step: execution (no preflight) - if len(steps) != 2 { + if len(steps) != 1 { t.Fatalf("Expected 1 step (execution only), got %d", len(steps)) } @@ -1701,7 +1701,7 @@ func TestCopilotPreflightDiagnosticStep(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") // Should have only 1 step: execution (no preflight) - if len(steps) != 2 { + if len(steps) != 1 { t.Fatalf("Expected 1 step (execution only), got %d", len(steps)) } diff --git a/pkg/workflow/engine_agent_import_test.go b/pkg/workflow/engine_agent_import_test.go index 3dcb4067d9f..52ce6d77e66 100644 --- a/pkg/workflow/engine_agent_import_test.go +++ b/pkg/workflow/engine_agent_import_test.go @@ -126,11 +126,11 @@ func TestClaudeEngineWithAgentFromImports(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") - if len(steps) != 2 { - t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps)) + if len(steps) != 1 { + t.Fatalf("Expected 1 execution step, got %d", len(steps)) } - stepContent := strings.Join([]string(steps[1]), "\n") + stepContent := strings.Join([]string(steps[0]), "\n") // Check that custom agent content extraction is present if !strings.Contains(stepContent, `AGENT_CONTENT="$(awk`) { @@ -160,11 +160,11 @@ func TestClaudeEngineWithoutAgentFile(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") - if len(steps) != 2 { - t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps)) + if len(steps) != 1 { + t.Fatalf("Expected 1 execution step, got %d", len(steps)) } - stepContent := strings.Join([]string(steps[1]), "\n") + stepContent := strings.Join([]string(steps[0]), "\n") // Should not have agent content extraction if strings.Contains(stepContent, "AGENT_CONTENT") { @@ -190,11 +190,11 @@ func TestCodexEngineWithAgentFromImports(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") - if len(steps) != 2 { - t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps)) + if len(steps) != 1 { + t.Fatalf("Expected 1 execution step, got %d", len(steps)) } - stepContent := strings.Join([]string(steps[1]), "\n") + stepContent := strings.Join([]string(steps[0]), "\n") // Check that agent content extraction is present if !strings.Contains(stepContent, `AGENT_CONTENT="$(awk`) { @@ -228,11 +228,11 @@ func TestCodexEngineWithoutAgentFile(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/gh-aw/test.log") - if len(steps) != 2 { - t.Fatalf("Expected 2 execution steps (preflight + execution), got %d", len(steps)) + if len(steps) != 1 { + t.Fatalf("Expected 1 execution step, got %d", len(steps)) } - stepContent := strings.Join([]string(steps[1]), "\n") + stepContent := strings.Join([]string(steps[0]), "\n") // Should not have agent content extraction if strings.Contains(stepContent, "AGENT_CONTENT") {