From a69737eec2e067ea674080c24a8a2df91f2061ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:11:11 +0000 Subject: [PATCH] fix: update TestContainerSupport/TestServicesSupport agent job detection to use exact line matching The tests used strings.Contains(line, "agent:") which matched manifest JSON comments containing "agent:" before reaching the actual YAML job definition. This caused the test to exit the job search prematurely. Changed to exact line matching with line == " agent:" for precise YAML key detection. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bd9c3d91-0b94-4305-bb05-5fc0569181c7 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/container_services_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/workflow/container_services_test.go b/pkg/workflow/container_services_test.go index 16443daf387..2f098d15bfd 100644 --- a/pkg/workflow/container_services_test.go +++ b/pkg/workflow/container_services_test.go @@ -141,12 +141,13 @@ This is a test without container.`, inMainJob := false foundContainer := false + agentJobLine := " " + string(constants.AgentJobName) + ":" for i, line := range lines { - if strings.Contains(line, string(constants.AgentJobName)+":") { + if line == agentJobLine { inMainJob = true continue } - if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != " "+string(constants.AgentJobName)+":" { + if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != agentJobLine { // Found next job, stop looking break } @@ -298,12 +299,13 @@ This is a test without services.`, inMainJob := false foundServices := false + agentJobLine := " " + string(constants.AgentJobName) + ":" for _, line := range lines { - if strings.Contains(line, string(constants.AgentJobName)+":") { + if line == agentJobLine { inMainJob = true continue } - if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != " "+string(constants.AgentJobName)+":" { + if inMainJob && strings.HasPrefix(line, " ") && !strings.HasPrefix(line, " ") && line != agentJobLine { // Found next job, stop looking break }