openclaw - 💡(How to fix) Fix Bug: systemEvent+sessionTarget:main cron jobs report ok but never execute shell commands

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

systemEvent cron jobs with sessionTarget: "main" and wakeMode: "now" are scheduled correctly and show status "ok" with "ran X hours ago" — but the shell command in payload.text is never actually executed because there is no active main agent session.

The gateway reports success but the script never runs. This is a silent failure.

Root Cause

src/cron/service/timer.tsexecuteMainSessionCronJob(): the systemEvent is dispatched to a main agent session. If no main session is active, the event is silently dropped. Gateway marks the job as ok anyway.

Fix Action

Workaround

Move shell-command cron jobs to the system crontab (crontab -e). Gateway cron only works reliably for agentTurn jobs that need AI agent processing.

RAW_BUFFERClick to expand / collapse

Description

systemEvent cron jobs with sessionTarget: "main" and wakeMode: "now" are scheduled correctly and show status "ok" with "ran X hours ago" — but the shell command in payload.text is never actually executed because there is no active main agent session.

The gateway reports success but the script never runs. This is a silent failure.

Impact

3 production cron jobs appeared to run successfully for 12 days but never executed:

  • tango-events-dailynode tango-daily.js (daily tango event report)
  • daily-spend-summarynode daily-spend-summary.js (AI spend)
  • meta-pixel-enrichment-reminder — notification command (Meta pixel deadline)

Same pattern as daily-update-research and jarvice-qa-daily which were moved to system crontab on May 16 by someone who hit the same wall but did not report it.

Root cause

src/cron/service/timer.tsexecuteMainSessionCronJob(): the systemEvent is dispatched to a main agent session. If no main session is active, the event is silently dropped. Gateway marks the job as ok anyway.

Expected behavior

  • If a session is required for execution and none exists, the job should report "skipped" or "failed" with a clear reason, not "ok"
  • Optionally: create a short-lived session to execute the systemEvent command

Workaround

Move shell-command cron jobs to the system crontab (crontab -e). Gateway cron only works reliably for agentTurn jobs that need AI agent processing.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • If a session is required for execution and none exists, the job should report "skipped" or "failed" with a clear reason, not "ok"
  • Optionally: create a short-lived session to execute the systemEvent command

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING