From aef5756dd42d8607ac04165bbb1a4c8b9390c869 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 02:17:03 +0000 Subject: [PATCH 1/3] Initial plan From 19462794b9482a94780698edda71af8ee21bc158 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 02:34:35 +0000 Subject: [PATCH 2/3] test: handle escaped AWF JSON in copilot base URL integration assertion Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/allowed_domains_sanitization_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/workflow/allowed_domains_sanitization_test.go b/pkg/workflow/allowed_domains_sanitization_test.go index 11c178f8894..2cac24b62d6 100644 --- a/pkg/workflow/allowed_domains_sanitization_test.go +++ b/pkg/workflow/allowed_domains_sanitization_test.go @@ -707,7 +707,8 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env. // The copilot API target should be derived from the env var and present in the // AWF JSON config (apiProxy.targets.copilot.host) rather than as a --copilot-api-target // CLI flag, since network/proxy settings are now expressed via --config JSON file. - if !strings.Contains(lockStr, `"copilot":{"host":"copilot-proxy.corp.example.com"}`) { + if !strings.Contains(lockStr, `"copilot":{"host":"copilot-proxy.corp.example.com"}`) && + !strings.Contains(lockStr, `\"copilot\":{\"host\":\"copilot-proxy.corp.example.com\"}`) { t.Error("Expected copilot API target to be derived from GITHUB_COPILOT_BASE_URL in AWF config JSON") } @@ -717,6 +718,10 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env. // appears before the closing "]" of that specific array. allowDomainsPrefix := `"allowDomains":[` allowDomainsIdx := strings.Index(lockStr, allowDomainsPrefix) + if allowDomainsIdx < 0 { + allowDomainsPrefix = `\"allowDomains\":[` + allowDomainsIdx = strings.Index(lockStr, allowDomainsPrefix) + } if allowDomainsIdx < 0 { t.Fatal("allowDomains key not found in compiled lock file") } From 413a2fc5b19c580eb0710342cb366c38b6a5cded Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 02:38:33 +0000 Subject: [PATCH 3/3] test: tolerate escaped AWF JSON in copilot base-url integration test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/allowed_domains_sanitization_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/workflow/allowed_domains_sanitization_test.go b/pkg/workflow/allowed_domains_sanitization_test.go index 2cac24b62d6..23089f20f05 100644 --- a/pkg/workflow/allowed_domains_sanitization_test.go +++ b/pkg/workflow/allowed_domains_sanitization_test.go @@ -707,8 +707,9 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env. // The copilot API target should be derived from the env var and present in the // AWF JSON config (apiProxy.targets.copilot.host) rather than as a --copilot-api-target // CLI flag, since network/proxy settings are now expressed via --config JSON file. - if !strings.Contains(lockStr, `"copilot":{"host":"copilot-proxy.corp.example.com"}`) && - !strings.Contains(lockStr, `\"copilot\":{\"host\":\"copilot-proxy.corp.example.com\"}`) { + copilotHostUnescaped := `"copilot":{"host":"copilot-proxy.corp.example.com"}` + copilotHostEscaped := `\"copilot\":{\"host\":\"copilot-proxy.corp.example.com\"}` + if !strings.Contains(lockStr, copilotHostUnescaped) && !strings.Contains(lockStr, copilotHostEscaped) { t.Error("Expected copilot API target to be derived from GITHUB_COPILOT_BASE_URL in AWF config JSON") } @@ -717,10 +718,11 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env. // We search for the allowDomains key followed by its opening "[" and verify the hostname // appears before the closing "]" of that specific array. allowDomainsPrefix := `"allowDomains":[` + allowDomainsPrefixEscaped := `\"allowDomains\":[` allowDomainsIdx := strings.Index(lockStr, allowDomainsPrefix) if allowDomainsIdx < 0 { - allowDomainsPrefix = `\"allowDomains\":[` - allowDomainsIdx = strings.Index(lockStr, allowDomainsPrefix) + allowDomainsPrefix = allowDomainsPrefixEscaped + allowDomainsIdx = strings.Index(lockStr, allowDomainsPrefixEscaped) } if allowDomainsIdx < 0 { t.Fatal("allowDomains key not found in compiled lock file")