Skip to content

[Feature] Skip catchup rerun for cron jobs with lastRunStatus=ok within current schedule window #101988

Description

@hfgwq2dgx8-tech

Problem

When the Gateway restarts, overdue isolated agent-turn cron jobs are rescheduled and rerun, even if they already completed successfully (lastRunStatus=ok) within the current schedule window.

This causes:

  1. Duplicate messages sent to users (e.g., a 09:10 daily reminder fires again after a 11:00 restart)
  2. Users with many cron jobs get flooded with repeated notifications
  3. Confusing user experience — they see the same content multiple times

Expected Behavior

On Gateway restart, when evaluating catchup for an overdue cron job:

  • If lastRunStatus is ok AND lastRunAt falls within the current schedule window (i.e., the job has already run for this schedule tick) → skip the catchup
  • Only rerun jobs that have NOT yet executed for the current tick (e.g., lastRunAt is before the scheduled fire time, or lastRunStatus indicates failure)

Current Behavior

All overdue isolated agent-turn jobs are rescheduled and rerun regardless of whether they already succeeded.

Environment

  • OpenClaw version: 2026.6.11
  • Platform: macOS (arm64)
  • Multiple agents with 5+ cron jobs each

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automation

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions