fix(queue): complete head-drifted exact reviews as superseded no-ops - #966
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 12:19 PM ET / 16:19 UTC. ClawSweeper reviewWhat this changesThe PR makes an exact-review lease reservation whose queued source head no longer matches the live pull-request head return a superseded no-op result instead of failing the review queue item. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep open: the queue-handling change is narrowly scoped and has focused regression coverage, but this PR modifies the release-owned changelog and provides only mock/test evidence rather than an after-fix workflow run. Likely related people: Priority: P2 Review scores
Verification
How this fits togetherExact-review events enter ClawSweeper's durable review queue and reserve a lease before the workflow generates a Codex review. The reservation step compares the queued authority head with GitHub's current pull-request head, then either reserves work or reports that a newer push owns the review. flowchart TD
A[Queued exact review] --> B[Lease reservation]
B --> C[Compare queued and live PR heads]
C -->|Heads match| D[Reserve review lease]
C -->|Head moved| E[Superseded no-op]
E --> F[Successful queue completion]
G[Newer PR push] --> A
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the focused reservation-command and regression-test change, remove the release-owned Do we have a high-confidence way to reproduce the issue? Yes, from source: the focused test models a queued exact-review authority whose source head differs from the live pull-request head and demonstrates the intended command boundary. The review evidence does not include an independently captured real workflow run. Is this the best way to solve the issue? No: returning a superseded result is the narrowest apparent queue fix, but the submitted path is not yet the best merge-ready solution because it includes a release-owned changelog edit and lacks real after-fix workflow proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against df0e4d70165e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Problem
~9% of review runs still fail post-#962 with
Exact-review queue authority source head does not match the current pull request.(sample runs 30558755321, 30558626014). The queued exact-head entry is simply stale — the PR received a newer push, which enqueued its own exact-head event. The reservation command threw, the run failed ascodex_or_content_failure, and the item burned one of its eight review-failure park attempts for what is ordinary drift.Fix
reserve-review-leasenow reports{"status":"superseded","reason":"source_head_drift"}on head drift instead of throwing. The workflow already maps asupersededreservation to a successful no-op with a clean queue completion (Export exact review generation result→ outcome=success); the newer push's own event (backstopped by the scheduled sweep) owns reviewing the current head. No lease comment is posted on this path.Proof
ghserves a live PR head different fromEXACT_REVIEW_SOURCE_HEAD_SHA; asserts exit 0, superseded JSON, and that no lease comment is created. Red on pre-fix code (command exits 1), green with the fix.test/command.test.tssuite passes.