Skip to content

Commit 23a3fc8

Browse files
committed
fix(ci): cap ClawSweeper worker bursts
1 parent 855cffa commit 23a3fc8

16 files changed

Lines changed: 87 additions & 85 deletions

‎.github/workflows/sweep.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ on:
7474
shard_count:
7575
description: "Parallel shards (capped by config/automation-limits.json)"
7676
required: false
77-
default: "89"
77+
default: "44"
7878
item_number:
7979
description: "Optional single issue/PR number to review"
8080
required: false

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ checkpoint, and status-only commits are intentionally omitted.
2424
- Removed unconditional ffmpeg provisioning from review startup so optional media proof cannot block exact-review leases; unavailable media tools remain per-item evidence failures.
2525
- Prevented contributor-branch repairs and changelog-free repair artifacts from adding release-owned changelog entries, keeping contributor credit and release-note context in PR bodies or commit history instead.
2626
- Added an explicit trusted ephemeral-runner fallback for repair planning when the host cannot start Codex's Linux read-only sandbox.
27-
- Replaced runner-side exact-review capacity waiting and self-retries with a durable 32-slot Worker queue that coalesces item deliveries, leases executors before checkout, and reclaims abandoned leases.
27+
- Replaced runner-side exact-review capacity waiting and self-retries with a durable 8-slot Worker queue that coalesces item deliveries, leases executors before checkout, and reclaims abandoned leases.
2828
- Stopped all issue and pull request label mutations, including human and third-party bot labels, from directly triggering exact reviews.
2929

3030
## 0.3.0 - 2026-06-15

‎README.md‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ source ~/.profile
546546
corepack enable
547547
pnpm install
548548
pnpm run build
549-
pnpm run plan -- --target-repo openclaw/openclaw --batch-size 5 --shard-count 89 --max-pages 250 --codex-model internal --codex-reasoning-effort high
549+
pnpm run plan -- --target-repo openclaw/openclaw --batch-size 5 --shard-count 44 --max-pages 250 --codex-model internal --codex-reasoning-effort high
550550
pnpm run review -- --target-repo openclaw/openclaw --target-dir ../openclaw --batch-size 5 --max-pages 250 --artifact-dir artifacts/reviews --codex-model internal --codex-reasoning-effort high --codex-timeout-ms 600000
551551
pnpm run apply-artifacts -- --target-repo openclaw/openclaw --artifact-dir artifacts/reviews --skip-dashboard
552552
pnpm run audit -- --target-repo openclaw/openclaw --max-pages 250 --sample-limit 25 --update-dashboard
@@ -603,31 +603,32 @@ default, subject to the selected repository profile; pass `target_repo`,
603603
`apply_kind=issue`, or `apply_kind=pull_request` to narrow a manual run.
604604

605605
Scheduled runs cover the configured product profiles. `openclaw/openclaw` runs
606-
normal backfill every 5 minutes with up to 64 review shards when the system is
606+
normal backfill every 5 minutes with up to 24 review shards when the system is
607607
quiet; `openclaw/clawhub` runs on offset review/apply/audit crons so its reports
608608
live under `records/openclaw-clawhub/` without colliding with default repo
609609
records. `openclaw/clawsweeper` has a scheduled read-only audit row and is
610610
available for manual and event self-review smoke tests. Broad hot-intake sweeps
611-
cap scheduled fan-out at 44 one-item shards per run when quiet; exact event
612-
reviews still use one shard. Normal review, hot intake, and commit review are
611+
cap scheduled fan-out at 22 one-item shards per run when quiet; manual normal
612+
backfill can use up to 44 shards, while exact event reviews still use one shard.
613+
Normal review, hot intake, and commit review are
613614
background lanes, so they shrink automatically while repair or exact-item work
614615
is active. Throughput defaults live in
615616
[docs/limits.md](docs/limits.md) and `config/automation-limits.json`.
616617

617618
### Worker Budget
618619

619620
ClawSweeper has one main capacity knob:
620-
`config/automation-limits.json` -> `workers.max`. The current value is `128`.
621-
Lane limits are derived from that number: normal review defaults to 89 shards
622-
for manual/backstop runs, scheduled normal review gets up to 64 after reserves,
623-
hot intake up to 44 shards, commit review 6 commits per page, and existing
624-
repair/issue implementation lanes use 40% of `workers.max`, currently 51 live
621+
`config/automation-limits.json` -> `workers.max`. The current value is `64`.
622+
Lane limits are derived from that number: normal review defaults to 44 shards
623+
for manual/backstop runs, scheduled normal review gets up to 24 after reserves,
624+
hot intake up to 22 shards, commit review 3 commits per page, and existing
625+
repair/issue implementation lanes use 40% of `workers.max`, currently 25 live
625626
workers. Imported gitcrawl cluster repair allows 2 live workers by default.
626627
Exact-item review, repair, and issue implementation are priority work; normal
627628
review, hot intake, and commit review are background work and automatically
628629
yield when priority work is active. Exact-item runs use a durable Worker queue
629-
that coalesces item deliveries and leases at most 32 concurrent reviews. Other
630-
lanes retain the existing global 128-worker scheduling model.
630+
that coalesces item deliveries and leases at most 8 concurrent reviews. Other
631+
lanes retain the existing global 64-worker scheduling model.
631632
Use `workers.max` first when turning total Codex usage up or down; use
632633
`lanes.repair.cluster_max_live_runs` to tune the imported legacy cluster-repair
633634
lane separately, and individual environment overrides only for temporary

‎config/automation-limits.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"workers": {
3-
"max": 128,
4-
"reserve_for_interactive": 32,
5-
"expansion_reserve": 32,
6-
"minimum_background": 16
3+
"max": 64,
4+
"reserve_for_interactive": 16,
5+
"expansion_reserve": 24,
6+
"minimum_background": 8
77
},
88
"lanes": {
99
"exact_review": {
10-
"max_concurrent": 32
10+
"max_concurrent": 8
1111
},
1212
"assist": {
1313
"max": 10

‎dashboard/worker.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const CLOSED_STATS_PAGE_LIMIT = 10;
7171
const DEFAULT_CLAWSWEEPER_BOT_LOGINS = ["clawsweeper[bot]", "openclaw-clawsweeper[bot]"];
7272
const GITHUB_TIMEOUT_MS = 4500;
7373
const DEFAULT_STALE_QUEUED_WORKFLOW_MS = 6 * 60 * 60 * 1000;
74-
const DEFAULT_EXACT_REVIEW_QUEUE_MAX_CONCURRENT = 40;
74+
const DEFAULT_EXACT_REVIEW_QUEUE_MAX_CONCURRENT = 8;
7575
const DEFAULT_EXACT_REVIEW_DISPATCH_LEASE_MS = 10 * 60 * 1000;
7676
const DEFAULT_EXACT_REVIEW_EXECUTION_LEASE_MS = 130 * 60 * 1000;
7777
const DEFAULT_EXACT_REVIEW_RETRY_MS = 30_000;
@@ -1585,7 +1585,7 @@ async function statusSnapshot(env) {
15851585
.split(",")
15861586
.map((value) => value.trim())
15871587
.filter(Boolean);
1588-
const budget = numberFrom(env.WORKER_BUDGET, 128);
1588+
const budget = numberFrom(env.WORKER_BUDGET, 64);
15891589
const [runs, completedRuns, filteredActiveRuns] = await Promise.all([
15901590
githubJson(env, `/repos/${repo}/actions/runs?per_page=100`).catch((error) => {
15911591
errors.push(`workflow runs: ${error.message}`);

‎dashboard/wrangler.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CLAWSWEEPER_REPO = "openclaw/clawsweeper"
2929
CLAWSWEEPER_APP_CLIENT_ID = "Iv23liOECG0slfuhz093"
3030
CLAWSWEEPER_CRABFLEET_URL = "https://crabfleet.openclaw.ai"
3131
TARGET_REPOS = "openclaw/openclaw,openclaw/clawhub,openclaw/clawsweeper,openclaw/fs-safe"
32-
WORKER_BUDGET = "128"
32+
WORKER_BUDGET = "64"
3333
WORKER_DETAIL_RUN_LIMIT = "128"
3434
WORKER_JOB_FETCH_CONCURRENCY = "12"
3535
WORKER_JOB_CACHE_TTL_SECONDS = "60"
@@ -39,6 +39,6 @@ AUTOMERGE_CACHE_TTL_SECONDS = "300"
3939
RECENT_CLOSED_CACHE_TTL_SECONDS = "300"
4040
CACHE_TTL_SECONDS = "20"
4141
INCLUDE_CI_STATUS = "1"
42-
EXACT_REVIEW_QUEUE_MAX_CONCURRENT = "40"
42+
EXACT_REVIEW_QUEUE_MAX_CONCURRENT = "8"
4343
EXACT_REVIEW_DISPATCH_LEASE_MS = "600000"
4444
EXACT_REVIEW_EXECUTION_LEASE_MS = "7800000"

‎docs/commit-dispatcher.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ CLAWSWEEPER_COMMIT_REVIEW_SETTLE_SECONDS=60
107107
Use `0` for settled manual backfills or a larger value during GitHub event
108108
lag incidents.
109109

110-
Commit review is a background lane. It defaults to 6 commits per workflow page
110+
Commit review is a background lane. It defaults to 3 commits per workflow page
111111
when the system is quiet, but the receiver asks the central worker scheduler for
112112
capacity before each page. Active repair, exact-item review, and sweep work can
113113
lower the page size so commit review does not consume capacity needed by
@@ -116,10 +116,10 @@ maintainer-visible work. The checked-in default comes from
116116
`openclaw/clawsweeper` only when the org has enough rate-limit headroom:
117117

118118
```text
119-
CLAWSWEEPER_COMMIT_REVIEW_PAGE_SIZE=6
119+
CLAWSWEEPER_COMMIT_REVIEW_PAGE_SIZE=3
120120
```
121121

122-
The receiver clamps this between 1 and 128. Setting the variable bypasses the
122+
The receiver clamps this between 1 and 64. Setting the variable bypasses the
123123
dynamic default for that run; leave it unset when the central scheduler should
124124
decide. Large push ranges continue in later workflow pages.
125125

‎docs/commit-sweeper.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ by SHA/range rather than detaching the whole target repository at the commit.
8989

9090
## Scaling
9191

92-
Commit Sweeper is background work. It defaults to 6 commits per workflow page
92+
Commit Sweeper is background work. It defaults to 3 commits per workflow page
9393
when the system is quiet, but the receiver asks the central worker scheduler for
9494
the effective page size before dispatching the matrix. Active repair,
9595
exact-item review, and sweep work can lower commit review to keep capacity
9696
available for maintainer-visible work. The checked-in default lives in
9797
`config/automation-limits.json`. The receiver clamps
98-
`CLAWSWEEPER_COMMIT_REVIEW_PAGE_SIZE` between 1 and 128, then pages large ranges:
98+
`CLAWSWEEPER_COMMIT_REVIEW_PAGE_SIZE` between 1 and 64, then pages large ranges:
9999

100100
- select up to the configured page size
101101
- classify them cheaply

‎docs/limits.md‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,40 @@ The mental model:
3333

3434
| Name | Current | Meaning |
3535
| --- | ---: | --- |
36-
| `workers.max` | 128 | Maximum global Codex worker budget used to derive lane limits. |
37-
| `workers.reserve_for_interactive` | 32 | Worker slots background lanes leave open for exact/manual/urgent work. |
38-
| `workers.expansion_reserve` | 32 | Extra slots background lanes leave open for independently planned matrix expansion. |
39-
| `workers.minimum_background` | 16 | Target floor for background progress when enough global capacity is available. |
40-
| `lanes.exact_review.max_concurrent` | 32 | Maximum concurrent exact-item review workflow runs admitted to Codex. |
36+
| `workers.max` | 64 | Maximum global Codex worker budget used to derive lane limits. |
37+
| `workers.reserve_for_interactive` | 16 | Worker slots background lanes leave open for exact/manual/urgent work. |
38+
| `workers.expansion_reserve` | 24 | Extra slots background lanes leave open for independently planned matrix expansion. |
39+
| `workers.minimum_background` | 8 | Target floor for background progress when enough global capacity is available. |
40+
| `lanes.exact_review.max_concurrent` | 8 | Maximum concurrent exact-item review workflow runs admitted to Codex. |
4141
| `lanes.assist.max` | 10 | Maximum concurrent lightweight assist jobs. |
4242
| `lanes.repair.cluster_max_live_runs` | 2 | Default live repair workflow cap for imported gitcrawl cluster dispatches. |
4343

4444
## Derived Limits
4545

4646
Review, commit, and existing repair limits are intentionally percentages of
4747
`workers.max`; imported cluster repair has its own lane knob. With
48-
`workers.max = 128`, normal review can use 89 workers, hot intake can use 44,
49-
commit review can use 6 commits per page, existing repair lanes dispatch 51
48+
`workers.max = 64`, normal review can use 44 workers, hot intake can use 22,
49+
commit review can use 3 commits per page, existing repair lanes dispatch 25
5050
live workers by default, and imported cluster repair dispatches two live workers
5151
by default.
5252

5353
| Name | Current | Meaning |
5454
| --- | ---: | --- |
55-
| `exact_review.concurrent_max` | 32 | Exact-item review admission cap, clamped to `workers.max`. |
55+
| `exact_review.concurrent_max` | 8 | Exact-item review admission cap, clamped to `workers.max`. |
5656
| `assist.default` | 10 | Maintainer assist job cap. |
57-
| `review_shards.normal_default` | 89 | Quiet-system normal review shard ceiling. |
58-
| `review_shards.normal_active_floor` | 38 | Minimum active normal review shards to keep queued for `openclaw/openclaw`. |
59-
| `review_shards.hot_intake_default` | 44 | Quiet-system broad hot-intake review shard ceiling. |
57+
| `review_shards.normal_default` | 44 | Quiet-system normal review shard ceiling. |
58+
| `review_shards.normal_active_floor` | 19 | Minimum active normal review shards to keep queued for `openclaw/openclaw`. |
59+
| `review_shards.hot_intake_default` | 22 | Quiet-system broad hot-intake review shard ceiling. |
6060
| `review_shards.exact_item_default` | 1 | Exact-item hot-intake shard count. |
61-
| `review_shards.hard_cap` | 128 | Maximum accepted review shard count. |
62-
| `commit_review.page_size_default` | 6 | Commits selected per commit-review page. |
63-
| `commit_review.page_size_hard_cap` | 128 | Maximum commit-review page size. |
64-
| `repair_live_runs.default` | 51 | Default live repair workflow run cap for manual dispatch/requeue/self-heal. |
65-
| `repair_live_runs.hard_cap` | 128 | Absolute live repair run cap accepted by explicit CLI/env overrides with this config. |
66-
| `repair_live_runs.automerge_default` | 51 | Live repair run cap for automerge comment-router dispatches. |
67-
| `repair_live_runs.issue_implementation_default` | 51 | Live repair run cap for issue-to-PR implementation intake. |
61+
| `review_shards.hard_cap` | 64 | Maximum accepted review shard count. |
62+
| `commit_review.page_size_default` | 3 | Commits selected per commit-review page. |
63+
| `commit_review.page_size_hard_cap` | 64 | Maximum commit-review page size. |
64+
| `repair_live_runs.default` | 25 | Default live repair workflow run cap for manual dispatch/requeue/self-heal. |
65+
| `repair_live_runs.hard_cap` | 64 | Absolute live repair run cap accepted by explicit CLI/env overrides with this config. |
66+
| `repair_live_runs.automerge_default` | 25 | Live repair run cap for automerge comment-router dispatches. |
67+
| `repair_live_runs.issue_implementation_default` | 25 | Live repair run cap for issue-to-PR implementation intake. |
6868
| `repair_live_runs.cluster_default` | 2 | Live repair run cap for imported gitcrawl cluster dispatches. |
69-
| `issue_implementation.dispatches_per_sweep_default` | 5 | Maximum implementation intake jobs queued from one review publish run. |
69+
| `issue_implementation.dispatches_per_sweep_default` | 2 | Maximum implementation intake jobs queued from one review publish run. |
7070

7171
Formula summary:
7272

@@ -114,7 +114,7 @@ Exact-item webhooks are admitted by the dashboard Worker's durable
114114
deliveries by repository and item number, so a new webhook updates the latest
115115
desired review rather than consuming another runner. Only
116116
`EXACT_REVIEW_QUEUE_MAX_CONCURRENT` leased items may dispatch an exact-review
117-
workflow at once; the default is 32.
117+
workflow at once; the default is 8.
118118

119119
Each dispatched workflow claims its opaque lease before checkout. Duplicate
120120
dispatches and stale workflows cannot claim the same lease, and a completion
@@ -124,13 +124,13 @@ keeps capacity waiting and retry state out of GitHub Actions runners.
124124

125125
Examples with the current config:
126126

127-
- Quiet system: manual normal review can request 89 shards; scheduled normal
128-
review gets 64 after reserving 32 slots for exact/manual/urgent work and 32
127+
- Quiet system: manual normal review can request 44 shards; scheduled normal
128+
review gets 24 after reserving 16 slots for exact/manual/urgent work and 24
129129
slots for in-flight matrix expansion.
130-
- 4 active repair workers and 68 active background workers: normal review gets
131-
1 because `128 - 32 interactive reserve - 32 expansion reserve - 4 priority
132-
- 68 background = -8`, and enabled background lanes keep one slow-progress worker.
133-
- 88 active priority workers: commit review gets 1, so commit review yields but
130+
- 4 active repair workers and 20 active background workers: normal review gets
131+
1 because `64 - 16 interactive reserve - 24 expansion reserve - 4 priority
132+
- 20 background = 0`, and enabled background lanes keep one slow-progress worker.
133+
- 48 active priority workers: commit review gets 1, so commit review yields but
134134
does not fully stall.
135135

136136
Use these commands to inspect the effective values from a checkout:

‎docs/live-dashboard.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ The Worker fetches job details only for the bounded active-run set, limits that
130130
GitHub fanout to 12 concurrent requests, and caches each run's jobs for 60
131131
seconds. It separately samples 20 recent completed worker runs with ten-way
132132
fanout and caches error/recovery telemetry for 120 seconds. This bounds
133-
telemetry pressure without reducing the 128-worker fleet budget. Worker details
134-
paginate up to 300 jobs per workflow run so 128-shard runs remain fully visible,
133+
telemetry pressure without reducing the 64-worker fleet budget. Worker details
134+
paginate up to 300 jobs per workflow run so 44-shard runs remain fully visible,
135135
then finish before optional pipeline CI and historical
136136
enrichment begin, so those secondary lookups do not compete with active worker
137137
telemetry. If GitHub job telemetry is unavailable, the API and UI retain the

0 commit comments

Comments
 (0)