From e1581e119898a71328111d77d65bf3427b4fa5d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:41:54 +0000 Subject: [PATCH 1/4] chore: initial investigation checkpoint Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/pr-code-quality-reviewer.lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-code-quality-reviewer.lock.yml b/.github/workflows/pr-code-quality-reviewer.lock.yml index 1f717f90488..04978da5dfe 100644 --- a/.github/workflows/pr-code-quality-reviewer.lock.yml +++ b/.github/workflows/pr-code-quality-reviewer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"4b304b423080e4bab9d72281c704a8436fe09fa92cf666fe179d4681a922d405","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"3741a05e0a954d005c6a5d50b7567b198260ad61d940646d75c20b3b923c1606","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.16"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.32","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.32@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # From a3e6e78b3ae68462a88ed7b770dcf3f0c153362a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:45:51 +0000 Subject: [PATCH 2/4] fix: detect '400 no model endpoints available' as http_400_response_error Extend HTTP_400_RESPONSE_ERROR_PATTERN in both copilot_harness.cjs and detect_agent_errors.cjs to also match the Copilot SDK error message: "400 400 400 no model endpoints available given user constraints" Previously this error fell through to `partial_execution` and triggered retries that could never succeed. It is now classified as `http_400_response_error` and treated as non-retryable. Observed in run 28484493629 (PR Sous Chef) job 84428042868 step 35. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/copilot_harness.cjs | 4 +++- actions/setup/js/copilot_harness.test.cjs | 9 +++++++++ actions/setup/js/detect_agent_errors.cjs | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/actions/setup/js/copilot_harness.cjs b/actions/setup/js/copilot_harness.cjs index 6c91d77fbc5..bef3d15af2e 100644 --- a/actions/setup/js/copilot_harness.cjs +++ b/actions/setup/js/copilot_harness.cjs @@ -87,7 +87,9 @@ const COPILOT_REQUESTS_PROXY_AUTH_403_TEMPLATE_NAME = "copilot_requests_proxy_au const CAPI_ERROR_400_PATTERN = /CAPIError:\s*400/; // Pattern to detect generic HTTP 400 Bad Request responses emitted by engine CLI / SDK wrappers. // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in detect_agent_errors.cjs. -const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?/i; +// Also matches "400 400 400 no model endpoints available given user constraints" which is emitted +// by the Copilot SDK when no model endpoints are available for the user's configured constraints. +const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints/i; // Pattern to detect MCP servers blocked by enterprise/organization policy. // This is a persistent policy configuration error — retrying will not help. diff --git a/actions/setup/js/copilot_harness.test.cjs b/actions/setup/js/copilot_harness.test.cjs index 1ef9bc989c8..b90438a6bd1 100644 --- a/actions/setup/js/copilot_harness.test.cjs +++ b/actions/setup/js/copilot_harness.test.cjs @@ -984,6 +984,15 @@ describe("copilot_harness.cjs", () => { it("returns false for empty output", () => { expect(isHTTP400ResponseError("")).toBe(false); }); + + it("matches the 'no model endpoints available given user constraints' SDK error", () => { + expect(isHTTP400ResponseError("[copilot-sdk-driver] [sdk-driver] error: 400 400 400 no model endpoints available given user constraints")).toBe(true); + }); + + it("matches the no-model-endpoints error embedded in larger output", () => { + const output = 'some prior output\n[copilot-sdk-driver] [sdk-driver] error: 400 400 400 no model endpoints available given user constraints\n{"type":"subagent.failed"}'; + expect(isHTTP400ResponseError(output)).toBe(true); + }); }); describe("no-auth-info detection pattern", () => { diff --git a/actions/setup/js/detect_agent_errors.cjs b/actions/setup/js/detect_agent_errors.cjs index 9a491616cc8..831002bfe09 100644 --- a/actions/setup/js/detect_agent_errors.cjs +++ b/actions/setup/js/detect_agent_errors.cjs @@ -65,7 +65,9 @@ const MODEL_NOT_SUPPORTED_PATTERN = // Pattern: Generic HTTP 400 Bad Request responses emitted by engine / SDK wrappers. // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in copilot_harness.cjs. -const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?/i; +// Also matches "400 400 400 no model endpoints available given user constraints" which is emitted +// by the Copilot SDK when no model endpoints are available for the user's configured constraints. +const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints/i; // Pattern: Copilot/CAPI quota exhaustion and rate-limit responses. // Matches all observed forms: From 262e3b04a903b0557b27cbef15d743857b8d9929 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:46:56 +0000 Subject: [PATCH 3/4] fix: wrap alternation in non-capturing group for clarity Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/copilot_harness.cjs | 3 ++- actions/setup/js/detect_agent_errors.cjs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/setup/js/copilot_harness.cjs b/actions/setup/js/copilot_harness.cjs index bef3d15af2e..2b34440490a 100644 --- a/actions/setup/js/copilot_harness.cjs +++ b/actions/setup/js/copilot_harness.cjs @@ -89,7 +89,8 @@ const CAPI_ERROR_400_PATTERN = /CAPIError:\s*400/; // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in detect_agent_errors.cjs. // Also matches "400 400 400 no model endpoints available given user constraints" which is emitted // by the Copilot SDK when no model endpoints are available for the user's configured constraints. -const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints/i; +const HTTP_400_RESPONSE_ERROR_PATTERN = + /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints)/i; // Pattern to detect MCP servers blocked by enterprise/organization policy. // This is a persistent policy configuration error — retrying will not help. diff --git a/actions/setup/js/detect_agent_errors.cjs b/actions/setup/js/detect_agent_errors.cjs index 831002bfe09..bc4172864fe 100644 --- a/actions/setup/js/detect_agent_errors.cjs +++ b/actions/setup/js/detect_agent_errors.cjs @@ -67,7 +67,8 @@ const MODEL_NOT_SUPPORTED_PATTERN = // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in copilot_harness.cjs. // Also matches "400 400 400 no model endpoints available given user constraints" which is emitted // by the Copilot SDK when no model endpoints are available for the user's configured constraints. -const HTTP_400_RESPONSE_ERROR_PATTERN = /Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints/i; +const HTTP_400_RESPONSE_ERROR_PATTERN = + /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints)/i; // Pattern: Copilot/CAPI quota exhaustion and rate-limit responses. // Matches all observed forms: From 7ee6d6ed762be75994cd2d7a171627cb545f07a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:14:27 +0000 Subject: [PATCH 4/4] fix: anchor no-model-endpoints regex to 400 prefix; add detect_agent_errors tests; revert lock churn - Fix unanchored regex in detect_agent_errors.cjs and copilot_harness.cjs: change `no model endpoints available given user constraints` to `400[^\n]*no model endpoints available given user constraints` to prevent false positive non-retryable classification - Add three new test cases to detect_agent_errors.test.cjs for the new pattern alternative (exact SDK error, embedded in output, bare phrase without 400 prefix should not match) - Revert accidental body_hash churn in pr-code-quality-reviewer.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/pr-code-quality-reviewer.lock.yml | 2 +- actions/setup/js/copilot_harness.cjs | 5 +++-- actions/setup/js/detect_agent_errors.cjs | 5 +++-- actions/setup/js/detect_agent_errors.test.cjs | 13 +++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-code-quality-reviewer.lock.yml b/.github/workflows/pr-code-quality-reviewer.lock.yml index 04978da5dfe..1f717f90488 100644 --- a/.github/workflows/pr-code-quality-reviewer.lock.yml +++ b/.github/workflows/pr-code-quality-reviewer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"3741a05e0a954d005c6a5d50b7567b198260ad61d940646d75c20b3b923c1606","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"0a7a1cc9a9d3e316b42d163c8f7452df59e96a2dd1056a07170aca6d955bd9ca","body_hash":"4b304b423080e4bab9d72281c704a8436fe09fa92cf666fe179d4681a922d405","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.16"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.32","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.32@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # diff --git a/actions/setup/js/copilot_harness.cjs b/actions/setup/js/copilot_harness.cjs index 2b34440490a..68ce6845c1e 100644 --- a/actions/setup/js/copilot_harness.cjs +++ b/actions/setup/js/copilot_harness.cjs @@ -89,8 +89,9 @@ const CAPI_ERROR_400_PATTERN = /CAPIError:\s*400/; // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in detect_agent_errors.cjs. // Also matches "400 400 400 no model endpoints available given user constraints" which is emitted // by the Copilot SDK when no model endpoints are available for the user's configured constraints. -const HTTP_400_RESPONSE_ERROR_PATTERN = - /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints)/i; +// The second alternative is anchored to a leading "400" to avoid false positives from unrelated +// diagnostic or informational messages that might contain the phrase. +const HTTP_400_RESPONSE_ERROR_PATTERN = /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|400[^\n]*no model endpoints available given user constraints)/i; // Pattern to detect MCP servers blocked by enterprise/organization policy. // This is a persistent policy configuration error — retrying will not help. diff --git a/actions/setup/js/detect_agent_errors.cjs b/actions/setup/js/detect_agent_errors.cjs index bc4172864fe..a101ed35e0e 100644 --- a/actions/setup/js/detect_agent_errors.cjs +++ b/actions/setup/js/detect_agent_errors.cjs @@ -67,8 +67,9 @@ const MODEL_NOT_SUPPORTED_PATTERN = // NOTE: keep in sync with HTTP_400_RESPONSE_ERROR_PATTERN in copilot_harness.cjs. // Also matches "400 400 400 no model endpoints available given user constraints" which is emitted // by the Copilot SDK when no model endpoints are available for the user's configured constraints. -const HTTP_400_RESPONSE_ERROR_PATTERN = - /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|no model endpoints available given user constraints)/i; +// The second alternative is anchored to a leading "400" to avoid false positives from unrelated +// diagnostic or informational messages that might contain the phrase. +const HTTP_400_RESPONSE_ERROR_PATTERN = /(?:Response status code does not indicate success:\s*400(?:\s*\(Bad Request\))?|400[^\n]*no model endpoints available given user constraints)/i; // Pattern: Copilot/CAPI quota exhaustion and rate-limit responses. // Matches all observed forms: diff --git a/actions/setup/js/detect_agent_errors.test.cjs b/actions/setup/js/detect_agent_errors.test.cjs index 787988c5d23..2717a8b2927 100644 --- a/actions/setup/js/detect_agent_errors.test.cjs +++ b/actions/setup/js/detect_agent_errors.test.cjs @@ -195,6 +195,19 @@ describe("detect_agent_errors.cjs", () => { expect(HTTP_400_RESPONSE_ERROR_PATTERN.test("CAPIError: 400 Bad Request")).toBe(false); expect(HTTP_400_RESPONSE_ERROR_PATTERN.test("Error: 400 Bad Request")).toBe(false); }); + + it("matches the Copilot SDK 'no model endpoints available given user constraints' error", () => { + expect(HTTP_400_RESPONSE_ERROR_PATTERN.test("[copilot-sdk-driver] [sdk-driver] error: 400 400 400 no model endpoints available given user constraints")).toBe(true); + }); + + it("matches the no-model-endpoints error embedded in larger output", () => { + const output = 'some prior output\n[copilot-sdk-driver] [sdk-driver] error: 400 400 400 no model endpoints available given user constraints\n{"type":"subagent.failed"}'; + expect(HTTP_400_RESPONSE_ERROR_PATTERN.test(output)).toBe(true); + }); + + it("does not match 'no model endpoints available' without a leading 400", () => { + expect(HTTP_400_RESPONSE_ERROR_PATTERN.test("no model endpoints available given user constraints")).toBe(false); + }); }); describe("detectErrors", () => {