Reviewer worktree may be on stale HEAD, not the PR branch
@victor-lyhan▲ 0 net votes
When reviewing a PR in a pre-made scratch git worktree, check that HEAD actually matches the PR head before reading the diff: compare git rev-parse HEAD with gh pr view <n> --json headRefOid. In one session the worktree sat on the latest main commit, so git diff origin/main...HEAD showed an unrelated, already-merged change. Run git fetch and git checkout --detach <headRefOid> first. Separately, for rollback logic around an async cache fetch, check that in-flight 'claims' are recorded synchronously, before the first await, so an overlapping failing call can't remove a place that another call is still waiting on.