Skip to content

Commit 62f1636

Browse files
committed
fix(review): reduce hot fanout cadence
1 parent e10a866 commit 62f1636

3 files changed

Lines changed: 78 additions & 11 deletions

File tree

‎.github/workflows/sweep.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ClawSweeper
33
run-name: >-
44
${{
55
(github.event_name == 'schedule' &&
6-
(github.event.schedule == '4/5 * * * *' ||
6+
(github.event.schedule == '4/20 * * * *' ||
77
github.event.schedule == '41/10 * * * *' ||
88
github.event.schedule == '37 */6 * * *')) &&
99
'Fan out ClawSweeper targets' ||
@@ -201,11 +201,11 @@ on:
201201
- cron: "48 * * * *"
202202
- cron: "8,23,38,53 * * * *"
203203
- cron: "6,21,36,51 * * * *"
204-
# Hot fanout every 5 minutes instead of 15: with the dynamic plan batch
205-
# (#958) a cycle fills free capacity, but 48 concurrent reviews drain the
206-
# queue in ~5 minutes and it then idles two thirds of every 15-minute gap
207-
# (observed: 48 active immediately post-cycle, 3 active before the next).
208-
- cron: "4/5 * * * *"
204+
# Temporary containment: run hot fleet fanout every 20 minutes while trusted
205+
# ClawSweeper-owned activity can feed unchanged items back into hot review.
206+
# Restore a faster cadence only after that loop is fixed and quota telemetry
207+
# confirms the higher demand is safe.
208+
- cron: "4/20 * * * *"
209209
# Normal backfill every 10 minutes instead of hourly, for the same reason.
210210
- cron: "41/10 * * * *"
211211
- cron: "37 */6 * * *"
@@ -239,7 +239,7 @@ env:
239239
OPENROUTER_API_KEY: ${{ vars.CLAWSWEEPER_RUNNER == 'openclaw' && secrets.OPENROUTER_API_KEY || '' }}
240240

241241
concurrency:
242-
group: ${{ (github.event_name == 'schedule' && (github.event.schedule == '4/5 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *')) && format('clawsweeper-target-fanout-{0}', github.event.schedule || github.run_id) || github.event_name == 'repository_dispatch' && format('clawsweeper-event-{0}-{1}', github.event.client_payload.target_repo || 'openclaw/openclaw', github.event.client_payload.queue_lease_id || github.event.client_payload.item_number || github.run_id) || format('{0}-{1}', (github.event_name == 'schedule' && github.event.schedule == '13 * * * *') && 'clawsweeper-failed-review-retry' || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true' && github.event.inputs.apply_sync_comments_only == 'true') && (github.event.inputs.apply_item_numbers == '__cursor__' && github.event.inputs.apply_kind == 'all' && github.event.inputs.apply_comment_sync_min_age_days == '0' && github.event.inputs.apply_limit == '40' && github.event.inputs.apply_min_age_days == '0' && github.event.inputs.apply_min_age_minutes == '' && (github.event.inputs.apply_close_reasons == '' || github.event.inputs.apply_close_reasons == (vars.CLAWSWEEPER_AUTO_CLOSE_REASONS || 'all')) && github.event.inputs.apply_stale_min_age_days == '60' && github.event.inputs.apply_close_delay_ms == '2000' && github.event.inputs.apply_checkpoint_size == '40' && 'clawsweeper-comment-sync' || format('clawsweeper-comment-sync-{0}', github.run_id)) || (github.event_name == 'schedule' && github.event.schedule == '6,21,36,51 * * * *') && 'clawsweeper-comment-sync' || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') && format('clawsweeper-apply-{0}', github.run_id) || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *')) && 'clawsweeper-apply' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.item_number != '' || github.event.inputs.item_numbers != '')) && format('clawsweeper-intake-exact-{0}', github.event.inputs.item_number || github.event.inputs.item_numbers) || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing != 'true') && format('clawsweeper-operator-dispatch-{0}', github.run_id) || ((github.event_name == 'workflow_dispatch' && github.event.inputs.hot_intake == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '*/5 * * * *' || github.event.schedule == '2/5 * * * *'))) && 'clawsweeper-intake-v2' || ((github.event_name == 'workflow_dispatch' && github.event.inputs.audit_dashboard == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '7 */6 * * *' || github.event.schedule == '12 */6 * * *' || github.event.schedule == '17 */6 * * *'))) && 'clawsweeper-audit' || 'clawsweeper-review', github.event.inputs.target_repo || github.event.client_payload.target_repo || ((github.event.schedule == '17 */6 * * *') && 'openclaw/clawsweeper' || ((github.event.schedule == '2/5 * * * *' || github.event.schedule == '22 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '12 */6 * * *') && 'openclaw/clawhub' || 'openclaw/openclaw'))) }}
242+
group: ${{ (github.event_name == 'schedule' && (github.event.schedule == '4/20 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *')) && format('clawsweeper-target-fanout-{0}', github.event.schedule || github.run_id) || github.event_name == 'repository_dispatch' && format('clawsweeper-event-{0}-{1}', github.event.client_payload.target_repo || 'openclaw/openclaw', github.event.client_payload.queue_lease_id || github.event.client_payload.item_number || github.run_id) || format('{0}-{1}', (github.event_name == 'schedule' && github.event.schedule == '13 * * * *') && 'clawsweeper-failed-review-retry' || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true' && github.event.inputs.apply_sync_comments_only == 'true') && (github.event.inputs.apply_item_numbers == '__cursor__' && github.event.inputs.apply_kind == 'all' && github.event.inputs.apply_comment_sync_min_age_days == '0' && github.event.inputs.apply_limit == '40' && github.event.inputs.apply_min_age_days == '0' && github.event.inputs.apply_min_age_minutes == '' && (github.event.inputs.apply_close_reasons == '' || github.event.inputs.apply_close_reasons == (vars.CLAWSWEEPER_AUTO_CLOSE_REASONS || 'all')) && github.event.inputs.apply_stale_min_age_days == '60' && github.event.inputs.apply_close_delay_ms == '2000' && github.event.inputs.apply_checkpoint_size == '40' && 'clawsweeper-comment-sync' || format('clawsweeper-comment-sync-{0}', github.run_id)) || (github.event_name == 'schedule' && github.event.schedule == '6,21,36,51 * * * *') && 'clawsweeper-comment-sync' || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing == 'true') && format('clawsweeper-apply-{0}', github.run_id) || (github.event_name == 'schedule' && (github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *')) && 'clawsweeper-apply' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.item_number != '' || github.event.inputs.item_numbers != '')) && format('clawsweeper-intake-exact-{0}', github.event.inputs.item_number || github.event.inputs.item_numbers) || (github.event_name == 'workflow_dispatch' && github.event.inputs.apply_existing != 'true') && format('clawsweeper-operator-dispatch-{0}', github.run_id) || ((github.event_name == 'workflow_dispatch' && github.event.inputs.hot_intake == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '*/5 * * * *' || github.event.schedule == '2/5 * * * *'))) && 'clawsweeper-intake-v2' || ((github.event_name == 'workflow_dispatch' && github.event.inputs.audit_dashboard == 'true') || (github.event_name == 'schedule' && (github.event.schedule == '7 */6 * * *' || github.event.schedule == '12 */6 * * *' || github.event.schedule == '17 */6 * * *'))) && 'clawsweeper-audit' || 'clawsweeper-review', github.event.inputs.target_repo || github.event.client_payload.target_repo || ((github.event.schedule == '17 */6 * * *') && 'openclaw/clawsweeper' || ((github.event.schedule == '2/5 * * * *' || github.event.schedule == '22 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '12 */6 * * *') && 'openclaw/clawhub' || 'openclaw/openclaw'))) }}
243243
cancel-in-progress: false
244244

245245
jobs:
@@ -3416,7 +3416,7 @@ jobs:
34163416

34173417
target-fanout:
34183418
name: Fan out target repository sweeps
3419-
if: ${{ github.event_name == 'schedule' && (github.event.schedule == '4/5 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *') }}
3419+
if: ${{ github.event_name == 'schedule' && (github.event.schedule == '4/20 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *') }}
34203420
runs-on: ubuntu-latest
34213421
timeout-minutes: 30
34223422
permissions:
@@ -3496,7 +3496,7 @@ jobs:
34963496

34973497
plan:
34983498
name: Plan review candidates
3499-
if: ${{ (github.event_name != 'repository_dispatch' || github.event.action == 'clawsweeper_target_sweep') && !((github.event_name == 'workflow_dispatch' && (github.event.inputs.apply_existing == 'true' || github.event.inputs.audit_dashboard == 'true')) || (github.event_name == 'schedule' && ((github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *') || (github.event.schedule == '7 */6 * * *' || github.event.schedule == '12 */6 * * *' || github.event.schedule == '17 */6 * * *') || (github.event.schedule == '4/5 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *') || github.event.schedule == '13 * * * *'))) && !(github.event_name == 'schedule' && (github.event.schedule == '2/5 * * * *' || github.event.schedule == '22 * * * *') && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }}
3499+
if: ${{ (github.event_name != 'repository_dispatch' || github.event.action == 'clawsweeper_target_sweep') && !((github.event_name == 'workflow_dispatch' && (github.event.inputs.apply_existing == 'true' || github.event.inputs.audit_dashboard == 'true')) || (github.event_name == 'schedule' && ((github.event.schedule == '3 * * * *' || github.event.schedule == '18 * * * *' || github.event.schedule == '33 * * * *' || github.event.schedule == '48 * * * *' || github.event.schedule == '8,23,38,53 * * * *' || github.event.schedule == '6,21,36,51 * * * *') || (github.event.schedule == '7 */6 * * *' || github.event.schedule == '12 */6 * * *' || github.event.schedule == '17 */6 * * *') || (github.event.schedule == '4/20 * * * *' || github.event.schedule == '41/10 * * * *' || github.event.schedule == '37 */6 * * *') || github.event.schedule == '13 * * * *'))) && !(github.event_name == 'schedule' && (github.event.schedule == '2/5 * * * *' || github.event.schedule == '22 * * * *') && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') && !(github.event_name == 'repository_dispatch' && github.event.client_payload.target_repo == 'openclaw/clawhub' && vars.CLAWSWEEPER_ENABLE_CLAWHUB != '1') }}
35003500
runs-on: ubuntu-latest
35013501
timeout-minutes: 30
35023502
concurrency:

‎docs/scheduler.md‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,48 @@ Target fanout dispatches review batches through `repository_dispatch` so each
140140
selected repository can carry its inventory default branch without consuming
141141
manual workflow inputs. Scheduled fanout uses:
142142

143-
- hot intake: `4/5 * * * *`, 20 target repositories per cursor step
143+
- hot intake: `4/20 * * * *`, 20 target repositories per cursor step. This
144+
20-minute cadence is temporary containment for scheduled self-feedback;
145+
restore a faster cadence only after the loop is fixed and quota telemetry
146+
confirms it is safe. [PR #959](https://github.com/openclaw/clawsweeper/pull/959)
147+
intentionally moved this selector from every 15 minutes to every 5 minutes;
148+
this containment adjusts that current cadence without attributing the
149+
self-feedback defect to PR #959.
144150
- normal review: `41/10 * * * *`, 12 target repositories per cursor step
145151
- audit: `37 */6 * * *`, 12 target repositories per cursor step
146152

153+
[PR #1007](https://github.com/openclaw/clawsweeper/pull/1007) is directly
154+
relevant but was insufficient for the observed `openclaw/libterminal#41`
155+
path. It was intended to recognize structurally proven ClawSweeper-owned
156+
comment or label activity while keeping timestamp-only or incomplete evidence
157+
eligible for conservative structural verification. Its mainline commit
158+
`b83f2983da` predates and is an ancestor of the ClawSweeper head used by
159+
[run 31336140651](https://github.com/openclaw/clawsweeper/actions/runs/31336140651).
160+
That later scheduled run still reported one structural-cache check, zero
161+
structural-cache hits, and one full hydration before publishing the durable
162+
comment again. The evidence therefore shows that #1007 did not suppress this
163+
specific execution path; it does not prove whether the receipt was missing,
164+
incomplete, stale, or bypassed at admission, and it does not make #1007 the
165+
cause of the loop. The temporary cadence reduction bounds demand while that
166+
remaining path is corrected.
167+
168+
There is no ClawSweeper PR #1032: the relevant record is
169+
[issue #1032](https://github.com/openclaw/clawsweeper/issues/1032), which
170+
reported a post-#1007 review storm and was closed by
171+
[PR #1036](https://github.com/openclaw/clawsweeper/pull/1036). PR #1036 changed
172+
the exact-review workflow and review-preparation boundary to forward
173+
`sourceAction` and classify `scheduled_hot_intake` and
174+
`scheduled_normal_backfill` as automatic, making them eligible for receipt and
175+
cache reuse instead of treating queued item numbers as explicit reviews. Its
176+
merge commit `138ee2f96e` predates and is an ancestor of run 31336140651. The
177+
run log contains `--review-source-action scheduled_hot_intake`, so #1036 was
178+
effective at the classification boundary and was not bypassed there. The same
179+
run nevertheless recorded zero structural-cache hits and one full hydration,
180+
making #1036 a partial but insufficient mitigation for this case: it opened the
181+
cache-eligible path, while the available structural receipt still failed to
182+
match. This evidence does not attribute the remaining receipt mismatch to
183+
#1036 itself.
184+
147185
Each mode's cursor lives in the authenticated ExactReviewQueue Durable Object,
148186
not generated Git state. Reads and writes use a monotonic revision. If the
149187
canonical cursor endpoint is unavailable, fanout warns and continues dispatch
@@ -275,7 +313,8 @@ Current defaults:
275313
- review admission and pressure are computed independently from publication;
276314
top-level queue health describes reviews while `lanes.publication` retains
277315
publication backlog, retry, DLQ, and health telemetry
278-
- fleet fanout: 20 hot targets every 15 minutes and 12 normal targets hourly;
316+
- fleet fanout: 20 hot targets every 20 minutes as temporary self-feedback
317+
containment, and 12 normal targets every 10 minutes;
279318
each target cycle can offer up to 50 due items to the shared admission budget
280319
- manual broad hot intake: up to 44 shards when quiet
281320
- manual normal backfill: defaults to 89 shards, batch size 3, and scans up to

‎test/sweep-workflow.test.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5264,6 +5264,34 @@ test("target fanout uses the canonical cursor store without a git publisher", ()
52645264
assert.doesNotMatch(workflow, /Publish fanout cursor/);
52655265
});
52665266

5267+
test("hot fleet fanout runs every 20 minutes without changing other schedules", () => {
5268+
const workflowText = readText(".github/workflows/sweep.yml");
5269+
const workflow = YAML.parse(workflowText) as {
5270+
on: { schedule: Array<{ cron: string }> };
5271+
};
5272+
const schedules = workflow.on.schedule.map(({ cron }) => cron);
5273+
const fanoutBlock = workflowText.slice(
5274+
workflowText.indexOf("\n target-fanout:"),
5275+
workflowText.indexOf("\n plan:"),
5276+
);
5277+
5278+
assert.ok(schedules.includes("4/20 * * * *"));
5279+
assert.ok(!schedules.includes("4/5 * * * *"));
5280+
assert.ok(schedules.includes("*/5 * * * *"));
5281+
assert.ok(schedules.includes("2/5 * * * *"));
5282+
assert.ok(schedules.includes("41/10 * * * *"));
5283+
assert.ok(schedules.includes("37 */6 * * *"));
5284+
assert.match(fanoutBlock, /github\.event\.schedule == '4\/20 \* \* \* \*'/);
5285+
assert.match(
5286+
fanoutBlock,
5287+
/FANOUT_MODE: \$\{\{ github\.event\.schedule == '41\/10 \* \* \* \*' && 'normal-review' \|\| \(github\.event\.schedule == '37 \*\/6 \* \* \*' && 'audit' \|\| 'hot-intake'\) \}\}/,
5288+
);
5289+
assert.match(
5290+
fanoutBlock,
5291+
/FANOUT_LIMIT: \$\{\{ github\.event\.schedule == '41\/10 \* \* \* \*' && '12' \|\| \(github\.event\.schedule == '37 \*\/6 \* \* \*' && '12' \|\| '20'\) \}\}/,
5292+
);
5293+
});
5294+
52675295
test("review git info follows checked-out target branch", () => {
52685296
const source = readText("src/clawsweeper-review-runtime.ts");
52695297

0 commit comments

Comments
 (0)