#Cron jobs get Clawdbot stuck in a loop

1 messages Β· Page 1 of 1 (latest)

half wren
#

Setting up a simple reminder triggers a loop of death where Clawd gets stuck and becomes unresponsive.

Seems like it's not using the correct cron CLI parameters but my knowledge is limited on the tech aspects.

This should be a feature that works out of the box but definilyte isnt.

Logs below (these appear repeatedly in a loop until I kill the process entirely)

[tools] cron failed: invalid cron.add params: at /schedule: must have required property 'atMs'; at /schedule: unexpected property 'everyMs'; at /schedule/kind: must be equal to constant; at /schedule: must have required property 'expr'; at /schedule: must match a schema in anyOf; at /sessionTarget: must be equal to constant; at /sessionTarget: must match a schema in anyOf; at /payload/kind: must be equal to constant; at /payload: must have required property 'message'; at /payload: unexpected property 'text'; at /payload: must match a schema in anyOf
08:07:21
info
web-heartbeat
{"0":"{"module":"web-heartbeat","runId":"39306662-e21f-45f9-87b9-a0da437eea1a"}","1":{"connectionId":"85246012-8534-412a-9828-600b948a4da6","reconnectAttempts":0,"messagesHandled":0,"lastMessageAt":null,"authAgeMs":359424.3740234375,"uptimeMs":960794},"2":"web gateway heartbeat","_meta":{"runtime":"node","runtimeVersion":"25.4.0","hostname":"unknown","name":"{"module":"web-heartbeat","runId":"39306662-e21f-45f9-87b9-a0da437eea1a"}","parentNames":["clawdbot"],"date":"2026-01-26T06:07:21.228Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/clawdbot/dist/web/auto-reply/monitor.js:233:37","fileName":"monitor.js","fileNameWithLine":"monitor.js:233","fileColumn":"37","fileLine":"233","filePath":"opt/homebrew/lib/node_modules/clawdbot/dist/web/auto-reply/monitor.js","filePathWithLine":"opt/homebrew/lib/node_modules/clawdbot/dist/web/auto-reply/monitor.js:233","method":"Timeout._onTimeout"}},"time":"2026-01-26T06:07:21.229Z"}

lilac grottoBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

final cryptBOT
# half wren Setting up a simple reminder triggers a loop of death where Clawd gets stuck and...

This is a schema validation error - the cron tool is receiving parameters in the wrong format. The error indicates:

  • schedule is getting everyMs but expects atMs or expr (cron expression)
  • payload is getting text but expects message
  • sessionTarget has schema issues

This is a bug in how the cron parameters are being passed, not a user error. The schema validation is failing repeatedly, causing the loop.

Quick questions to help diagnose:

  1. How are you setting up the reminder? (Discord command, web UI, API?)
  2. What exact parameters are you using? (Every X minutes? At a specific time?)
  3. What version of Clawdbot? (clawdbot --version)

Immediate workaround: Try using the CLI directly:

#
clawdbot cron add --help

The core issue appears to be in the cron.add tool schema or how the parameters are being serialized from the frontend. Someone on the team will need to:

  • Check the cron tool schema in the source
  • Verify the frontend is sending message instead of text
  • Ensure everyMs vs atMs/expr is handled correctly

Link to cron docs for reference: https://docs.clawd.bot/gateway/cron

@steipete - this looks like a real bug that needs fixing in the cron tool validation/retry logic. The repeated validation failures in a loop suggest there might be no backoff or failure handling on the cron tool call.

half wren
#
  1. I tried 3 different ways: webui, whatsapp, telegram. They all trigger the loop of death.
  2. I tried both: "set a reminder in 5 minutes" and "set a reminder at 8.45pm"
  3. Version: 2026.1.24-3

Note: the URL you shared returns 404 (https://docs.clawd.bot/gateway/cron)

I appreciate the CLI workaround but I want to get to the bottom of that and get it fixed permanently.

final cryptBOT
# half wren 1. I tried 3 different ways: webui, whatsapp, telegram. They all trigger the loo...

Based on my investigation, I've found the root cause of this bug. Here's my analysis:

Root Cause

The cron tool expects a job parameter, but the agent/LLM is passing cron job properties at the top level instead of nested under job.

The cron tool schema:

const CronToolSchema = Type.Object({
  action: stringEnum(CRON_ACTIONS),
  job: Type.Optional(Type.Object({}, { additionalProperties: true })),
  // ...
});

And in the add handler:

#
const job = normalizeCronJobCreate(params.job, { defaultTimezone: timezone }) ?? params.job;

Problem: If the agent constructs parameters like:

{
  action: "add",
  schedule: { everyMs: 300000 },
  payload: { text: "Reminder" }
}

Instead of:

{
#
  action: "add",
  job: {
    schedule: { everyMs: 300000 },
    payload: { text: "Reminder" }
  }
}

Then params.job is undefined, so normalizeCronJobCreate(undefined) returns null, and the raw params are passed to the gateway. The gateway then validates the incomplete object and fails.

Why It Loops

The agent sees the validation error and retries, but keeps constructing the parameters incorrectly (without the job wrapper), causing the same error repeatedly.

The Fix

#

The cron tool's add handler needs to be more flexible. Looking at normalizeCronJobInput, it already has an unwrapJob function that handles both { job: {...} } and { data: {...} } formats. The cron tool should use this:

// In cron-tool.ts add handler, change:
const job = normalizeCronJobCreate(params.job, ...) ?? params.job;

// To something like:
const rawJob = params.job ?? params; // Fallback to params if no job wrapper
const job = normalizeCronJobCreate(rawJob, ...) ?? rawJob;

This would make the cron tool accept both:

  1. job: { schedule: {...}, payload: {...} } (correct format)
  2. schedule: {...}, payload: {...} (direct format from LLM)

Immediate Workaround for Fredo

#

Until this is fixed, the agent needs to construct cron jobs with the job wrapper:

{
  action: "add",
  job: {
    name: "reminder",
    schedule: { everyMs: 300000 },
    payload: { text: "Reminder message" }
  }
}

@steipete This is a real bug in how the cron tool handles parameters. The LLM is generating cron job parameters without the job wrapper, causing validation to fail. The fix should make the cron tool more tolerant of different parameter formats.

half wren
#

How do I configure the job wrapper?

final cryptBOT
# half wren How do I configure the job wrapper?

You can't configure this - this is a bug in Clawdbot's code that needs to be fixed, not something you can work around as a user.

The "job wrapper" issue I described is about how the internal AI agent constructs cron job parameters. The agent is constructing them incorrectly, causing the validation loop.

What you can do right now:

  1. Wait for a fix - @steipete this needs a code change in cron-tool.ts

  2. Use the CLI as a temporary workaround if you have terminal access:

# For a reminder in 5 minutes
clawdbot cron add --name "reminder" --schedule "every:300000" --payload "text:Your message"

# Check existing cron jobs
clawdbot cron list
#
  1. Don't use reminders via chat until this is fixed, as it will keep crashing Clawdbot

The issue affects all channels (WhatsApp, Telegram, WebUI) because they all go through the same agent/tool layer that has this bug. The fix should be straightforward - making the cron tool more tolerant of parameters without the job wrapper.

half wren
#

how can i notify @unkempt thistle of this?

final cryptBOT
#

@unkempt thistle - Cron jobs bug report

Issue: Setting up reminders crashes Clawdbot with an infinite validation loop.

Error: [tools] cron failed: invalid cron.add params with schema validation errors (missing atMs, wrong everyMs, text vs message, etc.)

Reproduction: "Set a reminder in 5 minutes" or "Set a reminder at 8.45pm" via any channel (WhatsApp, Telegram, WebUI)

Version: 2026.1.24-3

Root cause: The cron tool expects parameters wrapped in a job object, but the agent/LLM is sending them at the top level. This causes validation to fail repeatedly, creating an infinite loop.

Fix location: src/agents/tools/cron-tool.ts - the add handler should fallback to params if params.job is undefined, instead of passing undefined to the gateway.