openclaw - 💡(How to fix) Fix Built-in cron tool should allow isolated cron runs to disable their current job

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…

Root Cause

Recurring, reusable cron jobs often need to pause themselves after a time window or completion condition while keeping their configuration for later reuse. Requiring exec for this makes headless cron runs depend on shell permissions and chat approval routing even though OpenClaw already has a first-class cron control tool.

Fix Action

Fix / Workaround

  • Permit action: "update" in self-scope only when:

    • jobId matches the current cron job
    • the patch only changes enabled to false
    • no schedule, payload, delivery, model, agent, target, or other mutable fields are changed
  • An isolated cron job can disable itself through the built-in cron tool without using exec.

  • The same restricted cron self-scope still prevents modifying or disabling other jobs.

  • The self-disable operation preserves the job record, run history, schedule, payload, delivery config, and metadata.

  • Existing self-remove behavior remains unchanged.

  • Tests cover:

    • self-disable allowed for current job
    • self-disable denied for another job
    • update/disable denied when patch includes fields other than enabled:false
    • existing self-remove/read-only self-scope behavior still works
RAW_BUFFERClick to expand / collapse

Problem

Isolated cron jobs can currently use the built-in cron tool for limited self-cleanup, but the restricted self-scope only allows removing the current job. It does not allow disabling the current job while preserving it.

This creates a gap for reusable recurring jobs that should pause themselves at a cutoff time but be reused later. The model has to fall back to exec with openclaw cron disable <jobId>, which can trigger exec approval prompts in headless cron runs.

Observed example:

  • Job: earnings-watch-multi
  • Session: agent:threeh:cron:89fb1ef3-7e42-4915-860c-6e2c91718694:run:7592c45f-9fc9-4368-bf3c-3d49b5f6bb85
  • Desired behavior: at the 6:30 PM ET cutoff, disable the OpenClaw cron job and return NO_REPLY
  • Actual behavior: the agent attempted exec:
    • openclaw cron disable 89fb1ef3-7e42-4915-860c-6e2c91718694
    • approval was required / unavailable in the Discord cron context

Removing the job is not a good replacement because these jobs are often reused daily across several days in a month.

Current behavior

The built-in cron tool's restricted self-cleanup mode allows:

  • status
  • self-filtered list
  • get for the current job
  • runs for the current job
  • remove for the current job

It does not allow a scoped disable/update operation for the current job.

Proposed behavior

Allow isolated cron runs with the existing narrow self-cleanup grant to disable their own current job without using exec.

Possible implementation shape:

  • Add a dedicated cron tool action:
    • action: "disable"
    • requires jobId
    • allowed in self-scope only when jobId matches the current cron job
    • internally applies { enabled: false }

Or:

  • Permit action: "update" in self-scope only when:
    • jobId matches the current cron job
    • the patch only changes enabled to false
    • no schedule, payload, delivery, model, agent, target, or other mutable fields are changed

Acceptance criteria

  • An isolated cron job can disable itself through the built-in cron tool without using exec.
  • The same restricted cron self-scope still prevents modifying or disabling other jobs.
  • The self-disable operation preserves the job record, run history, schedule, payload, delivery config, and metadata.
  • Existing self-remove behavior remains unchanged.
  • Tests cover:
    • self-disable allowed for current job
    • self-disable denied for another job
    • update/disable denied when patch includes fields other than enabled:false
    • existing self-remove/read-only self-scope behavior still works

Why this matters

Recurring, reusable cron jobs often need to pause themselves after a time window or completion condition while keeping their configuration for later reuse. Requiring exec for this makes headless cron runs depend on shell permissions and chat approval routing even though OpenClaw already has a first-class cron control tool.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Built-in cron tool should allow isolated cron runs to disable their current job