Skip to content

Handle post-approval merge conflicts without dropping the automation loop#12

Merged
vkehfdl1 merged 2 commits intomainfrom
Feature/#11
Mar 26, 2026
Merged

Handle post-approval merge conflicts without dropping the automation loop#12
vkehfdl1 merged 2 commits intomainfrom
Feature/#11

Conversation

@vkehfdl1
Copy link
Copy Markdown
Contributor

Closes #11

Summary

  • queue a dedicated merge_conflict_resolution stage when a final APPROVE merge fails because dev moved ahead
  • resolve the conflict in a separate OMX session, require a signed PR comment, then rerun final_verdict
  • rerun the verdict with the latest PR metadata so the review context stays anchored to the current PR state
  • merge the latest main changes into this branch so the new flow works with the current omx exec / resume runtime and exact-signature verification model

Verification

  • make check
  • make test
  • make build

…loop

When a final APPROVE verdict hits a GitHub merge conflict, dani now queues a dedicated merge conflict resolution OMX session instead of stopping at the failed merge. That resolver updates the PR branch from the base branch, asks the agent to re-verify the result, and posts a signed PR comment so the normal webhook flow can trigger a fresh final verdict before merging again.\n\nThe implementation keeps the existing queue/signature/webhook design intact by adding only one new stage and reusing the same PR-comment handshake already used for review rounds. GitHub merge conflict detection is isolated in the PyGithub wrapper so the service can treat 409 conflicts as workflow state instead of a generic failure.\n\nConstraint: Must preserve the existing repo-serial queue and signed webhook flow\nConstraint: Merge conflicts must trigger re-verification before the PR is merged\nRejected: Auto-merge again immediately after a failed merge | would skip the required re-review after conflict resolution\nRejected: Resolve conflicts inline inside the webhook handler | would block the handler and bypass the OMX session model\nConfidence: high\nScope-risk: moderate\nReversibility: clean\nDirective: Keep merge-conflict resolution as a signed workflow stage so verdict retries remain event-driven\nTested: uv run pytest -q; uv run ruff check; uv run ty check\nNot-tested: Live GitHub API merge-conflict recovery against a real conflicted PR
Merged current origin/main so this branch picks up the omx exec/resume runtime, dev-sync flow, and exact-signature verification while preserving the post-approval merge-conflict-resolution loop. The service and tests now keep live PR metadata when rerunning final verdict after a conflict, so the resumed review path stays grounded in the current PR state instead of the resolution comment body.

Constraint: origin/main already changed the runtime/session model from tmux madmax launches to omx exec plus resumable issue sessions
Rejected: Rebuild the branch on the stale pre-merge main snapshot | would drop behavior now shipped on main
Confidence: high
Scope-risk: broad
Directive: Keep merge-conflict retry logic aligned with the latest PR snapshot and the exact-signature verification model
Tested: make check; make test; make build
Not-tested: Live GitHub webhook to OMX runtime flow against a real merge-conflict PR
@vkehfdl1 vkehfdl1 merged commit 33e9709 into main Mar 26, 2026
6 checks passed
@vkehfdl1 vkehfdl1 deleted the Feature/#11 branch March 26, 2026 14:55
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 conflict with dev branch after final APPROVE verdict

1 participant