-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Unbounded pagination loop in loadCronJobForShow can hang indefinitely #83856
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Severity: high / Confidence: high / Category: bug
Triage: confirmed-bug
Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18)
Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol (https://x.com/bradmillscan/status/2056377217437909178)
Evidence
src/cli/cron-cli/register.cron-simple.ts:103-123(loadCronJobForShow)Reasoning
loadCronJobForShow uses an unbounded
for (;;)loop with no max-pages guard and no check that nextOffset advances. If the gateway returns a page where nextOffset equals the current offset (misbehaving server or a bug), the loop spins forever issuing identical RPC calls. The sibling function loadCronJobForEditSchedulePatch has CRON_EDIT_LOOKUP_MAX_PAGES=50 guard and an advancement check, but loadCronJobForShow omits both.Reproduction
Start a gateway that returns hasMore=true but nextOffset stays at 0. Run
openclaw cron show <name>. The CLI loops forever.Recommendation
Mirror the guard from loadCronJobForEditSchedulePatch: add a CRON_SHOW_LOOKUP_MAX_PAGES constant, assert nextOffset > offset, and throw when the limit is exceeded.
Why existing tests miss this
No tests are present for this feature group (tests array is empty in the feature manifest).
Suggested regression test
Unit test loadCronJobForShow with a mock callGatewayFromCli that always returns hasMore=true and nextOffset=0; assert it throws rather than looping.
Minimum fix scope
Add a page counter and advancement assertion to loadCronJobForShow, matching the existing pattern in loadCronJobForEditSchedulePatch.
Standardized clawpatch finding submission. Persistent across v2026.5.12 → v2026.5.18 — not resolved by upgrading. Finding ID:
fnd_sig-feat-cli-command-1de66cf308-_e2f98649e2.