Conversation
… already merged push_and_open_pr() unconditionally called pulls::create() for the item's branch. GitHub's API only rejects a duplicate while an existing PR is still open -- once it's merged (or manually closed), a second PR against the same branch is perfectly legal, which is exactly how item done re-running on an already-merged item opened a redundant PR (2026-07-25: PR #328 duplicating already-merged #327). Add pulls::find_existing() to check for any PR (open/merged/closed) matching the branch before creating a new one, and use it in push_and_open_pr -- if found, reuse its url instead of opening a duplicate.
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
push_and_open_pr()(src/worktree.rs) unconditionally calledgithub::pulls::create()for the item's branch, with no check for an existing PR. GitHub's API only rejects a duplicate while the existing PR is still open -- once it's merged (or manually closed), a second PR against the same branch is perfectly legal to create.item doneon the same item auto-opened redundant PR fix: doctor reclaim can delete the main/canonical worktree, cascading to all linked worktrees #328 against the same branch (had to be closed manually).pulls::find_existing(client, repo, branch)-- lists PRs withstate=alland finds one whosehead.refmatches the branch -- and calls it frompush_and_open_prbeforecreate. If a match is found (open, merged, or manually closed), reuses its URL instead of opening a duplicate.create-- a rare duplicate is a smaller harm than silently never opening a PR on a transient lookup error.Test plan
cargo test --bin agentflare github::pulls::-- 14 passed, 0 failed (incl. 2 newfind_existingtests)cargo clippy --bin agentflare --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic-- cleancargo fmt-- clean