Harden API consumption log collection against continuation timeouts#41676
Merged
pelikhan merged 2 commits intoJun 26, 2026
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add resilience to GitHub API consumption log collection
Harden API consumption log collection against continuation timeouts
Jun 26, 2026
Copilot stopped reviewing on behalf of
pelikhan due to an error
June 26, 2026 12:24
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the API consumption report workflow instructions to make log pagination/continuation more resilient and to preserve partial results when continuation fails.
Changes:
- Treat on-disk
/tmp/gh-aw/aw-mcp/logs/directories as the authoritative collected dataset during pagination. - Add bounded retries with backoff for transient continuation failures and clarify how to proceed with partial data.
- Regenerate the workflow lock/metadata to reflect the updated markdown content.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/api-consumption-report.md | Refines log collection/pagination guidance (authoritative on-disk dataset + bounded retries). |
| .github/workflows/api-consumption-report.lock.yml | Updates generated metadata hashes corresponding to the markdown changes. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+72
to
+73
| - If `continuation` is present, make at most **2** additional continuation calls using the returned parameters. After each successful continuation call, re-read that response's `continuation` field before deciding whether to continue. Do **not** invent your own `before_run_id` from the earliest run in the batch. | ||
| - If a continuation call times out, returns `ECONNREFUSED`, or otherwise fails with a transient tool/transport error, retry that **same** continuation call up to **2** more times with short backoff (about 15s, then about 45s). Do **not** change the returned pagination parameters, timeout, or count while retrying. |
Comment on lines
+71
to
+74
| - Treat the run directories already present under `/tmp/gh-aw/aw-mcp/logs/` as the authoritative collected dataset. Successful continuation calls should add to that dataset; if a later continuation attempt fails, keep using the directories that are already on disk. | ||
| - If `continuation` is present, make at most **2** additional continuation calls using the returned parameters. After each successful continuation call, re-read that response's `continuation` field before deciding whether to continue. Do **not** invent your own `before_run_id` from the earliest run in the batch. | ||
| - If a continuation call times out, returns `ECONNREFUSED`, or otherwise fails with a transient tool/transport error, retry that **same** continuation call up to **2** more times with short backoff (about 15s, then about 45s). Do **not** change the returned pagination parameters, timeout, or count while retrying. | ||
| - If the continuation call still fails after those bounded retries, stop collecting, proceed with the logs already downloaded to `/tmp/gh-aw/aw-mcp/logs/`, and clearly note in the final discussion that continuation retries were exhausted and the dataset may be partial. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API consumption report could publish a partial 24h window when a continuation call timed out mid-collection, dropping already-fetched coverage and skewing day-over-day comparisons. This change hardens the workflow’s log-collection instructions so continuation failures degrade to a preserved partial dataset instead of silently losing progress.
Collection resilience
/tmp/gh-aw/aw-mcp/logs/as the authoritative collected dataset across pagination calls.Bounded continuation retries
timeout,ECONNREFUSED, transport/tool errors).Pagination discipline
continuationfield after each successful follow-up call.before_run_idor using ad hoc pagination/count tuning outside the MCP response.Report clarity on degraded runs