Repository navigation
fix(review): jitter throttled retry eligibility to break herd oscillation - #1076
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 8, 2026, 9:59 PM ET / August 9, 2026, 01:59 UTC. ClawSweeper reviewWhat this changesThe PR adds persisted per-item jitter to parked review retries and throttle retry eligibility so review work does not resume in a synchronized cohort. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 8 items remain Keep this PR open: its throttle path can schedule retries before the workflow-provided cooldown, which risks repeated GitHub throttling rather than dispersing it. Priority: P1 Review scores
Verification
How this fits togetherThe exact-review Durable Object queues review jobs and redispatches them through the GitHub workflow. Workflow throttle signals provide a retry deadline, and the queue persists the next eligible time before scheduling its alarm. flowchart LR
A[Review workflow] --> B[Exact-review queue]
B --> C{Throttled?}
C -->|yes| D[Persist retry eligibility]
D --> E[Queue alarm]
E --> F[Redispatch review]
C -->|no| F
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep each workflow-provided throttle deadline as a hard floor, jitter only afterward to spread retries, then add a redacted Docker-backed Crabbox queue trace and state the OpenClaw Bay impact explicitly. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: inject a random function returning zero into the PR's 45-minute throttle case; the changed test demonstrates it persists a 33.75-minute retry time before retry_at. Is this the best way to solve the issue? No. The workflow retry_at is an existing no-earlier-than cooldown; jitter must be applied after that deadline rather than scaling its remaining duration downward. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 22c7ddcc3051. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Ports the durable command-intake pipeline for the "@clawsweeper re-review" command from the abandoned Aug-8 WIP (snapshot 4cad8de on codex/fix-command-review-publication) onto current main. Commands are now durably recorded pre-acknowledgement (intake/watermark/receipt/revision tables, 16-item intake, 15s-15m bounded retries, 30-day receipts), verified against the live comment and head, fenced through verify/enqueue/effects stages, and superseded by full version identity - including equal-timestamp edits (review-caught P1). Acknowledgement and reaction effects are idempotent; router runs that throttle mid-command now recover instead of stranding the command (live instance: openclaw/openclaw#116562 was acked then lost when both router runs throttled). Superseded snapshot pieces were dropped, not ported: retry jitter (#1076/#1077), quota headroom (#1086), retry budgets (#1089), parked reconciliation (#1111), branch guard (#962); dashboard-monolith diffs were reworked around the #1116/#1124/#1132 splits. Proof: committed receipt at this exact head (docs/proof/durable-command-intake/), real Wrangler Worker + DO comparison with durable throttled recovery, GitHub confined to loopback API; full gate 7056 passed / 0 failed; strict check green. Verdict clean (Findings: None) on 9eb957e.
What Problem This Solves
Production telemetry on 2026-08-08 showed the review lane oscillating with a ~45-minute period across every token-routing configuration: successful-review rate swinging 12↔632/hr while
throttle_retrybackoff swung 19↔193. The retry schedule, not pool capacity, drives it — when throttling parks a cohort, the fixed 5/10/20-minute recovery ladder and fixed throttle-redispatch delays make the whole cohort eligible again simultaneously, recreating the herd that re-exhausts the rate-limit bucket.The Fix
Retry-eligibility timestamps for throttled/parked review items get per-item uniform jitter in a 0.75–1.5x band, sampled once at schedule time and persisted as
parkedRecoveryAt. Randomness is injectable through the queue constructor (Math.random in production, seeded in tests). Legacy parked records honor their original fixed schedule for one final cycle. Coordination waits, ordinary failure retries, and the publication lane's separate (already-spread) retry machinery are untouched, as are token routing, feed rate, and leases.Proof
pnpm test:unit1,964 pass / 0 fail;pnpm run checkgreen.Deploys with the dashboard workflow on merge. Expected effect: flattened backoff peaks and shallower duty-cycle troughs at unchanged feed rate — measurable against the telemetry baseline recorded on 2026-08-08.