Repository navigation
Measure stale PR age from the latest reopen - #7282
Merged
Merged
Conversation
The nightly cleanup aged pull requests from creation, so a PR reopened after its first closure was closed again at the next run (#6215 was reopened on Nov 7 and closed on Nov 8). Skip PRs whose latest reopen is inside the fourteen-day window. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/investigate-premature-pr-closure-thr_6fus9m3d6c
branch
November 9, 2026 18:01
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.
Human comments
What was wrong
The nightly stale-PR cleanup (
.github/workflows/close-stale-prs.yml) measured age fromcreated_atonly. A PR reopened after its first closure was therefore closed again at the next scheduled run. #6215 was created Oct 24, closed Oct 27, reopened Nov 7, and closed by the bot on Nov 8 with "open for more than two weeks" after less than a day open.What changed
Before closing a candidate, the job reads the PR's issue events and treats the PR as open since its latest
reopenedevent (orcreated_atif never reopened). PRs reopened within the fourteen-day window are skipped and logged as "Recently reopened". The creation-date prefilter is unchanged, so events are fetched only for PRs older than fourteen days.How you verified
open_sinceagainst live data: Keep the server responsive when agents saturate the CPU (behind an experiment) #6215 resolves to its 2026-11-07T19:42:06Z reopen (so the Nov 8 run would have skipped it); feat: allow operator-trusted self-hosted account origins #6307 (never reopened, closed today) still resolves to its creation time.APPLY=false) of the full script againstget-bb/bbcompletes without errors.pnpm exec oxfmt .github/workflows/close-stale-prs.yml --check,git diff --check🤖 Generated with Claude Code