Skip to content

Cron jobs stop spawning sessions after disable/re-enable cycle (2026.2.3) #10119

@MrShnook

Description

@MrShnook

Bug Report

Version: OpenClaw 2026.2.3-1
OS: Linux 6.17.0-1006-gcp (x64), Node v22.22.0

Summary

After disabling and re-enabling isolated cron jobs, nextRunAtMs continues to advance on each scheduled tick but no sessions are spawned. The jobs appear healthy in cron list but silently fail to execute.

Reproduction Steps

  1. Have working isolated agentTurn cron jobs (confirmed working before disable)
  2. Disable jobs via cron update (enabled: false)
  3. Wait for one or more scheduled ticks to pass
  4. Re-enable jobs via cron update (enabled: true)
  5. Observe: nextRunAtMs advances on each tick, lastRunAtMs does NOT update, no sessions spawn

Expected Behavior

Re-enabled jobs should spawn sessions on their next scheduled tick.

Actual Behavior

Jobs enter a ghost state — the scheduler advances nextRunAtMs but never calls onTimer to spawn sessions. The state.running guard in the cron timer handler (around gateway-cli-D_8miTjF.js:3440-3470) may be stuck in a truthy state from the disable cycle.

Workaround

Manually sending a message to the cron session key unsticks the job permanently:

sessions_send(sessionKey="agent:<name>:cron:<jobId>", message="<heartbeat prompt>")

After this manual kick, subsequent scheduled ticks fire correctly — the fix is persistent, not one-shot.

Suspected Root Cause

The 2026.2.3 changelog includes significant cron-related changes that likely interact:

  • Hard migration of isolated jobs to announce/none delivery modes
  • Dropped legacy fields: post-to-main, payload delivery types, atMs inputs
  • Default delivery changed to announce for isolated agentTurn jobs
  • Tool suppression during announce delivery phase
  • Auto-deletion of one-shot jobs after success

The migration may leave stale internal state (possibly state.running = true or missing delivery config) that prevents the timer handler from proceeding after a disable/enable cycle.

Timeline

  • Jobs disabled at ~03:00 UTC, 2026-02-06
  • Jobs re-enabled at ~03:30 UTC — nextRunAtMs advancing but no sessions
  • Manual kick via sessions_send at ~04:00 UTC — job unstuck
  • Subsequent scheduled ticks (04:05, 04:34 UTC) fired automatically ✅

Environment Details

  • Jobs are sessionTarget: "isolated" with payload.kind: "agentTurn"
  • Delivery mode: announce
  • Schedule: cron kind with tz: "America/Phoenix"
  • Multiple jobs affected (tested with 2 independent agent crons)

Affected Job Configs

{
  "schedule": { "kind": "cron", "expr": "3,18,33,48 * * * *", "tz": "America/Phoenix" },
  "sessionTarget": "isolated",
  "payload": { "kind": "agentTurn", "message": "..." },
  "delivery": { "mode": "announce" }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions