Skip to content

fix(workflows): restore agentic workflows by authenticating Copilot with copilot-requests - #274

Open
DimaBir wants to merge 2 commits into
mainfrom
fix-agentic-workflow-copilot-auth
Open

fix(workflows): restore agentic workflows by authenticating Copilot with copilot-requests#274
DimaBir wants to merge 2 commits into
mainfrom
fix-agentic-workflow-copilot-auth

Conversation

@DimaBir

@DimaBir DimaBir commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

All three agentic workflows have failed on every run since 2026-05-07:

Workflow Last success Runs since
MSDO Issue Triage Assistant 2026-05-06 50 consecutive failures
CI Doctor 2026-05-07 failed on its next run
MSDO Toolchain Breach Monitor 2026-04-24 failed on its next run

They trigger correctly and every setup step succeeds. The Execute GitHub Copilot CLI step is where they die:

Error: No authentication information found.

Copilot can be authenticated with GitHub using an OAuth Token or a Fine-Grained
Personal Access Token.

The workflows authenticate Copilot inference with a COPILOT_GITHUB_TOKEN PAT secret. That PAT is no longer accepted at the inference step, so the agent container starts, passes its proxy health checks, and then exits 1 before doing any work.

Because the failure is inside the agent job and the conclusion job still succeeds, this has been failing silently — no triage comments have been posted on any issue for roughly two months.

Fix

gh-aw now supports authenticating Copilot inference with the GitHub Actions token via the copilot-requests: write permission, which the upstream docs list as the recommended option with COPILOT_GITHUB_TOKEN as the legacy fallback. This removes the PAT from the inference path entirely.

Two commits:

  1. fix(workflows): authenticate agentic workflows with copilot-requests instead of a PAT — frontmatter only.

    • Adds copilot-requests: write to the permissions: block of all three workflows.
    • Migrates tools.fetchtools.web-fetch. The fetch key was removed from the gh-aw schema; the current compiler rejects it outright, and per-tool domain allowlists now consolidate into network.allowed.
    • ci-doctor declared fetch.allowed: [] (no domains permitted), so the block is dropped rather than migrated.
    • msdo-breach-monitor gains node in network.allowed, preserving the registry.npmjs.org access its old fetch.allowed list declared. raw.githubusercontent.com needed no entry — the compiler confirms the github ecosystem identifier already covers it.
    • Refreshes the MAINTENANCE NOTE headers, which named v0.61.0 specifically and are stale after this bump.
  2. chore(workflows): recompile agentic workflows with gh-aw v0.83.4 — generated output.

    • .lock.yml files and .github/aw/actions-lock.json, produced by gh aw compile. Large diff is inherent: the toolchain moves v0.61.0 → v0.83.4.

The effective change at the failure point:

       - name: Execute GitHub Copilot CLI
         env:
-          COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
+          COPILOT_GITHUB_TOKEN: ${{ github.token }}

The blocking validate_multi_secret.sh COPILOT_GITHUB_TOKEN preflight step is also gone, replaced by a non-blocking OAuth-token hygiene check.

Validation

npm run buildAndTest does not apply — no src/ or lib/ file is touched, and it cannot run in this environment regardless (devDependencies absent, npm registry fails TLS handshake).

What was actually run:

  • gh aw compile — 3 workflows, 0 errors, 0 warnings.
  • Independent YAML parse of all three .lock.yml files via yaml.safe_load — all parse; job graphs intact (activation, agent, detection, safe_outputs, conclusion).
  • Asserted on the parsed YAML that both the agent and detection jobs in all three workflows carry copilot-requests: write and that every Execute GitHub Copilot CLI step resolves COPILOT_GITHUB_TOKEN to ${{ github.token }}.
  • Re-verified the PR fix(ci): bump actions/github-script from 8.0.0 to 9.0.0 #244 pin the MAINTENANCE NOTE guards: all 83 actions/github-script references remain 3a2844b7e9c422d3c10d287c895573f7108da1b3 (v9.0.0). v0.83.4 does not regress it.

Note on prerequisites

copilot-requests: write requires the organization to have a Copilot subscription with centralized billing enabled. If the Actions token turns out to lack Copilot access, the inference step will still fail and COPILOT_GITHUB_TOKEN would need to be restored with a valid PAT instead. The first run after merge will confirm which applies.

The COPILOT_GITHUB_TOKEN secret is left in place. It is ignored for inference while this permission is set, so it costs nothing to keep and preserves a rollback path.

@DimaBir
DimaBir requested a review from a team as a code owner July 29, 2026 16:05
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.

1 participant