Repository navigation
feat(pr): generated PR text, merge method + auto-merge, PR watch-and-wake (#1493 D) - #1498
Conversation
suggestPrText reuses the commit-message print mode with the branch's commit list, diffstat vs base and the repo PR template, and runs the result through the outbound secret scan before returning it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- gh pr merge takes squash/merge/rebase and --auto; git.mergeOptions reads the repo's allowed methods from gh repo view (cached 10 min). - electron/prWatch.js rides the existing PR-state refresher: a failing check (with a capped log tail), a new changes-requested review or a fresh conflict sends the thread one follow-up turn via deliverNotice. Debounced, capped at 3 per PR, held while the thread works. Wake-ups are machine turns, so they never satisfy the orchestration merge gate. - threads.setPrWatch toggles it; checked-out PRs default off. - New IPC: git.suggestPrText, git.mergeOptions, threads.setPrWatch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fills title and body from git.suggestPrText; a refusal (secret scan, missing CLI) shows in the dialog and keeps the draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The picker lists the methods the repo allows (preselecting the repo default) beside Merge, and beside the checks badge while checks run, where Auto-merge arms gh pr merge --auto. CI sign-off covers both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as untrusted Anyone can leave a changes-requested review on a public PR, and the wake turn quoted it into an unattended agent. Reviews now wake only when authorAssociation is OWNER/MEMBER/COLLABORATOR. Review bodies and CI log tails are forwarded inside an <untrusted> block (guardrail banner on a pattern hit, closing tag defanged) with a line saying it is data, not instructions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
git.mergeOptions also takes { projectPath } (GitHub origin check, then
the same cached gh repo view lookup); the merge confirm bar lists the
allowed methods and passes the choice to prMergeAt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13fb3d9729
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "merge", | ||
| String(info.number), | ||
| "--squash", | ||
| ...mergeFlags(opts), |
There was a problem hiding this comment.
Bind auto-merge approval to the signed commit
When a workflow-changing PR is approved while checks are pending, gateCiWorkflowMerge validates only the current local diff and this line then enables a persistent server-side auto-merge. The gh pr merge manual describes --auto as “Automatically merge only after necessary requirements are met”; if this app or the new PR watcher subsequently pushes another commit using the repository owner's credentials, GitHub can merge that new head without rerunning the local gate or obtaining sign-off for its workflow changes. Reject auto-merge for workflow PRs or bind the approval/merge to the inspected head SHA, for example with --match-head-commit.
Useful? React with 👍 / 👎.
| lastReason: reasons.join(", "), | ||
| }, | ||
| }); | ||
| deliver({ threadId, line: lines.join("\n") }); |
There was a problem hiding this comment.
Recheck the watch switch before delivering
If the user clicks “Stop watching” after observePr reads the thread but while one of its gh pr checks or log requests is still running, this unconditional delivery uses the stale thread/prev snapshot and starts an automatic follow-up despite the opt-out. It also overwrites the prWatchState: null written by the toggle, so an off/on re-arm during the same polling window can inherit stale wake counts and fingerprints. Re-read the thread and verify that the watch is still enabled and still refers to the same state immediately before updating and delivering.
Useful? React with 👍 / 👎.
Item D of #1493.
What changed
Generate PR title and body (Create PR dialog). Reuses
commitmsg.js's provider print-mode with the commit list, the diffstat against base, and the PR template. The output passes the outbound secret scan on generate and again on submit.Merge method and auto-merge. Squash, merge or rebase, taken from
gh repo view --jsonand cached for 10 min. The picker is in the thread header and the PR list view, and hidden when the repo allows only one method. Auto-merge (gh pr merge --auto) is offered while checks run, and is covered by the CI-workflow sign-off.Watch-and-wake (
electron/prWatch.js). Rides the existing 5-min PR refresher; no new poller. One follow-up turn is sent on:Limits:
thread_merge's user-approval gate (tested with a real runner).Security, found in review and fixed
authorAssociationis OWNER, MEMBER or COLLABORATOR wake the thread. I confirmedghreturns that field inlatestReviews.<untrusted>block (reusingbannerUntrustedBodyfromissues.js, with closing tags defanged) plus a note that the block isn't an instruction.Verified independently, on main merged with this branch, #1495, #1496 and #1497:
vite buildpasses.memory-sup.test.js, a known load flake, which passes alone (41 of 41) on this tree and on main.Known limits:
gh pr createin a shell) gets a silent baseline, so a check that's already failing at that point doesn't wake.🤖 Generated with Claude Code