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 07c6630
Browse filesBrowse the repository at this point in the historyBrowse files
Close high-effort review findings on F2d: settle, head read-back, drafts
- The already-fixed check's default runner reuses runWithInput, so an
aborted stage escalates to SIGKILL and the 12 s deadline holds.
- runWithInput settles after exit even if a process gh started keeps
the pipes open, closing them after a grace period.
- A refresh read-back polls briefly until GitHub shows the pushed head,
so a correct publish is not sent to needs human by a stale head.
- When the check matches, the task's earlier ready PR becomes a draft,
so it is never left ready for review.
- #recover reads the task's PR records once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/implementation/pull-request-opening.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,9 +67,13 @@ Each opening or refresh owns the task state version at the moment it passed step
67
67
| Unchanged, needs human | Draft opened, or the earlier PR updated and turned back into a draft | needs human |
68
68
| Changed (cancelled, reassigned, new attempt, new head) | Opened | Unchanged; the PR is recorded so it can be reused or closed later |
69
69
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
+
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.
73
+
70
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.
71
75
72
-
**Transport.** The PR title and description go to `gh api --input -` as a JSON body on stdin (`github/run-with-input.ts`), never as arguments: Linux limits one argument to 128 KiB, and a 60,000-character description of multibyte text is larger. The runner settles only after `gh` has exited, including on a timeout or abort: it sends SIGTERM, then SIGKILL after 5 seconds if `gh` is still running. The already-fixed check also waits for both of its reads to settle before it returns.
76
+
**Transport.** The PR title and description go to `gh api --input -` as a JSON body on stdin (`github/run-with-input.ts`), never as arguments: Linux limits one argument to 128 KiB, and a 60,000-character description of multibyte text is larger. The runner settles only after `gh` has exited, including on a timeout or abort: it sends SIGTERM, then SIGKILL after 5 seconds if `gh` is still running, and if a process `gh` started keeps the output pipes open after `gh` exits, it closes them after 1 second. The already-fixed check uses the same runner, so its 12-second deadline always holds. The already-fixed check also waits for both of its reads to settle before it returns.
73
77
74
78
**Environment.** Each `gh` process gets only an allowlist of variables: the path, home and locale; GitHub tokens, host and configuration directories; the D-Bus session bus that Linux keyring sign-in uses; and proxy and CA settings (`github/gh-env.ts`). Prompts, the pager and update checks are turned off.
returndraft ? {kind: 'draft skipped', result } : {kind: 'possibly already fixed', result };
107
+
}
100
108
// Checked before the push: a refused publish must not move the branch.
101
109
if(earlier&&live&&earlier.state==='opened'&&live.number!==earlier.number)thrownewGuardRefusal('GitHub returned a different pull request for this branch.');
102
110
// No await since recordAlreadyFixed, whose transaction re-read the task: the push follows it directly.
@@ -106,7 +114,7 @@ export class PullRequestPublisher {
if(lost.repository.toLowerCase()!==this.#config.repository.toLowerCase())thrownewGuardRefusal('A pull request was being opened in another repository.');
0 commit comments