Skip to content

fix(worktrees): do not refuse ordinary merges as CI inspect failures - #761

Merged
currentbits merged 1 commit into
mainfrom
coder/merge-ci-inspect-refused-false-positive-760
Aug 29, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/merge-ci-inspect-refused-false-positive-760

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Summary

Closes #760.

Test plan

  • node --test electron/test/blast-radius.test.js (8 pass)
  • Merge a thread whose project checkout is detached / has no local main
  • Merge a thread whose worktree dir was pruned but the branch still exists
  • A real CI workflow-file change still requires Sign off

Made with Cursor

…760)

The blast-radius gate fail-closed on git diff main...HEAD when only origin/main existed, and on a missing worktree directory. Both showed a Sign off banner that could not unblock the merge.

Co-authored-by: Cursor <[email protected]>
@currentbits
currentbits merged commit 1953915 into main Aug 29, 2026
3 of 6 checks passed
@currentbits
currentbits deleted the coder/merge-ci-inspect-refused-false-positive-760 branch August 29, 2026 06:39

@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: 449a8fff75

ℹ️ 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/worktrees.js
add(name);
if (!name.startsWith("refs/") && !name.includes("://")) {
add(`refs/heads/${name}`);
add(`origin/${name}`);

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 Prefer the exact remote ref over DWIM shorthand

When the local base branch is absent and the repository has both refs/remotes/origin/main and a tag named origin/main, this candidate succeeds first but resolves to the tag because Git gives refs/tags/* precedence over refs/remotes/* for ambiguous names (gitrevisions: specifying revisions). Consequently, listChangedPaths can compare against an attacker-controlled or stale tag and return no CI paths—for example, when the workflow matches that tag but differs from the real remote base—allowing mergeWorktree or mergePr to bypass the required workflow sign-off. Probe or return refs/remotes/origin/${name} directly instead of accepting the ambiguous shorthand.

Useful? React with 👍 / 👎.

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.

Merge refuses with 'Could not inspect the diff for CI workflow files' on ordinary merges

1 participant