openclaw - 💡(How to fix) Fix Cron tasks fail due to rate-limit cooldown timeout in 5.20+

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Typical error pattern: ``` [scheduled] job=xxx triggered Rate-limited — ready in ~7s (credential cooldown detected, waiting) ... (7s later) Error: task timed out OR task failed ```

Root Cause

  1. 5.20 introduced more precise `getSoonestCooldownExpiry` auth profile tracking
  2. When a cron triggers, it detects the credential is in cooldown, logs `"Rate-limited — ready in ~7s"` and waits
  3. However, cron task timeout may be too short — after the 7s cooldown wait, the task may already be considered timed-out or failed
  4. 5.22 lazy-load optimization may worsen this: slower gateway startup → delayed channel handshake → cron tasks arrive later, compounding the timeout issue
RAW_BUFFERClick to expand / collapse

Problem

After upgrading to OpenClaw 5.20+, cron tasks are failing with rate-limit related errors. The issue appears to be a regression in how the rate-limit cooldown is handled for cron-triggered tasks.

Analysis

  1. 5.20 introduced more precise `getSoonestCooldownExpiry` auth profile tracking
  2. When a cron triggers, it detects the credential is in cooldown, logs `"Rate-limited — ready in ~7s"` and waits
  3. However, cron task timeout may be too short — after the 7s cooldown wait, the task may already be considered timed-out or failed
  4. 5.22 lazy-load optimization may worsen this: slower gateway startup → delayed channel handshake → cron tasks arrive later, compounding the timeout issue

Expected Behavior

Cron tasks should either:

  • Be queued until the cooldown expires, then execute normally
  • Respect a configurable timeout that accounts for cooldown waiting
  • Not silently fail without clear error messaging

Version

  • OpenClaw: 5.20+ (confirmed in 5.20, 5.22)
  • Affects: All cron jobs that use rate-limited API credentials (e.g., Feishu API, model providers)

Logs

Typical error pattern: ``` [scheduled] job=xxx triggered Rate-limited — ready in ~7s (credential cooldown detected, waiting) ... (7s later) Error: task timed out OR task failed ```

Suggested Fix

Options:

  1. Increase default cron timeout to account for cooldown duration
  2. Pre-warm credentials before cron execution to avoid cooldown
  3. Add retry logic with cooldown-aware backoff for cron tasks
  4. Log clearer warnings when a task is skipped due to cooldown timeout

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Cron tasks fail due to rate-limit cooldown timeout in 5.20+