You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dcc2b0c
Browse filesBrowse the repository at this point in the historyBrowse files
Draft the earlier PR before recording a matching check, so a failure stays retryable
Also refuse a PR-number mismatch before any GitHub change, and remove
each head-poll abort listener when its wait ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/implementation/pull-request-opening.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Each opening or refresh owns the task state version at the moment it passed step
69
69
70
70
After an update, the read-back polls up to 5 times, half a second apart, until GitHub shows the pushed head, because GitHub updates a PR's head a moment after a push.
71
71
72
-
When the check matches (or is unknown) and the task's earlier PR is open and ready for review, publish turns it back into a draft. A task that is not being published as ready never leaves its PR ready for review.
72
+
When the check matches (or is unknown) and the task's earlier PR is open and ready for review, publish turns it back into a draft. A task that is not being published as ready never leaves its PR ready for review. This happens before the check result is recorded: if it fails, the task is still running, and a retry checks again and repeats it. A PR-number mismatch is refused before any GitHub change.
73
73
74
74
The adapter refuses any answer for a PR that is not open. A PR closed between the lookup and the update is never recorded as the task's review PR.
returndraft ? {kind: 'draft skipped', result } : {kind: 'possibly already fixed', result };
107
-
}
108
-
// Checked before the push: a refused publish must not move the branch.
98
+
// Checked before any GitHub change: a refused publish must neither draft the PR nor move the branch.
109
99
if(earlier&&live&&earlier.state==='opened'&&live.number!==earlier.number)thrownewGuardRefusal('GitHub returned a different pull request for this branch.');
100
+
// A task that is not published as ready never leaves its PR ready for review: on a match its earlier ready PR becomes
101
+
// a draft. This comes before the result is recorded, so if it fails the task is still running and a retry repeats it.
102
+
// Making a PR a draft only lowers what it offers, so it needs no re-read of the task first.
0 commit comments