-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Description
Problem
When a cron job fires and spawns an agent session, the gateway sets runningAtMs
on the cron's state. If the session times out or crashes, runningAtMs is never
cleared. The scheduler then skips the cron on every subsequent tick because it
thinks a session is still running.
The only way to clear it is a disable/enable toggle via the API, which is not
discoverable and requires knowing the internal state model.
Expected Behavior
The gateway should auto-clear runningAtMs when:
- The spawned session ends (completes, times out, or errors)
runningAtMshas been set for longer than the cron'stimeoutSeconds+ a buffer
Observed Behavior
runningAtMs persists indefinitely. Crons silently stop executing with no
error logged. The only visible symptom is that nextRunAtMs stays in the past
and the cron never fires again.
Workaround
Disable/enable the cron via the API:
POST /tools/invoke
{"tool":"cron","args":{"action":"update","id":"<job-id>","patch":{"enabled":false}}}
// wait 100ms
POST /tools/invoke
{"tool":"cron","args":{"action":"update","id":"<job-id>","patch":{"enabled":true}}}
This clears state entirely and resets nextRunAtMs.
Environment
- OpenClaw gateway v2026.2.x
- macOS, launchd-managed gateway process
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels