fix(queue): absorb item-lifecycle and throttle stalls without spending review-failure budget - #968
Conversation
…g review-failure budget
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 1:24 PM ET / 17:24 UTC. ClawSweeper reviewWhat this changesThe PR makes exact-review reservations treat closed items as superseded no-ops, defer GitHub-throttled reservations for retry, and lowers the exact-review feed rate from 600 to 450 per hour. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open: it addresses a concrete review-queue reliability problem and current Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s exact-review queue reserves a lease before Codex reviews an item and publishes the result. The reservation command and sweep workflow classify item lifecycle changes and GitHub API responses so the durable queue can either continue, skip stale work, or retry later without consuming review-failure budget. flowchart LR
A[Exact-review queue] --> B[Reserve lease]
B --> C{Item and GitHub state}
C -->|Item no longer open| D[Superseded no-op]
C -->|GitHub throttled| E[Held retry]
C -->|Lease granted| F[Codex review]
D --> G[Successful queue completion]
E --> H[Durable redelivery]
F --> I[Publish review result]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Remove the release-owned changelog entries, retain the narrow command and workflow regression coverage, and add redacted live evidence that closed items complete as superseded while a throttled reservation becomes a durable held retry after the Worker redeploy. Do we have a high-confidence way to reproduce the issue? Yes in source terms: the supplied failure modes map directly to the reservation command’s non-open-item error path and the workflow’s reservation failure path. The PR also adds focused fake- Is this the best way to solve the issue? Mostly yes: structured superseded output for stale closed items and a held retry for throttling are narrower than charging these ordinary queue conditions to review-failure budget. The release-owned changelog edit is not part of the correct solution and should be removed. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3dc70e67f287. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
After #966, two failure classes remained in the review lane (38 failures in the 16:13–17:13Z hour):
Cannot reserve a review lease for #N: state is closed.— the item closed between enqueue and review (now common again since the apply lane resumed closing). The stale entry failed ascodex_or_content_failureand burned review-failure budget (sample runs 30564729361, 30563527242).gh: API rate limit exceeded for installation ID 122230863 (HTTP 403)— the resumed apply + comment-sync lanes plus ~400 reviews/hour saturated the shared App installation token; reservations retried ~13 minutes in-process, then failed the run (sample runs 30562882522, 30562788053).Fix
reserve-review-leasecompletes closed/locked items as{"status":"superseded","reason":"item_not_open"}— the workflow already maps superseded reservations to successful no-op completions.rate limit exceeded|secondary rate limit|HTTP 429) into{"status":"held","retryAt":"+20min"}so the durable queue redelivers after the window instead of counting a failure.Proof
gh): red on pre-fix code (command exits 1), green with the fix; asserts superseded JSON and no lease comment.