Repository navigation
fix(auditor): degrade gh-aw subprocess timeouts to deferred evidence - #78232
Conversation
The Auditor collect step crashed with an unhandled `spawnSync gh ETIMEDOUT` (runs 43792678875, 43786667975). Per-run `gh aw logs --after-run-id N-1 --before-run-id N+1 --count 2` can only ever match one run, so the CLI kept paginating up to 20 tiny pages of older history looking for a second match. Its `--timeout 2` equalled the 120s execFileSync timeout, so Node killed it before it could report. CLI: stop pagination once a fetched page reaches --after-run-id (run IDs are monotonic and pages are newest-first), so older pages cannot match. Workflow: request --count 1, give the subprocess 30s slack over the CLI's timeout, defer a run (leave it pending) on ETIMEDOUT or a CLI "Timeout reached" continuation instead of crashing, and route a health subprocess timeout through the existing bounded time_budget retry path. Other incomplete evidence still fails closed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The collect job installed the latest released CLI, so collection fixes in pkg/cli (such as the --after-run-id pagination boundary) only applied after a release. Build the CLI from the checked-out source with setup-go, install it as a local gh extension, and version it as source-<sha> so per-version query caches stay consistent within a collection. Raise the job timeout to 25 minutes so the build does not eat into the 18-minute evidence deadline. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
|
✂️ Ponytail Reviewer has started processing this pull request |
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
🚀 PR Specification Reviewer has started processing this pull request |
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
🔬 Test Quality Sentinel is analyzing test quality on this pull request... |
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
Triage of the automated reviewer start notices on this PR:
These are automated "started processing" notices with no review feedback. All six runs failed during agent startup because of a transient model-provider outage (model routing failed with provider_unavailable, model catalogue 403 at about 03:41 UTC on 2026-11-16) before producing any review. No code change is needed; these workflows should be re-run once the provider is available. |
|
🎉 This pull request is included in a new release. Release: |
The Auditor's
collect_failure_evidencejob has crashed with an unhandledspawnSync gh ETIMEDOUTin 2 of 2 recent runs (43792678875, 43786667975; auto-filed as #78216 and #78204). A single slow per-run query took down the whole collection step.Root cause
For each backlog run, the collect script calls
gh aw logs <wf> --after-run-id N-1 --before-run-id N+1 --count 2. That window can only ever match one run, so the CLI never reaches its count. It keeps paging backward through old history, up to 20 small pages with a rate-limit check on each one. The CLI's--timeout 2(minutes) equals the 120000msexecFileSynctimeout, so Node kills the subprocess before the CLI can report, and the resultingETIMEDOUTwas never caught. In run 43792678875 this happened on backlog run 43669824841 ("Update Astro"), while the CLI was paging past 2026-11-07.Fix
CLI (
pkg/cli): pagination now stops once a fetched page reaches--after-run-id. Run IDs increase with creation time and pages arrive newest-first, so older pages cannot match.listWorkflowRunsWithPaginationrecords the oldest fetched run ID before filtering, and the batch loop checks it for both empty and non-empty batches.Workflow (
.github/workflows/auditor.md, lock regenerated):--count 1. The subprocess timeout is 150s, 30s more than the CLI's own timeout, so the CLI can report its own timeout.ETIMEDOUT, or a CLITimeout reachedcontinuation, now defers that run. The run stays pending, a warning is logged, the agent is not activated, and the remaining runs keep processing. Audit deferral reuses the existing pending/unseen logic.gh aw healthETIMEDOUTgoes through the existingtime_budgetretry path (300, then 600, then up to 900s).Build the CLI from source: the collect job used to install the latest released CLI, so CLI fixes only applied after a release. It now runs
actions/setup-go(pinned) andgo buildagainst the checkout, installs the result withgh extension install .(same pattern ascraft.md), and versions it assource-<sha>. The CLI pagination fix therefore takes effect immediately. The collect job timeout goes from 20 to 25 minutes so the build does not cut into the 18-minute evidence deadline, which is measured from script start.Notes for reviewers
gh aw version. Withsource-<sha>the key changes on every commit to main. This only affects fresh or deferred runs, which are queried within a single collection. Backlog reports are read without a version check, so no backlog evidence is re-fetched.--count 1makes the first page smaller (3 runs instead of 6), so the CLI looks back less far for runs in high-frequency workflows. In practice the timeout already limited how far back it reached.Validation
TestCollectProcessedWorkflowRunsStopsAtAfterRunIDBoundaryfails without the fix (2 and 20 fetch calls instead of 1) and passes with it.scripts/auditor-workflow.test.cjs: 56/56 pass, including new cases for a logs subprocess timeout, a CLI timeout continuation, an audit timeout and a health timeout.make recompile,make fmtandmake agent-report-progressall pass.