Repository navigation
fix: unthrottle exact review admission - #953
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 5:18 AM ET / 09:18 UTC. ClawSweeper reviewWhat this changesThis PR makes exact-review admission, pressure, and backpressure review-lane-specific, keeps publication health separate, and records shed telemetry by backpressure versus scheduled-rate pacing. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open for maintainer review. The review/publication decoupling is targeted and well-covered by focused tests, but the patch also removes published queue-pressure reason values and redefines top-level queue fields without a compatibility transition; it also needs after-fix Worker behavior proof beyond tests and checks. Likely related people: steipete (medium confidence). Priority: P1 Review scores
Verification
How this fits togetherThe exact-review queue receives scheduled, recovery, command, and publication work, then admits review jobs to bounded worker capacity and exposes queue health through the dashboard API. Publication performs a separate durable handoff path, while scheduler producers consume the queue API to decide how much review work to enqueue. flowchart LR
Producers[Scheduled and recovery producers] --> Queue[Exact-review durable queue]
Queue --> Admission[Review admission and claim limits]
Admission --> Workers[Review workers]
Queue --> Status[Queue status API]
Publication[Publication lane] --> PublicationHealth[Publication health telemetry]
Status --> Producers
PublicationHealth --> Status
Decision needed
Why: The internal decoupling is a clear repair, but the acceptable external API migration policy cannot be derived from the implementation alone. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep review admission independent from publication, but preserve the existing public queue contract through an additive or versioned transition, then redeploy the Worker and attach redacted after-fix evidence showing publication backlog no longer delays review admission. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was independently established in this review. The reported failure mechanism is source-reproducible from the proposed review-only soft-limit and terminal-publication scheduling paths, and the PR includes focused regression tests. Is this the best way to solve the issue? Unclear: separating internal review admission from publication is the narrow repair, but changing the already-published queue API semantics in place is not yet shown to be the best compatibility path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2e6bacee3813. 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
|
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Summary
backpressureandscheduled_rate, retaining pre-migration history asunattributedRoot causes
The production status surface combined two lanes that do not share admission capacity. At 2026-07-30 09:12 UTC, the public API reported 20 top-level pending items and named
openclaw/openclaw#114855@publish:30522572065:1as the oldest handoff key, whilelanes.review.pendingwas only 1 andlanes.publication.pendingwas 19. Likewise,ready_pendingandadmissible_pendingwere aggregate fields even though publication batching intentionally excludes publication rows from the legacy dispatcher. That made an independently-owned publication backlog look like review head-of-line blocking.There were two real coupling bugs behind that misleading surface:
EXACT_REVIEW_PENDING_SOFT_LIMITand shed new scheduled/recovery reviews while review capacity was empty.Publication health was not derived from
state_writeracquisitions or commits. The zero-commit state-writer sample after #936 was unrelated. Health was degraded by historical open dead letters and over-age publication rows; even an otherwise idle lane consulted dead letters before returning idle. Dead letters already have their own health signal, so current publication health now describes current pending/active/parked flow only. Publication health remains visible, but it no longer overrides review pressure or throttles review producers.Finally,
shed_since_resetcombined true pending-limit backpressure with intentional 200/hour token pacing. The total 1,119 could not be attributed after the fact. New cumulative and 15-minute counters identifybackpressureversusscheduled_rate; the already-persisted total is exposed asunattributedafter migration.Behavior after this change
lanes.publicationAt the configured 200 reviews/hour and measured 4.1-minute mean service time, expected steady-state concurrency is about
200 * 4.1 / 60 = 13.7. The 50-item burst plus organic events can temporarily run higher; the production API already showed 23 active reviews later in the investigation. This change removes false publication coupling without changing the spend target or lowering the 128 claim ceiling.Proof
node --test test/exact-review-health.test.ts test/queue-pressure.test.ts test/dashboard-worker.test.ts test/exact-review-publication-batches.test.ts— 342 passedpnpm run build:dashboard— passedpnpm run build— passedpnpm run format:check— passedpnpm run lint— passedpnpm run check— static/build/lint/changed coverage passed; full suite had 2,778 passes and only the five documented unrelated macOS failures inprocess-tree-containment.test.tsbecause Apple libc does not export Linuxcapset/Users/steipete/.claude/skills/autoreview/scripts/autoreview --mode local— TruffleHog clean; one complete pass; no accepted/actionable findings; correctness 0.97/Users/steipete/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main— TruffleHog clean; one complete pass; no accepted/actionable findings; correctness 0.98Rollout
A Worker redeploy is required. Until then, the production API will continue to expose aggregate top-level queue fields and
publication_degradedreview pressure, and it will not expose shed reasons.This PR does not deploy the Worker, run live apply/close commands, or merge itself.