Skip to content

[aw-failures] [aw] Design Decision Gate pre-fetch aborts on large PRs — HTTP 406 'diff exceeded 300 files' #40075

Description

@github-actions

Problem statement

Make the Pre-fetch ADR gate PR context step tolerate large PRs: it currently shells the GitHub PR diff API directly, which returns HTTP 406 for PRs over 300 changed files, and the set -euo pipefail step then exits 1 — failing the whole agent job before the model runs.

Affected workflows and run IDs

  1. Design Decision Gate 🏗️ — §27759964011 (pull_request, PR Mark all agentic workflows as private #40048). The deterministic pre-fetch step logs could not find pull request diff: HTTP 406: Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead.PullRequest.diff too_large##[error]Process completed with exit code 1.

Probable root cause

  1. PR Mark all agentic workflows as private #40048 ("Mark all agentic workflows as private") has 490 changed files, exceeding the GitHub diff API's 300-file cap. The pre-fetch script requests the unified diff with no fallback, so the API's 406 propagates as a fatal step error.
  2. This is a workflow-definition bug, not an engine/provider issue — the failure is deterministic for any PR > 300 files and pre-empts the agent entirely (failure occurs in Pre-fetch ADR gate PR context, before Execute ... CLI).

Proposed remediation

  1. On a 406 / too_large diff response, fall back to the List pull request files API (paginated) or a git diff against the merge base, and cap/summarize the context instead of aborting.
  2. Make the pre-fetch step non-fatal on diff-fetch failure: emit a truncated/empty context with a warning so the ADR gate can still run (or skip cleanly) rather than failing the job.
  3. Add a file-count guard that switches to the files-list path above a threshold (e.g. >300 files) before calling the diff endpoint.

Success criteria / verification

  1. Design Decision Gate runs to completion (or skips cleanly) on a PR with >300 changed files; no HTTP 406 ... diff exceeded the maximum number of files step error.
  2. The pre-fetch step degrades to a bounded file list / summary instead of exiting 1 when the diff is too large.

Parent report: #39883. Analyzed run: 27759964011 (PR #40048, 490 files).
Related to #39883

Generated by 🔍 [aw] Failure Investigator (6h) ·

  • expires on Jun 25, 2026, 6:03 AM UTC-08:00

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions