Repository navigation
fix(scheduler): scale per-cycle candidate volume - #958
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 8:22 AM ET / 12:22 UTC. ClawSweeper reviewWhat this changesThis PR reads free review-queue capacity, uses it to size scheduled candidate batches, and distributes fanout candidates by untracked repository backlog while reserving a rotating fairness slice. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open for normal review. The scheduler change is a focused attempt to make the configured review feed use live idle capacity, but it needs after-fix runtime proof before merge and includes a release-owned changelog edit that should be removed from the branch. Priority: P2 Review scores
Verification
How this fits togetherThe scheduled review system queries the Worker’s public queue status and signed open-item inventory, then creates candidate plans for exact item reviews. The workflow scheduler and target fanout planner decide how much idle capacity each repository receives before the Worker enforces final queue admission and rate limits. flowchart LR
Queue[Review queue status] --> Capacity[Free candidate capacity]
Inventory[Open-item inventory] --> Fanout[Repository fanout planner]
Cursor[Fairness cursor] --> Fanout
Capacity --> Fanout
Fanout --> Plans[Candidate review plans]
Plans --> Worker[Exact-review queue]
Worker --> Reviews[Item review workers]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the live-capacity and backlog-aware allocation design if a redacted after-fix scheduled run demonstrates the derived batch size and per-repository allocations, then land it without the release-owned changelog edit. Do we have a high-confidence way to reproduce the issue? Yes, from source with medium confidence: the supplied PR identifies a concrete scheduled path where a one-shard plan was fixed at 50 candidates despite a larger configured review feed. The reported live run is pre-fix evidence, so an after-fix current-head reproduction has not yet been demonstrated. Is this the best way to solve the issue? Yes, provisionally: deriving scheduled plan volume from the Worker-published free review capacity and allocating the remaining fanout by backlog directly addresses the observed fixed-50 bottleneck while retaining a cursor fairness slice. The solution still needs live contract proof before it is the safest merge choice. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e9df3d78066c. 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>
Problem
Coverage burn stalled even though target fanout and its canonical cursor were healthy. Live run 30540950555 showed the
openclaw/openclawplanner finding 5,189 due candidates but selecting exactly 50: scheduled queue feed forcedbatch_size=50andshard_count=1, soselectDueCandidatescould not offer more than 50 in one cycle. Fleet fanout also assigned that same flat batch to every selected repository and treated untracked backlog as a boolean, so cursor fairness spent equal plan jobs on tiny repositories while the 3,084-item dominant gap could not absorb idle capacity.The 120-active per-target Worker limit and the legacy 44/89 broad-review shard limits are not the limiter here. Scheduled review uses one planner shard and turns selected candidates into independent exact-review leases.
Fix
active,pending, andcapacityfrom the public queue probe and exposecapacity - active - pendingas candidate capacity.With 128 slots and a 4.1-minute mean service time, service capacity is about
128 * 60 / 4.1 = 1,873/hour; the configured 600/hour feed is the bottleneck and needs only about 41 concurrent workers. A 3,084-item backlog therefore takes about 5.1 hours at the full feed, or 7.9 hours at the current 65% normal-backfill share (390/hour), rather than weeks.Proof
node --test test/queue-pressure.test.ts test/repair/target-fanout.test.ts test/scheduler-policy.test.ts test/sweep-workflow.test.ts— 123 passed.pnpm run check— build, format, static checks, all lint targets, changed coverage, and the full coverage thresholds passed; final command status was red only because five unrelated macOS containment fixtures unconditionally resolve Linuxcapset(test/repair/process-tree-containment.test.ts).aws; the coordinator returned HTTP 401 before lease creation, including the one permitted debug retry, so no lease ID exists.~/.claude/skills/autoreview/scripts/autoreview --mode local— clean, one pass, correctness 0.96.~/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, one pass, correctness 0.98.No Worker redeploy is required: this changes the workflow planner/fanout code and consumes queue fields the deployed Worker already publishes. Do not merge until the current-head CI and ClawSweeper review gates are ready.