Skip to content

Fast-fail Copilot "No model available" policy error instead of exhausting retries - #52953

Merged
pelikhan merged 5 commits into
mainfrom
copilot/aw-failures-re-enable-copilot-policy
Aug 15, 2026
Merged

Fast-fail Copilot "No model available" policy error instead of exhausting retries#52953
pelikhan merged 5 commits into
mainfrom
copilot/aw-failures-re-enable-copilot-policy

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

When a Copilot subagent (task tool) dispatch requests a model disabled by org/repo Copilot policy, the SDK driver emits a deterministic policy error that the harness misclassified as a generic partial-execution failure — burning all 3 retries (~15 min) per run before failing red.

[copilot-sdk-driver] [sdk-driver] error: Execution failed: Error: No model available. Check policy enablement under GitHub Settings > Copilot

Changes

  • actions/setup/js/copilot_harness.cjsMODEL_NOT_SUPPORTED_PATTERN now matches the SDK policy-enablement error, so the attempt is classified model_not_supported and the retry loop stops on the first attempt.
  • actions/setup/js/detect_agent_errors.cjs — same alternative added to its copy of the pattern (the two are documented as needing to stay in sync), so the model_not_supported_error job output is set and the existing conclusion/remediation path fires.
  • actions/setup/md/model_not_supported_error.md — remediation guidance for this variant: the model isn't disabled in frontmatter but by policy, and it can be triggered by a subagent even when the main agent's model is enabled.
  • Tests — positive cases in both test files (detectCopilotErrorsclassifyCopilotFailure = model_not_supported), plus negatives asserting that bare No model available without the policy enablement hint does not match.

Both patterns anchor on the policy enablement phrase with [^\n]* rather than matching No model available alone, to avoid false positives on transient/informational logging.

No .lock.yml changes: workflows reference ./actions/setup by path rather than inlining the harness.

Scope

This covers item 4 of the issue's remediation list. Items 1–3 require GitHub Settings > Copilot > Policies access to enable the model the subagent requests, so the "3 consecutive clean Linter Miner runs" criterion still depends on that change. The item-3 stopgap (removing subagent usage from Linter Miner) was not applied — task is a built-in Copilot capability, not a frontmatter-declared tool in linter-miner.md, so disabling it would be a behavioural rewrite rather than a surgical fix.

Unrelated pre-existing failure

make agent-report-progress fails at the JavaScript lint step with TS2688: Cannot find type definition file for 'node' and TS5108: Option 'moduleResolution=node10' has been removed. This reproduces on a clean tree and is untouched here.


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 18.2 AIC · ⌖ 5.82 AIC · ⊞ 6.3K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 6.88 AIC · ⌖ 7.4 AIC · ⊞ 6.3K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 15, 2026 19:25
…trying

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Re-enable Copilot model policy for Linter Miner subagent dispatch Fast-fail Copilot "No model available" policy error instead of exhausting retries Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 19:27
@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 19:28
Copilot AI balanced review requested due to automatic review settings August 15, 2026 19:28

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

Adds fast-fail handling for Copilot model-policy errors to avoid exhausting retries.

Changes:

  • Classifies policy-enablement failures as model_not_supported.
  • Adds positive and negative detection tests.
  • Documents policy and subagent remediation.
Show a summary per file
File Description
actions/setup/js/copilot_harness.cjs Detects policy-related model failures.
actions/setup/js/copilot_harness.test.cjs Tests harness classification.
actions/setup/js/detect_agent_errors.cjs Extends shared error detection.
actions/setup/js/detect_agent_errors.test.cjs Tests matching boundaries.
actions/setup/md/model_not_supported_error.md Adds policy remediation guidance.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

// "No model available" wording alone does not produce false positives.
// This is a persistent configuration error — retrying with --continue will not help.
const MODEL_NOT_SUPPORTED_PATTERN = /The requested model is not supported/;
const MODEL_NOT_SUPPORTED_PATTERN = /The requested model is not supported|No model available\b[^\n]*policy enablement/i;
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot This PR can move forward before maintainers investigate.

Please refresh the branch and run the pr-finisher skill after pushing any follow-up fixes. I did not find a newer unresolved-review thread list or failed checks in the compact context for this pass.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 18.2 AIC · ⌖ 5.82 AIC · ⊞ 6.3K ·
Comment /souschef to run again

@pelikhan

Copy link
Copy Markdown
Collaborator

/matt

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — two minor issues found; COMMENT (no blocking changes).

📋 Key Themes & Highlights

Key Themes

  • Unintentional /i flag broadening (copilot_harness.cjs): adding /i to the previously case-sensitive pattern is likely harmless in practice but should be documented as deliberate to prevent future accidental removal.
  • Bundled test assertions (copilot_harness.test.cjs): one it block tests detection and classification together; splitting improves failure diagnostics.

Positive Highlights

  • ✅ Pattern anchored to policy enablement phrase — avoids false positives on generic "No model available" log noise
  • ✅ Both files that share the pattern updated together with explicit sync comments
  • ✅ Negative tests verify the newline-split variant (\n between sentences) does not match — good edge-case coverage
  • ✅ Remediation doc updated with subagent-trigger nuance

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 41.1 AIC · ⌖ 9.11 AIC · ⊞ 7.7K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage for maintainer-ready follow-up:

Please refresh the branch if GitHub allows it and run the pr-finisher skill before handing this PR back to maintainers.

Outstanding review items (newest first):

  • Matt Pocock Skills Reviewer: document that the new policy-enable error matcher is intentionally case-insensitive, or adjust it if that broadening was accidental.
  • Matt Pocock Skills Reviewer: split the bundled detection/classification test so failures point to the exact regression more clearly.

Failed checks from the compact candidate set:

  • None listed.

Branch update was requested automatically for this run when GitHub allows it.
Run context: https://github.com/github/gh-aw/actions/runs/31906144084

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 6.88 AIC · ⌖ 7.4 AIC · ⊞ 6.3K ·
Comment /souschef to run again

@pelikhan
pelikhan merged commit 8573c25 into main Aug 15, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/aw-failures-re-enable-copilot-policy branch August 15, 2026 20:36
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.0

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.

[aw-failures] [P0] Linter Miner: Copilot Task/subagent dispatch broken by model policy — 6/8 runs failing

4 participants