-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Closed
Description
Description
Cron jobs configured with sessionTarget: main, wakeMode: next-heartbeat, and payload.kind: systemEvent stop firing after the gateway has been running for an extended period (overnight).
Steps to Reproduce
-
Configure multiple cron jobs with:
sessionTarget: "main"wakeMode: "next-heartbeat"payload: { kind: "systemEvent", text: "..." }- Various schedules (e.g.,
0 8 * * *,30 8 * * *, etc.) - Timezone configured (e.g.,
tz: "America/Montevideo")
-
Let the gateway run overnight without restart
-
Check cron status the next morning
Expected Behavior
Cron jobs should fire at their scheduled times and inject systemEvents into the main session.
Actual Behavior
- Crons show
lastRunAtMsfrom the previous day nextRunAtMsshows times that have already passed- Manual
cron runreturns{ ran: false, reason: "not-due" }even whennextRunAtMsis in the past - Gateway restart fixes the issue (recalculates schedules correctly)
Environment
- OpenClaw version: 2026.2.3-1 (d84eb46)
- OS: Linux (WSL2)
- Node: v24.11.1
- Timezone: America/Montevideo (GMT-3)
Workaround
Migrated crons to sessionTarget: isolated with payload.kind: agentTurn, which appears more reliable.
Additional Context
The scheduler seems to not recalculate nextRunAtMs correctly after midnight, possibly a timezone-related issue or a bug in the cron evaluation loop.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels