Skip to content

wait-for-pr-review can report a review of a newer commit than the head it reports #2714

Closed

Description

@josecelano

Parent EPIC: #2003 - Overhaul: Automation Tools and AI Agent Guardrails

Goal

Make a review or comment result of the wait-for-pr-review poller never claim a head that is older than the feedback it reports, so the review loop's stale-checkout check cannot pass on a checkout that lacks the commit the feedback is about.

Problem

A snapshot is four sequential REST calls that are not atomic, and the head is read first. If a push and a review of that push arrive between the first call and the review-list call, the result reports the old head in head_sha, the review of the new commit in review_commit_id, and no head_moved. Reproduced on the real binary with a scripted gh that returns exactly that interleaving; the timing is scripted, and a real race on GitHub was not observed.

The specification, the reproduction and the fix options are in pull request #2716, which adds docs/issues/open/2714-2003-wait-for-pr-review-head-race-between-requests/ISSUE.md.

Activity

  1. added
    Bug
    on Nov 4, 2026
  2. added 2 commits that reference this issue on Nov 4, 2026
  3. self-assigned this
    on Nov 6, 2026
  4. added a commit that references this issue on Nov 6, 2026
  5. added a commit that references this issue on Nov 11, 2026
  6. added 10 commits that reference this issue on Nov 11, 2026
  7. added 2 commits that reference this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AutomationBug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions