Skip to content

Walk a Cut Thread Page Once per Poll Read - #3682

Merged
ptr727 merged 1 commit into
developfrom
feature/3671-cache-open-threads
Oct 31, 2026
Merged

ptr727 merged 1 commit into
developfrom
feature/3671-cache-open-threads

Conversation

@ptr727

@ptr727 ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

Answers Copilot's finding on promotion #3681, Cache paginated thread results within each poll. 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

The held poll judges one read more than once, in its own read and again
in the backoff and the exit, so each judgment of a cut page walked every
page again. The walk's answer is now kept on the payload it judges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 31, 2026 01:39
@ptr727

ptr727 commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Oct 31, 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.

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.

🟢 Approval recommended

No active review issues were identified, and the change includes regression coverage for the pagination behavior.

No open issues 🎉

What changed in this PR

This pull request prevents repeated pagination of unresolved review threads during pr_review.py wait by caching each payload’s result, with regression coverage for truncated thread pages.

Changes:

  • Cache open_on_head results per payload using the private _open key.
  • Add a regression test confirming a cut thread page is walked only once per payload read.
  • No actionable findings identified.
File Description
tests/​test_pr_review.py Verifies that a truncated thread connection is paginated once per payload.
scripts/​pr_review.py Caches unresolved-thread results for each polled payload.

Review effort: Lite

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.74%. Comparing base (125d6bf) to head (0e6bba5).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3682   +/-   ##
========================================
  Coverage    81.74%   81.74%           
========================================
  Files           27       27           
  Lines         9137     9139    +2     
========================================
+ Hits          7469     7471    +2     
  Misses        1668     1668           
Flag Coverage Δ
python-3.13 81.74% <100.00%> (+<0.01%) ⬆️

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.

@ptr727
ptr727 merged commit 96475c1 into develop Oct 31, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/3671-cache-open-threads branch October 31, 2026 01:54
ptr727 added a commit that referenced this pull request Oct 31, 2026
…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)
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