Skip to content

fix: repair automerge merge conflicts after merge race#24

Merged
clawsweeper[bot] merged 1 commit intomainfrom
codex/automerge-merge-conflict-repair
May 1, 2026
Merged

fix: repair automerge merge conflicts after merge race#24
clawsweeper[bot] merged 1 commit intomainfrom
codex/automerge-merge-conflict-repair

Conversation

@steipete
Copy link
Copy Markdown
Contributor

@steipete steipete commented May 1, 2026

Summary

  • treat GitHub mergePullRequest merge-conflict failures as repairable automerge rebase work
  • dispatch the existing ClawSweeper repair worker instead of leaving the automerge loop blocked after a merge race
  • update public automerge repair wording so dirty/rebase repairs are not described as failing checks

Validation

  • pnpm run build:repair
  • node --test dist/repair/comment-router-core.test.js
  • pnpm exec oxfmt --check --threads=1 src/repair/comment-router.ts src/repair/comment-router-core.ts src/repair/comment-router-core.test.ts
  • git diff --check
  • pnpm run test:repair
  • pnpm run lint

@steipete
Copy link
Copy Markdown
Contributor Author

steipete commented May 1, 2026

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge label May 1, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

🦞🦞
ClawSweeper automerge is enabled for this PR.

I added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

Draft PRs stay fix-only until GitHub marks them ready for review. A maintainer can pause this with /clawsweeper stop.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

Codex review: passed for ClawSweeper automerge.

What this changes:

The PR adds detection for GitHub merge-conflict failures from the automerge merge command, routes those failures into the existing repair dispatch path, updates the automerge repair response wording, and adds focused helper tests.

Automerge follow-up:

No separate repair-lane job is needed from this review; the PR is already opted into automerge and has no actionable review finding for an automated worker to fix.

Security review:

Security review cleared: No concrete security or supply-chain issue found; the diff changes router logic, response text, and repair-core tests only, with no workflow, dependency, permission, secret, or package-resolution changes.

Review details

Best possible solution:

Land the narrow router change after the normal automerge gates pass, so a merge race that surfaces as a GitHub merge-conflict error triggers the existing repair worker instead of leaving the automerge loop blocked.

Do we have a high-confidence way to reproduce the issue?

Yes. A high-confidence reproduction path is an opted-in automerge PR that passes review and readiness, then becomes conflicted before gh pr merge runs and returns Pull Request has merge conflicts (mergePullRequest); current main records that as a blocked merge.

Is this the best way to solve the issue?

Yes. Classifying only conflict-shaped merge command failures as repair_needed and reusing the existing automerge job/repair dispatch loop is the narrowest maintainable fix; unrelated merge failures such as head SHA mismatch remain blocked.

What I checked:

Likely related people:

  • steipete: Remote commit history for the central comment-router and repair-core files shows repeated recent automerge repair work by this handle, including the merged dirty automerge repair path that this PR extends. (role: recent maintainer and feature-history owner; confidence: high; commits: 1f2ada432610, 06fd342a7bc6, 8d608f9fe535; files: src/repair/comment-router.ts, src/repair/comment-router-core.ts, src/repair/comment-router-core.test.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 112a241eee30.

@clawsweeper clawsweeper Bot merged commit 845e07d into main May 1, 2026
4 checks passed
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

🦞🦞
Thanks, ClawSweeper. ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=ce7e77b97c79f02a99f355a9f5deee2722cdddf5)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-05-01T02:07:33Z

The automerge loop is complete.

@clawsweeper clawsweeper Bot deleted the codex/automerge-merge-conflict-repair branch May 1, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant