Skip to content

feat(review): detect PR updates and prompt refresh #492

@backnotprop

Description

@backnotprop

Problem

When reviewing a PR, the review session captures headSha at launch time. If the PR is updated (new commits pushed) while the review is open:

  1. Submitting comments fails with HTTP 422 — GitHub rejects the review because commit_id doesn't match the current PR head
  2. The diff is stale — the reviewer is looking at an old version of the code
  3. There's no indication that the PR has changed

Proposed Solution

Poll the PR head SHA periodically (or use GitHub webhooks if available) and show an indicator in the header when the PR has been updated since the review was launched. Offer a "Refresh" action that re-fetches the diff, file contents, and PR context.

Considerations:

  • Polling interval (every 30-60s?)
  • What happens to in-progress annotations when refreshing?
  • Should the worktree (--local) be updated too?
  • Could also update headSha on refresh so comment submission works again

Context

Discovered during PR #491 development — pushed a fix commit while a review was open, then got a 422 when trying to submit comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions