Skip to content

Review run aborts with "pull request changed during Review run" when the Base branch advances #2044

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From the 2026-11-11 fleet retrospective across thirdshift 0.27.2–0.29.0.

Agent Brief

Category: bug
Summary: A Review run treats any advance of the target Base branch (main / master) on GitHub as "pull request changed during Review run", aborting in-flight reviews and stranding their committed fixes whenever an unrelated pull request merges.

Current behavior:

GitHub::review_pull_request populates ReviewPullRequest.base_head from GitHub's base.sha field, which is the live tip commit of the target Base branch (main / master) at the moment of the API query rather than the pull request's merge-base. During and after the Review session, compatible asserts current.base_head == snapshot.base_head && current.base == snapshot.base && current.branch == snapshot.branch.

On an active repository where unrelated pull requests merge every 15–30 minutes, current.base_head advances during a 25–40 minute Review run even when current.head, current.branch, and current.base are completely unchanged. compatible then fails with pull request changed during Review run, aborting Delivery (or recommend-only posting) and stranding any committed review fixes in a retained Review worktree.

Desired behavior:

Advancing base_head (base.sha on the target Base branch) while a Review run is in flight does not cause compatible or unchanged to fail as long as:

  • the pull request remains open and reviewable,
  • current.base == snapshot.base (the target branch name has not been retargeted),
  • current.branch == snapshot.branch (the head branch ref has not changed), and
  • for unchanged / pre-push head safety, current.head == snapshot.head.

ReviewDelivery continues to use snapshot.base_head (captured at acquisition) for its merge-base / diff scope and continues to enforce mergeability (require_mergeable) before pushing or Self-merging, so a true merge conflict introduced by an advancing Base branch is still caught cleanly as a merge conflict rather than misreported as "pull request changed during Review run".

Key interfaces:

  • ReviewPullRequest and compatible / unchanged in the Review process: keep target-branch-name (base), head-branch-name (branch), and pull-request-head (head) guards, while removing the requirement that the live Base branch tip (base_head) stay frozen for the duration of the Review run.
  • ReviewDelivery: keep snapshot.base_head for local merge-base calculation and keep mergeability checks intact.

Acceptance criteria:

  • When base.sha on the target Base branch advances on GitHub during a Review run while head.sha, head.ref, and base.ref remain unchanged and the pull request remains mergeable, the Review run completes normally (pushes fixes and posts its review comment, or posts its recommend-only comment).
  • When the pull request's own head.sha changes, its base.ref is retargeted to a different branch name, or the pull request closes/merges mid-run, the Review run still refuses to publish as before.
  • When an advancing Base branch introduces a merge conflict on the pull request, ReviewDelivery's mergeability check catches and reports the conflict without pushing onto a conflicted pull request.
  • Integration tests exercise advancing base.sha during a Review run through the CLI against the fake gh.

Out of scope:

Activity

  1. added
    bug
    ready-for-agent
    on Nov 11, 2026
  2. added
    in-progress
    agent-failed
    and removed
    ready-for-agent
    in-progress
    on Nov 11, 2026
  3. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This comment was generated by AI.

    thirdshift's Run on this issue failed, so it waits for the Day shift.

    Put ready-for-agent back to retry.

  4. added
    ready-for-agent
    in-progress
    and removed
    agent-failed
    ready-for-agent
    on Nov 12, 2026
  5. removed
    in-progress
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions