Repository navigation
Exit pr_review.py wait When Unresolved Threads Land on an Attested Head - #3680
Conversation
The held poll on an attested head now reads each thread's state and author, and an open thread ends it at once with exit 46 and a status=THREADS_UNRESOLVED line naming who opened them, since no check clears a thread. Closes #3671. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A merged or closed pull request with a thread left open now exits 0 rather than 46, since no rerun clears it. The README's exit-0 row and held-poll paragraph now name the thread release, and tests pin 46 over 44 and 45, the cut-page mark, and the unnamed-author fallback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A merged or closed held head with a thread left open exits 0, so the exit-0 rows now say no thread is open only where the pull request is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
The polling logic can miss unresolved threads beyond a truncated page and incorrectly return success, so it must be corrected before approval.
2 open issues
What changed in this PR
This pull request updates pr_review.py wait to detect unresolved review threads during attested-head polling, return exit code 46, identify thread authors, and document the required driver behavior.
Changes:
- Adds thin thread-state and author reads to held-poll queries.
- Adds unresolved-thread precedence over check-related outcomes.
- Adds tests for polling transitions, truncation markers, author fallbacks, closed or merged pull requests, and resolved threads.
- Updates the README and canonical/generated
drive-prskill documentation. - This pull request requires changes.
| File | Summary | Findings |
|---|---|---|
tests/test_pr_review.py |
Adds regression coverage for unresolved-thread polling, precedence, truncation, author fallbacks, and terminal states. | [P3] nit — 1 vote: Rename the malformed thread_s_state test name. |
scripts/README.md |
Documents exit code 46 and held-poll behavior. |
[P2] nit — 2 votes: Qualify the thread condition as wait-only because status can still return 0 with an unresolved thread. |
scripts/pr_review.py |
Adds thread-aware held polling and exit code 46. |
[P1] critical — 4 votes: Handle truncated thread pages before continuing the poll; unresolved threads beyond the first 100 entries can currently be missed. |
.github/skills/drive-pr/SKILL.md |
Regenerated GitHub skill documentation. | None. |
.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md |
Regenerated Claude skill documentation. | None. |
.claude-plugin/fleet-skills/.source-digests/drive-pr |
Updates the generated skill source digest. | None. |
.agents/skills/drive-pr/SKILL.md |
Updates the canonical driver procedure for exit code 46. |
None. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3680 +/- ##
===========================================
+ Coverage 81.72% 81.74% +0.01%
===========================================
Files 27 27
Lines 9128 9137 +9
===========================================
+ Hits 7460 7469 +9
Misses 1668 1668
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A thread page cut at 100 with none open in it now ends the held poll with exit 46, since an open thread may sit past it, rather than releasing to 0. The README's exit-0 row now says only wait reads threads, and a malformed test name is fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A held head whose thread read was cut at 100 now has every page read before the poll decides, so a pull request whose many threads are all resolved releases normally rather than exiting 46 on every rerun. The README's exit-0 row now says status exits 0 whatever threads are open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Outcome for the remaining local-review finding listed in the body, the doubled thread walk on a cut page: declined with evidence. The walk runs only where a pull request's thread read is cut at 100, which the same review pass judged unrealistic for a feature pull request into develop. There it costs about one GraphQL point per page per poll read, against a 5000-point hourly budget, and a 45-minute wait makes about 25 reads. Correctness is unaffected, and caching it per payload would add state to the poll for a path that is rarely reached. |
## Summary Answers Copilot's finding on promotion [#3681](#3681), [Cache paginated thread results within each poll](#3681 (comment)). It follows #3680, for #3671. The held poll in `pr_review.py wait` judges one read more than once. It judges it in `held_read`, again in `backoff`'s `keep`, and once more at the exit-46 branch. On a pull request whose thread read is cut at 100, each judgment walked every thread page again. `open_on_head` now keeps its answer on the payload it judged, as `_open`, so each read's walk is paid for once. Each GitHub read is a fresh dict, so the kept answer never outlives the read it describes. - Test: `test_a_cut_thread_page_is_walked_once_per_read` pins one walk where the poll and the exit judge the same read. It fails with the cache removed. - The full suite passes, 3141 tests, and so do ruff, mypy, the prose gate, and the eol gate. ## Local review One `local-strict-review` pass at the `frontier` tier raised nothing. It checked every call site for staleness, `full_read`'s reuse of the polled object, the test mock's repeated object, and whether the extra key leaks into anything that iterates or serializes a payload. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
…on an Attested Head (#3681) Promotes the changes merged into `develop` since promotion #3678 to `main`. - [#3680](#3680) Ends `pr_review.py wait`'s held poll on an attested head when an unresolved review thread is open, with a new exit `46` and a `status=THREADS_UNRESOLVED` line naming the threads' authors. The poll's read now carries each thread's state and author, and a thread read cut at 100 is walked to its end first. - [#3682](#3682) Walks a cut thread page once per poll read, keeping the answer on the payload it judged, which answers this promotion's first Copilot round. Closes #3671 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Summary
Fixes #3671. On a pull request into
developwhose head carries an attestation,pr_review.py waitpolls the checks rather than requesting a Copilot round. That poll never read review threads. So when Qodo or CodeRabbit opened threads while the checks ran,waitkept polling while the merge readBLOCKED, and the driver was never told there was work to dispose of.Q_HELD, the poll's read, now selects each thread'sisResolvedand opening author, and nothing else, so each poll read stays thin.open_on_headhelper reads the open threads from that page. Where the page was cut at 100, it walks every page through the existingunresolved_threads()instead.waitthen exits46withstatus=THREADS_UNRESOLVED, naming the threads' authors.46outranks30,44, and45, since no check clears a thread.0, since no rerun clears it.pr_review.pydocstring, thescripts/README.mdexit-code table and held-poll paragraph, anddrive-prstep 3, with the generated skill copies regenerated.46over44and45, a cut page walked to its end with and without an open thread past it, the unnamed-author fallback,MERGED/CLOSEDreaching0, and resolved threads only reaching0. The poll-query contract test now pins the thin thread selection in place of "no threads".Each new poll test fails with the code path it pins removed. The full suite passes, 3140 tests, and so do ruff, mypy, the prose gate, and the eol gate.
Local review
Five
local-strict-reviewpasses ran at thefrontiertier, over two pushes.introducedfindings, fixed in 509e677: two README drifts,46firing on a pull request no longer open, and missing precedence tests. It also raised an over-hardening finding, which was taken. A suggestion to reuse the digest's thread count was declined asstyle. Pass 2 raised one wording finding, fixed in 9a54b23, and pass 3 raised nothing.introducedfinding, with this push's edit budget spent: on a pull request whose thread read is cut, the full walk runs twice per poll read, sincebackoffre-runsstill_heldon the valueheld_readalready judged. It also runs once more at the exit-46 branch. Correctness is unaffected. Its cost is a few GraphQL points per iteration, only past 100 threads. This gets its outcome in this pull request's review loop.🤖 Generated with Claude Code