Review-first conflict resolution: AI-resolved merges should land on the head branch for review, not inside the merge commit#210
○Openccantynz opened this issue 24d ago
ccantynzAuthorcommented 24d ago
Follow-up to PR #5455, which fixed the copy but deliberately not the behavior.
Today mergeWithAutoResolve (called from all three merge paths via the shared chain) resolves conflicts by sending each conflicted file to Claude and committing the AI's output directly into the merge commit on the default branch. The person clicking Merge reviewed the PR's diff — but what actually lands includes AI-written resolution content nobody ever saw. That contradicts the platform's own review-first principle ("every AI change is a reviewable PR"), and a subtly wrong resolution (the prompt literally asks the model to guess which side "preserves correctness") ships straight to main.
Proposed redesign:
On merge with conflicts, run the resolver as today — but commit the resolved merge preview onto the head branch (or a resolve/<head> branch) instead of updating base.
Comment on the PR: "Conflicts resolved by AI in commit <sha> — review the resolution, then merge again (now clean)."
The second merge is a plain fast-forward of reviewed content. Zero unreviewed AI code on main, one extra click only when conflicts existed.
Repo-settings toggle for the old direct behavior (auto_resolve_direct: true) for owners who explicitly prefer speed over review — default OFF.
Also worth adding while in there: cap resolution attempts by file count/size (a 50-file conflict is a rebase job, not an AI job), and record an ai_cost_events row per resolution (currently unmetered).
c comment · e edit title · x close/reopen · ? shortcuts
Follow-up to PR #5455, which fixed the copy but deliberately not the behavior.
Today
mergeWithAutoResolve(called from all three merge paths via the shared chain) resolves conflicts by sending each conflicted file to Claude and committing the AI's output directly into the merge commit on the default branch. The person clicking Merge reviewed the PR's diff — but what actually lands includes AI-written resolution content nobody ever saw. That contradicts the platform's own review-first principle ("every AI change is a reviewable PR"), and a subtly wrong resolution (the prompt literally asks the model to guess which side "preserves correctness") ships straight to main.Proposed redesign:
resolve/<head>branch) instead of updating base.<sha>— review the resolution, then merge again (now clean)."auto_resolve_direct: true) for owners who explicitly prefer speed over review — default OFF.Also worth adding while in there: cap resolution attempts by file count/size (a 50-file conflict is a rebase job, not an AI job), and record an
ai_cost_eventsrow per resolution (currently unmetered).