Skip to content

Re-Request Once on a Transient Copilot Fetch Error - #3542

Merged
ptr727 merged 5 commits into
developfrom
feature/3510-copilot-transient-fetch-error
Oct 28, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/3510-copilot-transient-fetch-error

Conversation

@ptr727

@ptr727 ptr727 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What

pr_review.py read every Copilot error refusal as a possible quota hit, so wait stopped and handed the drive to the maintainer. The same body is posted for a transient fetch failure that one re-request clears.

wait and status now read the reviewer's run log for a too many files changed line before taking the quota reading.

  • run_cause also returns the log's transient-failure line, beside the error type and rate-limit sentence it already read. A logged rate limit still wins.
  • One primitive, transient_state, says where an error refusal stands on its one re-request: owed, pending, sent, or spent. wait's request, its exit, and the digest line all read it.
  • wait sends the one re-request while the state is owed. A request made after the refusal spends it, so a request that vanished is not sent again. Two error refusals in a row spend it too.
  • A pending re-request polls until the next round lands, then exits on that round. With no round by the timeout it exits 30, status=PENDING.
  • A held head, into a branch other than the default, exits 41 as COPILOT_ERROR_TRANSIENT, naming --request as what sends the re-request. Elsewhere an owed refusal steps aside, so an unrecorded request, an outside answer, or the repo-wide quota keeps its own status.
  • A spent or sent-and-unanswered re-request, an unread log, or a log naming neither cause keeps COPILOT_ERROR_POSSIBLE_QUOTA. Its status line now says which reading was taken.
  • status prints a RUN LOG READING line under an ERROR refusal, naming the reading taken.

No exit code is added. The transient state rides the existing 0, 30, 40, and 41 outcomes and their status lines.

The help text, scripts/README.md, and pr-review-conduct describe the transient exception. The skill's generated copies are regenerated. drive-pr carries no changed section, so its copies are unchanged.

Tests

tests/test_pr_review.py covers the reading with constructed run logs and request histories: the transient line parsed with and without an error type, a rate limit outranking it, one re-request reviewed normally on the current head and on an earlier one, a second refusal ending the poll as quota, two refusals in a row, a pending re-request at the timeout, a re-request already sent, an unrecorded re-request, a second wait on a pending re-request, a held head, an unread log, and the digest's readings.

Local strict review findings

The first push left two introduced findings open once its edit budget was spent. Both are fixed in dc2bbe5, and that push's pass raised none.

  • scripts/README.md:225, introduced, fixed: it said wait exits 41 as COPILOT_ERROR_TRANSIENT wherever it sent none, while only a held head reaches that exit.
  • scripts/pr_review.py transient_state, introduced, fixed: the digest and the exit each read the request history. The read is now kept on the payload, so they share one answer.

Filed elsewhere

Closes on promotion: #3510

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 27, 2026 16:07
Read the reviewer's run log for a `too many files changed` fetch failure
before reading an error refusal as a possible quota hit. `wait` spends one
re-request on such a refusal, unless the round before it was an error
refusal too, and `status` names the reading taken in a RUN LOG READING line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read where an error refusal stands on its one re-request from one
primitive, `transient_state`, which `wait`'s request, its exit, and the
digest line all read. A request made after the refusal spends the
re-request, so a request that vanished is not sent again. A pending
re-request exits 30, and one this wait did not send exits 41 as
COPILOT_ERROR_TRANSIENT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name COPILOT_ERROR_TRANSIENT only on a held head, where --request is what
sends the owed re-request. Elsewhere the refusal steps aside, so an
unrecorded request, an outside answer, or the repo-wide quota keeps its
own status. A pending re-request now polls until the next round lands,
the digest reads a sent and unanswered re-request as possible quota, and
the request read reuses newest_request_event.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 27, 2026 23:26
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ptr727

ptr727 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 53c1e25989c184d9996e127f4e96e03a6a1ac6e2, the content this pull request carries at that commit against develop, and it recorded 2 findings.

Keep the request history `transient_state` reads on the payload, so the
digest and the exit over the same final read share one answer. Name the
held head as the only place `COPILOT_ERROR_TRANSIENT` is reached in the
README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head dc2bbe5053f91fc3e8d5e26279e7726ea7117d77, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved findings affect one-request state correctness, pending detection, digest and exit consistency, no-bot handling, timestamp handling, refusal wording, and documentation guidance.

2 open issues
What changed in this PR

This pull request distinguishes transient Copilot fetch failures from quota refusals, permits one controlled re-request, and updates related status, polling, digest, documentation, and skill behavior. Unresolved findings remain in request-state handling, output consistency, and documentation.

Changes:

  • Parses Copilot run logs and tracks transient re-request states.
  • Adds coverage for transient, pending, spent, held-head, and quota outcomes.
  • Updates the README and canonical/generated review-conduct skill files.
File Summary
tests/​test_pr_review.py Adds coverage for transient causes, request histories, polling states, status output, and digest readings.
scripts/​README.md Documents transient refusal handling, re-request behavior, and exit statuses.
scripts/​pr_review.py Implements transient log classification, re-request state tracking, polling, status reporting, and digest behavior.
.github/​skills/​pr-review-conduct/​SKILL.md Updates the generated GitHub review guidance for transient refusals.
.claude-plugin/​fleet-skills/​skills/​pr-review-conduct/​SKILL.md Updates the generated Claude skill guidance for transient refusals.
.claude-plugin/​fleet-skills/​.source-digests/​pr-review-conduct Updates the generated skill source digest.
.agents/​skills/​pr-review-conduct/​SKILL.md Updates the canonical review procedure for transient refusals.

Review effort: Lite

Comment thread scripts/README.md Resolved
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.71%. Comparing base (d74cf30) to head (9f5901c).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3542      +/-   ##
===========================================
+ Coverage    81.58%   81.71%   +0.12%     
===========================================
  Files           26       26              
  Lines         8972     9030      +58     
===========================================
+ Hits          7320     7379      +59     
+ Misses        1652     1651       -1     
Flag Coverage Δ
python-3.13 81.71% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Name the transient error refusal as the exception in the review loop's
request and wait steps, which still read every error refusal as one
nothing re-requests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 9f5901ce1e1e0b1e26f6b62701333145723afa25, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit b472126 into develop Oct 28, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/3510-copilot-transient-fetch-error branch October 28, 2026 00:15
ptr727 added a commit that referenced this pull request Oct 28, 2026
…y Tests, and Copilot Transient Fixes (#3544)

## Summary

Promotes `develop` to `main`, carrying round 1 of the resync-issue
burndown:

- #3538: `AGENTS.md` "Model Tiers" now states the no-model dispatch
result once, conditionally, in the `highest` bullet. The two bullets
that contradicted it lost their unconditional claims. The three skills
including the section are regenerated.
- #3539: `GOVERNANCE.md` "Durable Knowledge and Self-Improvement"
describes the standing-issue handoff lifecycle, matching `AGENTS.md`
"Session Scope". `agent-conduct` is regenerated.
- #3540: `spec/files.json` gains a `repoOwnedTrees` list declaring
`tests`, and `spec/audit.py` `hub_only_paths` leaves those paths out. A
carrier's own `tests/` file is no longer reported as hub-only.
`spec/validate.py` shape-checks the list, and `AUDIT.md`, `RESYNC.md`
and the project-types assertion state the exclusion.
- #3542: `pr_review.py wait` and `status` read the Copilot run log
before calling an error refusal quota. A `too many files changed` line
is transient and earns one re-request, as `COPILOT_ERROR_TRANSIENT` on
the existing exit 41.
- #3545: promotion fix for Copilot's finding on this pull request.
`spec/validate.py` refuses a `repoOwnedTrees` source that overlaps a
carried `trees[].source` or holds a `baseline` path.

Fixes #3529
Fixes #3504
Fixes #3528
Fixes #3510

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants