Skip to content

Bug: systemEvent+sessionTarget:main cron jobs report ok but never execute shell commands #84923

Description

@GuyMayer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions