Skip to content

Make Copilot Task-tool "No model available" failures non-fatal - #51181

Closed
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-failures-fix-copilot-cli-task-tool-calls-again
Closed

Make Copilot Task-tool "No model available" failures non-fatal#51181
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-failures-fix-copilot-cli-task-tool-calls-again

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Copilot-engine workflows that spawn subagents via the Task tool fail 100% of the time: the SDK throws No model available. Check policy enablement under GitHub Settings > Copilot before any inference request is dispatched. The harness classified this as generic partial_execution, so it burned all 4 attempts reproducing the identical error and failed the job.

This implements remediation option 3 from the issue — a stopgap that keeps runs green while the policy/entitlement question is resolved separately.

Changes in actions/setup/js/copilot_harness.cjs

  • DetectionNO_MODEL_AVAILABLE_PATTERN / isNoModelAvailableError() match the SDK's policy-gate message.
  • Classification — new no_model_available failure class in classifyCopilotFailure, ranked below model_not_supported so the more specific configured-model error still wins. Surfaced in the per-attempt diagnostic line as isNoModelAvailableError=….
  • No retry — the retry loop short-circuits on this signature, alongside the existing mcp_policy_blocked / model_not_supported persistent-error branches.
  • Graceful degradation — subagent delegation is an optional capability:
    • if safe-outputs already contain a terminal output (e.g. the review was posted), exit 0 with a reason specific to blocked delegation;
    • otherwise emit a missing_tool signal for task so the unavailable capability is visible downstream instead of being lost in a red job.
[copilot-harness] attempt 1 failed: failureClass=no_model_available isNoModelAvailableError=true …
[copilot-harness] attempt 1: no model available for sub-agent delegation but safe-outputs already
  contain expected output — suppressing terminal verdict (delegation skipped, core work succeeded)

Tests

copilot_harness.test.cjs covers the detector (including negatives against the unrelated The requested model is not supported message), classification precedence, and both branches of the missing_tool emitter.

Not addressed here

Why subagent sessions resolve no model (options 1/2 in the issue — entitlement/allowlisting, or disabling Task for Copilot-engine workflows) remains open. This change only ensures the failure mode is cheap and non-fatal.

Copilot AI and others added 2 commits August 7, 2026 20:21
… harness

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] Fix Copilot CLI task-tool subagent calls for model availability issue Make Copilot Task-tool "No model available" failures non-fatal Aug 7, 2026
Copilot AI requested a review from pelikhan August 7, 2026 20:23
@pelikhan

pelikhan commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot investigate why this is failing

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot investigate why this is failing

Investigated — this isn't a test or build failure. Every workflow run on this branch has conclusion action_required, i.e. blocked awaiting maintainer approval, so none of them actually executed:

31215609704 CJS              | completed action_required | 45b6fda
31215650254 Agentic Commands | completed action_required | 45b6fda
31215541985 CJS              | completed action_required | 6b52d46
31215543793 Agentic Commands | completed action_required | 6b52d46
...

The only run that executed is Running Copilot cloud agent (31214768843), which succeeded. get_status on the PR head returns state: pending, total_count: 0 — no check has reported a result yet.

I re-ran every job the CJS workflow would run, locally, on 45b6fda:

Check Command Result
js-typecheck npm run typecheck (tsc --noEmit) pass
js-typecheck make check-cjs-syntax pass
js-tests npm run test:js -- --no-file-parallelism pass — 390 files, 12784 passed, 31 skipped
lint-js make lint-cjs pass — 0 errors (192 pre-existing warnings, none in the changed files)
lock freshness make recompile pass — clean tree, no diff

copilot_harness.test.cjs alone: 271/271 passing.

Two things worth noting from the investigation:

  • make recompile produces no diff, which confirms copilot_harness.cjs is not inlined into .lock.yml — the lock files invoke it from ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs, so this change needs no workflow recompilation.
  • The new NO_MODEL_AVAILABLE_PATTERN doesn't collide with detect_agent_errors.cjs, whose model_not_supported_error classifier matches only The requested model is not supported. A suppressed no_model_available run therefore won't be re-flagged downstream after the harness exits 0.

One false alarm on my side that's worth recording: the four copilot_requests_proxy_auth_403.md ENOENT failures I first hit were my own — promptsSourceDir is path.resolve("../md"), so the suite must be run from actions/setup/js, and CI additionally stages the templates into $RUNNER_TEMP/gh-aw/prompts. They pass when invoked correctly.

Approving the pending workflow runs should turn the PR green.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hey @Copilot 🎯 — thanks for the quick remediation on the Task-tool No model available failures! This PR looks great and ready for review.

Strengths:

  • Clear problem statement — the issue ([aw-failures] Fix Copilot CLI Task-tool subagent calls — 100% failure with No model available #51033) documents 100% failure rate across multiple workflows, and your fix directly addresses the root cause (policy gate before model resolution).
  • Focused scope — you're adding detection, classification, and graceful degradation for the specific error signature without changing unrelated logic.
  • Comprehensive testscopilot_harness.test.cjs covers the detector pattern (including negatives against similar-looking messages), classification precedence, and both output branches (missing_tool emission and early exit when safe-outputs exist).
  • Clear explanation — the PR body walks through each change and explains why options 1/2 (entitlement/allowlisting or disabling Task) are left for follow-up.

Next steps:

  • When ready, toggle from draft to ready for review
  • Assign to pelikhan (already in requested reviewers) for final check
  • After merge, monitor the next 5 runs of any Copilot-engine workflow using Task to confirm the stopgap is working

Generated by ✅ Contribution Check · auto · 78.4 AIC · ⊞ 8.7K ·

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] Fix Copilot CLI Task-tool subagent calls — 100% failure with No model available

2 participants