Hmbown/CodeWhale · error

Pull request changed during review; no current-PR review or…

Error message

Pull request changed during review; no current-PR review or receipt can be accepted. Run the review again.

What it means

same_revision compares the PR snapshot captured at review start (expected) with a fresh snapshot (current): number, state, title, base/head SHAs, changed_files, additions, deletions, and url must all match. If any differ, the PR mutated while the review ran, so a review comment or receipt could be attached to the wrong revision; the tool rejects both rather than accept a stale result.

Solutions

  1. Run the whole review again on the now-current revision — this is the intended recovery and the only way a review is accepted
  2. Check `git ls-remote origin <pr-branch>` vs the pinned head_sha to identify what moved; coordinate so nobody pushes during review windows
  3. If reviewing via automation, snapshot the PR and complete review in one short-lived run without intervening pushes
Defensive patterns

Strategy: retry

Validate before calling

// re-fetch and compare before submitting a review
let cur = gh_view(num)?;
if cur.head_sha != pinned.head_sha || cur.base_sha != pinned.base_sha || cur.changed_files != pinned.changed_files {
    return Err("PR moved; rerun review from scratch".into());
}

Try / catch

match ensure_current(&expected) {
    Err(e) if e.to_string().contains("changed during review") => {
        // discard stale review, start a fresh run
        rerun_review(number)?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling ensure_current (via fetch_view's re-view) or diff_with again after the PR's head moved, base changed, files were pushed, or the PR was edited between the initial view and the final check.

Common situations: A teammate force-pushes the PR branch mid-review; CI bot rebases the branch; reviewer keeps the review open across a base-branch sync; rerunning receipt validation after the PR was merged/closed and its state flipped.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/f980a000c4631a87. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/tools/review_pr.rs:113

pub(crate) fn fetch_view(
    number: u32,
    repo: Option<&str>,
    workspace: &Path,
) -> Result<GhPullRequest> {
    view_with(number, repo, &mut |program, args| {
        run_command(workspace, program, args)
    })
}

fn same_revision(expected: &GhPullRequest, current: &GhPullRequest) -> Result<()> {
    if expected.head_sha != current.head_sha
        || expected.base_sha != current.base_sha
        || expected.changed_files != current.changed_files
        || expected.additions != current.additions
        || expected.deletions != current.deletions
        || expected.url != current.url
    {
        bail!(
            "Pull request changed during review; no current-PR review or receipt can be accepted. Run the review again."
        );
    }
    Ok(())
}

pub(crate) fn ensure_current(
    number: u32,
    repo: Option<&str>,
    workspace: &Path,
    expected: &GhPullRequest,
) -> Result<()> {
    same_revision(expected, &fetch_view(number, repo, workspace)?)
}

/// Model-only representation of an already verified complete diff. Keep the
/// original for revision checks, fingerprints and comment anchors. Embedded
/// binary payloads are not meaningful text input; their headers retain paths,

View on GitHub (pinned to 73e0f67d83)