Repository navigation
fix(issue-loop): count every pull request citing an issue, not the newest 30 - #2340
Conversation
…west 30 The loop reads a run's progress from the merged pull requests whose body cites the issue (milestone when the count rises) and the open one citing it (pr-open). Both read only the 30 most recently created pull requests, so an older citing PR dropped out of the count whenever newer ones merged. On 2026-10-19 #2217's second attempt merged #2321 while #2319 also merged, pushing the older citing #2219 out of the window: the count read 2 before and after, the run was recorded as no-progress, and the loop labeled #2217 autofix-blocked with a comment saying no pull request had merged. The same window gave later prompts an undercounted or missing preflight note (#2224's runs were told nothing about #2225). Union the 30 newest with a body search for the issue number, keep the `#N\b` filter, and fail on a gh error instead of reading zero. The newest 30 still cover a just-merged PR the search index may lack. `--print-progress N` prints what the loop counts, for tests and for diagnosing a misclassified run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
|
Two reproducible gaps remain in
Please add both behavioral cases and use an authoritative paginated PR enumeration, or another approach that establishes completeness without depending on search indexing or silently truncating. If completeness cannot be established, return an error rather than a definitive count. The existing tests for API failures and newest-open selection should remain intact. The PR is useful and remains open for repair; I am holding the merge on these concrete counterexamples. Update: both counterexamples are fixed in The code findings above are resolved. The PR is ready for review and awaiting its exact-head CI; no merge has occurred. |
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
File submission policy
Summary
The issue loop detects progress by counting merged PRs whose bodies cite an issue and finding its newest open citing PR. A newest-30 window can lose an older citer during a run, hiding a real milestone. The proposed search fallback also missed older PRs awaiting indexing and silently capped the count at 1,000.
Enumerate all pages of GitHub's repository PR connection for each state, then apply the existing issue-reference filter and deduplicate PR numbers. A failure on any page aborts the operation before a count is reported.
--print-progress Nexposes the same logic as a read-only diagnostic.This PR originated in an unattended reflection run. The reflection proposer is prohibited from merging its own proposal; this revision follows the maintainer's separate request to review and repair the open PR queue.
Validation
bash -n scripts/issue_loop.shandgit diff --checkpass.Related issue
None. This fixes the progress-detection failure documented by the original reflection report and the reproducible review counterexamples.
Visual impact
Final performance pass
Checklist
Signed-off-byline.