feat(review): opt-in, comment-driven merge-conflict resolution#61
Conversation
Comment "@relay fix conflicts" on a PR to have the review agent resolve its merge conflicts. Cloud merges the base branch into the working tree, the harness resolves the conflict markers (preserving both sides, never weakening tests or flipping safety defaults), verifies the merged tree CI-deep, and cloud finalizes and pushes the merge commit. Conflicts that need human judgment are left in place under "## Unresolved conflicts" so a risky half-merge is never pushed. Distinct from cloud's deterministic conflictAutofix (clean rebase only). Gated to authorized commenters (PR author / APPROVERS / REVIEW_AUTHORS, never a bot) and the strict "@relay (fix|resolve) conflicts" directive. Inert until cloud ships the merge-in-tree + finalize-push flow, tracked in AgentWorkforce/cloud#2149: with no base-merge, the harness finds no markers and changes nothing. - review/persona.ts: declare capabilities.conflictResolve - review/agent.ts: issue_comment.created trigger, directive parse, commander auth, readPr from issue_comment payloads, resolveConflicts, conflictResolveHarnessPrompt - review/README.md + tests/review-agent.test.mjs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
More reviews will be available in 14 minutes and 26 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Findings
Addressed comments
Verification
PR metadata check showed the PR is open and mergeable, and the current head status returned |
Reconcile #61 (opt-in comment-driven merge-conflict resolution) with #73 (VFS-based PR-state machinery): - review/agent.ts: union github triggers (kept issues.labeled + slack from #73, added issue_comment.created from #61); kept #73's readPrReviewState/loadCheckSummary/loadReviews/rollupFromCheckSummary/ deriveReviewDecision and #61's resolveConflicts/matchesConflictDirective/ isAuthorizedConflictCommander; merged readPr to handle both issue_comment and issues.labeled payloads (single superset issue type). - tests/review-agent.test.mjs: unioned imports so both PRs' cases coexist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I left the working tree unchanged (no edits were needed). Here is my review. PR #61 Review —
|
PR Review: factory state-name defaults + canary scheduling toolingI reviewed the full diff ( Summary of changes
Verification
Safety analysis of the resolver change (key item)The new
FindingsNo blocking issues. No mechanical/lint fixes were needed (the diff is clean: imports, formatting, and spelling are all fine). I made no file edits — the working tree is unchanged (only the pre-existing untracked One minor observation (non-blocking, no change made): Addressed comments
Advisory Notes
The PR is coherent, the change is fail-safe, and the full CI pipeline passes. The only non-green signal is a load-dependent flake in an unrelated lifecycle test, which is not introduced by this PR. Since a required check can flake red on CI (and I cannot confirm CI is green from here), I am not printing READY — a human should confirm the CI run is green (re-running the flaky test if needed) before merge. |
|
I have one observation worth noting about authorization logic. Let me re-verify the Let me do a final check: confirm no conflict between The review is complete. Here are my findings. SummaryPR #61 adds an opt-in, comment-driven merge-conflict resolution capability to the
I made no file edits. No mechanical issues (lint/format/spelling/import-order) were found, and every substantive aspect either checks out or is appropriately gated. What I verified about the changes
Addressed comments
Advisory Notes
The PR is mechanically clean, fully verified locally, and the only open item (fail-open authorization default) is an intentional design convention requiring human judgment rather than a defect. I cannot confirm GitHub's mergeable status or that all required CI checks have completed and passed from this sandbox, so I am not printing the ready sentinel. |
What
Adds opt-in, comment-driven merge-conflict resolution to the review agent (
pr-reviewer). Comment@relay fix conflictson a PR and the agent resolves its merge conflicts.The flow: cloud merges the base branch into the working tree → the harness resolves the conflict markers (preserving both sides' intent, never weakening tests or flipping safety defaults) → verifies the merged tree against the repo's CI command → cloud finalizes and pushes the merge commit. A conflict that needs human judgment is left in place and reported under
## Unresolved conflictsso a risky half-merge is never pushed.This is distinct from cloud's existing deterministic
conflictAutofix(clean rebase only; aborts on real textual conflicts).Why
Requested: ability to comment at the review agent and have it fix merge conflicts, opt-in.
Changes (this repo)
review/persona.ts— declarescapabilities.conflictResolve.review/agent.ts—issue_comment.createdtrigger; strict directive parser (matchesConflictDirective); commander authorization (isAuthorizedConflictCommander— never a bot; gated on PR author /APPROVERS/REVIEW_AUTHORS);readPrextended to read a PR from anissue_commentpayload;resolveConflicts;conflictResolveHarnessPrompt.review/README.md— documents the feature.tests/review-agent.test.mjs— coverage for the matcher, commander auth,issue_commentreadPr, and prompt invariants.Dormant until cloud ships
This is inert until the cloud-side merge-in-tree + finalize-push flow lands. With no base-merge, the harness finds no markers and changes nothing.
Tracked in AgentWorkforce/cloud#2149.
Testing
npm test— typecheck clean, all 91 tests pass.🤖 Generated with Claude Code
Summary by cubic
Add opt-in, comment-driven merge-conflict resolution to the review agent. Comment
@relay fix conflictson a PR to resolve merge markers, verify with CI, and have cloud finalize the merge; conflicts needing judgment are left for humans.issue_comment.createdonly on a strict@relayfix/resolve conflicts directive; casual mentions are ignored.APPROVERS/REVIEW_AUTHORS; never bots.issue_comment: only treat comments on PRs (issue.pull_requestpresent), prefer the PR opener for author gating, ignore plain issues.conflictResolvein the persona; updatesreview/README.md; adds tests for directive matching, commander auth, PR parsing, and prompt invariants.Written for commit 369e021. Summary will update on new commits.