Skip to content

[Feature]: Direct Exec Mode for Cron Jobs #18160

Description

@robertvanstedum

Summary

Current cron jobs require agentTurn execution, which can timeout and jobs don't run.

Problem to solve

Problem

Current cron jobs require agentTurn execution, which:

  • Forces LLM interpretation of simple commands
  • Adds unnecessary API calls and latency
  • Creates reliability issues (LLM timeouts cause job failures)
  • Not production-grade for simple script execution

Use Case

Scripts with built-in intelligence that:

  • Already format their own output
  • Just need to run on schedule
  • Should deliver stdout to a channel
  • Don't need agent interpretation

Example: RSS curator that generates formatted briefings, balance monitors, usage trackers.

Proposed solution

Proposed Solution

Add new payload type: payload.kind = "exec"

{
  "name": "Morning Briefing",
  "schedule": { "kind": "cron", "expr": "0 7 * * *" },
  "sessionTarget": "isolated",
  "payload": {
    "kind": "exec",
    "command": "bash /path/to/briefing.sh",
    "timeoutSeconds": 300
  },
  "delivery": {
    "mode": "announce",
    "channel": "telegram",
    "to": "123456789"
  }
}

Behavior:

  1. Run command directly via exec tool (no agent interpretation)
  2. Capture stdout/stderr
  3. Deliver to specified channel
  4. Never touch LLM (unless command explicitly calls agent)

Benefits

  • Reliability: No LLM dependency for simple jobs
  • Cost: No API calls for execution overhead
  • Speed: Immediate execution, no thinking time
  • Production-grade: Predictable, deterministic behavior

Alternatives considered

Workaround (Current)

Users must:

  • Use systemEvent + heartbeat (still agent-mediated)
  • Set thinking: "off" + cheaper model (still LLM calls)
  • Fall back to system cron + manual API calls (defeats purpose)

Impact

This would make OpenClaw cron competitive with standard system cron for scripted automation, while keeping the benefit of integrated channel delivery.

Requested by

@vanstedum (Robert) - Production use case: automated daily briefings + monitoring

Evidence/examples

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.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:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestimpact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions