-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Open
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Problem
When many cron jobs are deleted and recreated in quick succession (e.g., running
ensure-crons for a workflow with 6+ agents), the gateway's internal scheduler
timer can enter a bad state where it stops executing ALL crons.
After this happens, every cron shows nextRunAtMs in the past but none fire.
The only recovery is restarting the gateway process.
Steps to Reproduce
- Create 6+ cron jobs via the API
- Delete all of them rapidly (sequential API calls, no delay)
- Immediately recreate them
- Observe that no crons fire — all show overdue
nextRunAtMs
Expected Behavior
The scheduler should handle rapid create/delete operations gracefully,
or at minimum recover on the next tick.
Workaround
- Add small delays (50ms) between sequential cron operations
- Add a 200ms settling delay between bulk delete and bulk create
- If frozen, restart the gateway:
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway
Environment
- OpenClaw gateway v2026.2.x
- macOS, launchd-managed gateway process
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity