feat: add require-no-conflicts-before-stop workflow policy#176
Conversation
New Stop-event policy that denies the agent from stopping until the current branch merges cleanly with the base branch. Two-layer detection: 1. Local `git merge-tree --write-tree --name-only origin/<base> HEAD` — deny with the conflicted file list on exit 1. 2. GitHub `gh pr view --json mergeable` — deny on CONFLICTING (catches stale-origin cases). On UNKNOWN, deny and instruct the agent to wait ~10s and re-check before retrying Stop, preventing a false negative while GitHub recomputes mergeability. Fail-open on missing cwd, detached HEAD, on base branch, missing origin/<base>, no commits ahead, no gh CLI, or no PR for the branch — matching the pattern of the sibling require-*-before-stop policies. Opt-in (defaultEnabled: false), baseBranch param defaults to "main". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 12 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro 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 |
Replaces the #TBD placeholder with the actual PR number (#176). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
require-no-conflicts-before-stopthat denies the agent from stopping until the current branch merges cleanly with the base branch.git merge-tree --write-tree --name-only origin/<base> HEAD. Exit 1 denies with the specific conflicted file list.gh pr view --json mergeable. Catches conflicts that a stale localorigin/<base>would miss (e.g. someone landed a conflicting PR onmainsince the last fetch).CONFLICTINGdenies;UNKNOWNalso denies and instructs the agent to wait ~10s and re-check before retrying Stop — preventing a false negative while GitHub recomputes mergeability.origin/<base>, no commits ahead, noghCLI, or no PR — consistent with the siblingrequire-*-before-stoppolicies.defaultEnabled: false);baseBranchparam defaults to"main".Test plan
baseBranch, and fail-open scenarios — all 980 tests passbun run lint— clean (no new warnings)bun --bun tsc --noEmit— cleanoven/bun:latestwithnpm install -g /pkg.tgz)bun run test:e2e🤖 Generated with Claude Code