-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
[Bug]: Cron Job Spin Loop Bug Report #17821
Description
Summary
Cron jobs with sessionTarget: "isolated" and payload.kind: "agentTurn" enter an infinite spin loop when triggered. The nextRunAtMs is not advanced past the current time after execution, causing the scheduler to immediately re-trigger the same job hundreds of times within 1 second.
Steps to reproduce
Two cron jobs configured:
"Daily Briefing (Noon)" - cron expr: "0 13 * * *"
"Daily Briefing (Evening)" - cron expr: "0 19 * * *"
Both set to sessionTarget: "isolated", model: "google/gemini-3-flash-preview", delivery.mode: "announce".
Expected behavior
After a cron job fires at 13:00, nextRunAtMs should advance to the next day's 13:00 (i.e., +86400000ms).
Actual behavior
At the scheduled trigger time (e.g., 1771045200000 for 13:00 CST on Feb 15, 2026):
Job triggers and completes in ~0ms with status: "ok"
nextRunAtMs is set back to the same timestamp (1771045200000) instead of advancing 24h
Scheduler sees nextRunAtMs <= now, re-triggers immediately
Loop repeats 100+ times per second for ~1 second until it eventually breaks out
Final real execution runs (~76s) but reports "error": "cron announce delivery failed"
Evidence from cron runs output (Noon job, showing timestamps in ms):
1771045200014 → finished ok, durationMs: 7, nextRunAtMs: 1771045200000 ← SAME!
1771045200022 → finished ok, durationMs: 0, nextRunAtMs: 1771045200000 ← SAME!
1771045200027 → finished ok, durationMs: 0, nextRunAtMs: 1771045200000 ← SAME!
... (100+ entries, all within 1 second)
The Evening job shows identical behavior at 1771066800000.
OpenClaw version
OpenClaw version: 2026.2.13
Operating system
OS: macOS (Darwin 21.6.0 x64)
Install method
nom global
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
The final execution that actually generates content reports "cron announce delivery failed" despite successfully producing output. The announce/delivery to Telegram fails silently.