Skip to content

Merge niceties: strip agent co-authors, Open revert PR (#1531) - #1537

Merged
currentbits merged 2 commits into
mainfrom
coder/1531-merge-niceties-9b2c87
Oct 9, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/1531-merge-niceties-9b2c87

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Part of #1531.

Strip agent co-authors (setting stripAgentCoauthors, off by default; in the Git settings pane)

  • When this is on, a squash merge through gh pr merge drops Co-authored-by: trailers that name an AI agent: [bot] accounts, noreply or agent-named mailboxes at agent vendors, and agent-named noreply addresses. Human co-authors are kept.
  • When stripping removes something, the squash body is rebuilt from the PR's commit list. That replaces whatever default squash message the repo is configured to use.
  • The local thread merge commit message never contained trailers, so it is unchanged.

Open revert PR

  • A thread whose PR has merged gets this button in the Git tab.
  • Clicking it reverts the PR in a throwaway worktree on the latest origin/<base>, using -m 1 for true merge commits. It then pushes revert-pr-<N>, opens Revert "<title>" and opens the new PR's URL.
  • Any failure, such as a revert conflict, removes the temp worktree, the local branch and any pushed branch.

Tests are in electron/test/coauthors.test.js and electron/test/revert-pr.test.js (temp repo, gh stubbed), plus test/environmentCards.test.tsx.

Note: this PR and the Misc PR (custom model prices) both add a setting on the same lines of electron/test/budget-spend.test.js, so whichever lands second needs a small rebase.

🤖 Generated with Claude Code

Willem and others added 2 commits October 9, 2026 13:24
…rge (#1531)

New setting stripAgentCoauthors (default off, Settings > Git). When on,
squash merges via gh (thread PR merge and the PR workspace merge) pass a
--body rebuilt from the PR commits with Co-authored-by lines that name an
AI agent removed; human co-authors stay. Matching lives in the pure
electron/coauthors.js helper. The local thread merge already commits with
a fixed -m message, so it never carried trailers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Agents panel shows "Open revert PR" once a thread PR is MERGED.
git:prRevert (electron/revertPr.js) branches revert-pr-N off the latest
origin/<base> in a temp worktree, reverts the merge commit (-m 1 for a true
merge, plain revert for a squash/rebase commit, picked by parent count),
pushes, and opens Revert "<title>" via gh pr create, referencing the
original PR. On any failure (conflict, push, gh) it removes the temp
worktree, the local branch and the pushed branch, and reports the reason
in-band. The user checkout is never touched. The new PR URL opens in the
browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T12:07:44.389851Z 951844b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 951844b824

ℹ️ 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".

Comment thread electron/revertPr.js
const isMerge = parents.stdout.trim().split(/\s+/).length > 2;
const reverted = await gitTryAsync(
wt,
isMerge ? ["revert", "--no-edit", "-m", "1", sha] : ["revert", "--no-edit", sha],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Revert every commit from a rebase merge

When a PR containing multiple commits was merged with GitHub's rebase method, mergeCommit.oid identifies only the resulting tip commit, while rebase merging adds every PR commit to the base individually (GitHub documentation). This git revert therefore undoes only the last rebased commit, yet opens a PR claiming to revert the entire PR and leaves all earlier changes in place. Revert the full PR commit set or its combined patch instead of only this SHA.

Useful? React with 👍 / 👎.

Comment thread electron/revertPr.js
Comment on lines +74 to +75
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "solenta-revert-"));
const wt = path.join(tmp, "wt");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Create the temporary worktree inside WSL

On Windows when project.path is a supported WSL UNC path, gitTryAsync launches Git inside the distro, but this worktree path comes from the Windows host's os.tmpdir(). The resolver in electron/worktrees-git.js only translates arguments that are themselves WSL UNC paths, so git worktree add receives a Windows path that is not the same location inside WSL and subsequent commands cannot operate on the created worktree. Allocate the temporary directory within the distro and retain a corresponding UNC path, as the existing WSL worktree helpers do.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit d056b78 into main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant