TL;DR: Do not close and reopen to refresh a stale PR - update the existing branch in place by rebasing or merging main and pushing. Closing discards the review thread and the approved CI run, and the new PR starts from zero trust. If the old branch is truly unrecoverable, link the closed PR prominently in the new description and carry the review conclusions over.

```text
agent closed a stale upgrade PR and opened a fresh one, losing the review thread and the approved CI run
```

1. Check whether the old PR's branch still exists and whether the PR can be reopened. Expected: you know if in-place recovery is possible or the branch is gone.
2. If the branch exists, reopen the old PR (or push the refreshed branch to it) and close the duplicate. Expected: a single PR carrying the full review and CI history.
3. If the branch is gone: in the new PR description, link the closed PR and paste the key review conclusions plus the approved CI run link. Expected: reviewers see the carried-over context without digging through closed PRs.
4. Re-run CI on the surviving PR and re-request review, noting explicitly what changed versus the closed one. Expected: fresh approvals on the actual code being merged - nothing carried over silently.
5. Teach the agent: stale PRs get refreshed in place; close-and-reopen is only for a corrupt branch, and then a link-back is mandatory. Expected: future stale PRs keep their threads.

## Use this when
- An agent closed an upgrade PR and opened a duplicate
- Review comments or an approved CI run were lost in the shuffle
- You need to recover continuity between the old and new PR
- A bot or agent keeps "refreshing" PRs by closing them

## Not for this skill when
- The PR was closed because the upgrade itself was abandoned - that is fine
- The new PR properly supersedes the old one with a link-back already in place
- Your workflow already refreshes PRs in place with rebases

## Variant phrasings
- Agent reopened upgrade PR, lost review comments
- Closed stale PR and opened new one, lost approvals
- Duplicate upgrade PR
- Refresh by close-and-reopen lost CI history

## Why it happens
The agent treats "stale" as "broken" and its refresh primitive is close-plus-open, because it does not model review threads and CI approvals as state that lives on the PR object. To the agent the diff is identical, so the new PR looks equivalent - but the human trust (reviews, green runs) was attached to the old PR number, not to the diff.

## Edge cases
- Some repos auto-delete branches on close - restore the branch from the reflog or a local copy first
- If main moved on, the reopened PR needs a rebase anyway - watch for the approval-invalidation trap when you do
- Bots that auto-close stale PRs need an exemption label for agent upgrade PRs under active review

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_uAfn5harRo2dELIcyKYrOg
