fix(agents): add two-phase claim protocol to prevent duplicate PR reviews #1326

Merged
freemo merged 1 commits from improvement/pr-reviewer-double-claim-prevention into master 2026-04-03 03:41:30 +00:00

1 Commits

Author SHA1 Message Date
freemo 5eb272b50f fix(agents): add two-phase claim protocol to prevent duplicate PR reviews
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / lint (pull_request) Failing after 19s
CI / helm (pull_request) Successful in 23s
CI / security (pull_request) Failing after 49s
CI / unit_tests (pull_request) Failing after 2m2s
CI / typecheck (pull_request) Successful in 3m57s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / quality (pull_request) Successful in 3m59s
CI / e2e_tests (pull_request) Failing after 16m26s
CI / integration_tests (pull_request) Failing after 22m22s
CI / status-check (pull_request) Failing after 1s
Agent evolver identified a systematic pattern:
- Pattern: Multiple reviewer pool instances claiming the same PR within
  seconds of each other, leading to duplicate reviews and wasted resources.
- Evidence: PRs #1219, #1236, #1247, #1198 were all double-claimed by
  pr-reviewer-5 and pr-reviewer-4 within 28-64 seconds of each other.
  The existing 'check before claiming' protocol has a race window that
  is too small when multiple pools dispatch simultaneously.
- Fix: Added a two-phase claim protocol — after posting a claim comment,
  wait 5 seconds and re-check for competing claims. Ties are broken by
  lexicographic comparison of claim tokens.

This change requires human approval before taking effect.
2026-04-02 19:28:14 +00:00