Repository navigation
feat(status): expose the scheduled review budget and shed reasons publicly - #1737
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:20 AM ET / 13:20 UTC. ClawSweeper reviewWhat this changesExpose scheduled review token balances, lane budgets, throttle pause timestamps, and shed-reason counts through ClawSweeper’s public queue status API. Merge readiness✅ Ready for maintainer review This PR remains useful: current main computes these diagnostics but omits them from the public response. The additive projection is bounded, preserves privacy filtering, and has matching real-runtime evidence; no actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s review queue tracks review capacity and scheduled admission budgets. The dashboard Worker filters those internal statistics into public diagnostics that operators use to understand delayed backfill. flowchart TD
A[Organic review claims] --> C[Review queue accounting]
B[Scheduled review offers] --> C
C --> D[Internal queue statistics]
D --> E[Bounded public projection]
E --> F[Public queue status API]
F --> G[Operator diagnostics]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the existing queue accounting and expose its bounded aggregate diagnostics through the documented observer API. Do we have a high-confidence way to reproduce the issue? Not applicable to a feature request; the recorded before/after runtime scenario directly demonstrates the missing diagnostics and their candidate output. Is this the best way to solve the issue? Yes. Extending the existing closed projection is a narrow solution that avoids changing queue accounting, stored state, or dashboard controls. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f87179433d0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
Since #1710 and #1736 deployed, production has dispatched no scheduled backfill reviews.
scheduled_feed.activestays at 0, and review sheds run at about 72/hour. The public status cannot say why: the scheduled token balance, the lane balances, a GitHub-throttle pause and the shed reasons are all computed by the queue but stripped from/api/exact-review-queue. Tuning without them is guesswork.This exposes those aggregates publicly, so the cause of the starvation can be read from production:
scheduled_feed.burstandscheduled_feed.token_balance. The balance is signed and goes negative while organic debt is outstanding.scheduled_feed.lanes.{hot_intake,normal_backfill}, each withtarget_rate_per_hour,burstandtoken_balance. Both lanes are required, or the block is omitted.scheduled_feed.throttle_observed_atandthrottle_recovery_at, which always appear together. The throttle source label stays omitted.lanes.review.shed_reasons_since_resetwithbackpressure,scheduled_rateandunattributed.Change
dashboard/worker.ts: the public projection passes the values above through explicit allowlists, with bounded integer validation; the signed balance is bounded by ±2,000. Unknown keys and the internal throttle source are dropped, and malformed values are omitted. The projection stays idempotent throughstrictPublicStatusProjection.test/dashboard-worker-status-privacy.test.ts: updated expectations, plus new cases covering negative balances, both-lane completeness, paired throttle timestamps, shed attribution on the review lane only, sentinel stripping, malformed values and idempotence.docs/limits.mdanddocs/public-api.mddocument the fields. A changelog fragment is included.Behavior proof
Committed in
docs/proof/scheduled-feed-observability/(README,run-proof.mjs,result.json). It runs the real dashboard Worker andExactReviewQueueSQLite Durable Object in workerd with a fake clock and a loopback GitHub fixture. Base is7f87179433(origin/main); head is3601dbdd3d, clean. Receipt SHA-256 is35ce0ff12c0a23a3f8ca3ba6ce04ee5f02aa9ee23c77f76238159f1b8be1a826.The scenario admits and claims 40 organic reviews, which charges the budget at claim. It then offers one scheduled normal-backfill item and reads the public route.
scheduled_ratescheduled_ratescheduled_feedafter the claimsburst: 24,token_balance: -8, lanes hot8/ normal16lanes.review.shed_reasons_since_resetscheduled_rate: 1All seven receipt assertions hold, including identical accounting on both builds. Limits: synthetic fixture and credential; reviews are modeled as claims; throttle timestamps are covered by unit tests rather than this run; no production state or GitHub writes.
Validation
pnpm run build:allandpnpm run check:staticpass.node --test test/dashboard-*.test.ts test/exact-review-*.test.ts: 1,169 pass, 0 fail.pnpm run checkruns in CI.OpenClaw Bay
Not affected. Bay reads neither
scheduled_feednor the shed reasons and adds no control. The dashboard's client sanitizer drops negative numbers and unknown fields, so the HTML dashboard is unchanged. The values are available on the JSON route for operators.Risks / rollback
This is a deliberate public-contract expansion: the queue previously exposed only
max_concurrentandactiveunderscheduled_feed. The new values are aggregate budget numbers with no item, repository, actor or credential detail. Rollback is a revert.Review
Codex
/review(autoreview, branch mode againstorigin/main, P0–P1 threshold): clean on headcd337cdb4d, "patch is correct" (0.93).