Skip to content

fix: extend MODEL_NOT_SUPPORTED_PATTERN to catch 404 standalone "Model not found"#41792

Merged
pelikhan merged 3 commits into
mainfrom
copilot/aw-failures-fix-daily-cache-analyzer
Jun 26, 2026
Merged

fix: extend MODEL_NOT_SUPPORTED_PATTERN to catch 404 standalone "Model not found"#41792
pelikhan merged 3 commits into
mainfrom
copilot/aw-failures-fix-daily-cache-analyzer

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The AIC api-proxy returns 404 Not Found: Model not found (no inline model name) when a snapshot is unavailable. MODEL_NOT_SUPPORTED_PATTERN only matched forms with a model identifier token before "not found", so the harness logged isInvalidModelError=false and burned all 15 retries (3 attempts × 5 internal) on zero useful work.

Changes

  • detect_agent_errors.cjs — adds a new alternative to MODEL_NOT_SUPPORTED_PATTERN:

    404\b[^\n]*\bModel\s+not\s+found
    

    Matches any log line with a 404 status code followed by the bare Model not found phrase. Since codex_harness.cjs imports this as INVALID_MODEL_ERROR_PATTERN, both the real-time retry classifier and the post-run detect-agent-errors step are fixed by a single change.

  • detect_agent_errors.test.cjs / codex_harness.test.cjs — adds test cases for 404 Not Found: Model not found, ResponseError: 404 Not Found: Model not found, and the embedded-in-log variant.

Copilot AI and others added 2 commits June 26, 2026 20:23
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… not found shape

The AIC api-proxy returns "404 Not Found: Model not found" when a model
snapshot is unavailable. The existing MODEL_NOT_SUPPORTED_PATTERN required
a model name token between "model" and "not found", so the standalone
phrase was silently missed (isInvalidModelError=false) and the harness
burned all 3×5 retries before giving up.

Add a new alternative `404\b[^\n]*\bModel\s+not\s+found` that matches
any line containing a 404 status code followed by the bare "Model not
found" phrase, making the error non-retryable on first detection.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Stop pinning unstable Codex snapshot and improve error handling fix: extend MODEL_NOT_SUPPORTED_PATTERN to catch 404 standalone "Model not found" Jun 26, 2026
Copilot AI requested a review from pelikhan June 26, 2026 20:28
@pelikhan pelikhan marked this pull request as ready for review June 26, 2026 21:12
Copilot AI review requested due to automatic review settings June 26, 2026 21:12
@pelikhan pelikhan merged commit e074fab into main Jun 26, 2026
@pelikhan pelikhan deleted the copilot/aw-failures-fix-daily-cache-analyzer branch June 26, 2026 21:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves agent error classification in gh-aw’s JS harness tooling by extending the invalid-model detection regex to recognize an AIC api-proxy “404 … Model not found” error shape, preventing wasted retries on a non-retryable configuration/error condition.

Changes:

  • Extend MODEL_NOT_SUPPORTED_PATTERN to match 404 … Model not found lines without an inline model identifier.
  • Add regression tests in both the pattern unit tests and the codex harness classifier tests.
  • Update the generated pr-triage-agent.lock.yml workflow metadata.
Show a summary per file
File Description
actions/setup/js/detect_agent_errors.cjs Extends the invalid-model regex to catch standalone 404 … Model not found errors.
actions/setup/js/detect_agent_errors.test.cjs Adds test coverage for the new 404 “Model not found” variants (standalone + embedded in logs).
actions/setup/js/codex_harness.test.cjs Verifies the codex harness’s isInvalidModelError returns true for the new 404 shape.
.github/workflows/pr-triage-agent.lock.yml Updates generated workflow lock metadata (body_hash).

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Low

// - "Model not found" (standalone, e.g. AIC api-proxy 404: "404 Not Found: Model not found")
const MODEL_NOT_SUPPORTED_PATTERN =
/(?:The requested model is not supported|invalid model(?:\s+name)?\s+['"`]?[a-z0-9._:/@-]+['"`]?(?=(?:\s*$|\s*[\n\r.,;:!?)]))|unknown model\s+['"`]?[a-z0-9._:/@-]+['"`]?(?=(?:\s*$|\s*[\n\r.,;:!?)]))|model(?:\s+name)?\s+['"`]?[a-z0-9._:/@-]+['"`]?\s+(?:is\s+)?(?:not found|does not exist|not supported|not available|unavailable))/i;
/(?:The requested model is not supported|invalid model(?:\s+name)?\s+['"`]?[a-z0-9._:/@-]+['"`]?(?=(?:\s*$|\s*[\n\r.,;:!?)]))|unknown model\s+['"`]?[a-z0-9._:/@-]+['"`]?(?=(?:\s*$|\s*[\n\r.,;:!?)]))|model(?:\s+name)?\s+['"`]?[a-z0-9._:/@-]+['"`]?\s+(?:is\s+)?(?:not found|does not exist|not supported|not available|unavailable)|404\b[^\n]*\bModel\s+not\s+found)/i;
@@ -1,4 +1,4 @@
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"98a744d3dc9efdd12bf821f81911e181d26ee211ece147180a6021797cd8bbe1","body_hash":"f7ed7fcaf7cb3e6043d11f79b63a516194a755016f6bbfd6875ce1c9efb20a86","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}}
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"98a744d3dc9efdd12bf821f81911e181d26ee211ece147180a6021797cd8bbe1","body_hash":"8d505062b276bc9c6fda2b79316117cb30c88ae04cab333ef78d113bf91c6aec","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants