-
-
Notifications
You must be signed in to change notification settings - Fork 54.3k
Closed
Description
Summary
Cron jobs scheduled to run BEFORE a gateway restart are not executed in catch-up mode. Instead, their nextRunAtMs is recalculated to the next occurrence, effectively skipping that day's run.
Steps to Reproduce
- Have cron jobs scheduled (e.g., daily at 15:00)
- Restart gateway at any time AFTER the scheduled time (e.g., 17:00)
- Observe that jobs scheduled for earlier that day (before restart) never run
- Check job state -
nextRunAtMsjumps to next week/day
Expected Behavior
Jobs should either:
- Run immediately on restart if their scheduled time has passed
- Or at minimum, not skip to the next occurrence without any warning
Actual Behavior
Jobs silently skip their scheduled run. No warning in logs. The scheduler recalculates the next run time based on the new restart time, causing missed executions.
Environment
- OpenClaw version: 2026.2.3-1
- OS: macOS Darwin 24.6.0 (arm64)
- Node: v22.22.0
Impact
Critical for users relying on daily automated tasks (notifications, monitoring, reminders, etc.). Missed runs can go unnoticed until users manually check.
Workaround
Manual heartbeat checks with tracker files to detect and resend missed jobs. But this is error-prone and adds complexity.
Suggested Fix
- On scheduler init, check if any job's last scheduled time was missed
- Either run missed jobs immediately, or log a warning
- Consider adding a
catchUp: trueoption for jobs that should always run if missed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels