Skip to content

Agent cron tool schema validation rejects valid job structures #3569

@gjustier

Description

@gjustier

Summary

The cron agent tool rejects valid job structures that the CLI (clawdbot cron add) accepts and the Gateway processes correctly.

Reproduction

Agent tool call:

{
  "action": "add",
  "job": {
    "name": "morning-brief",
    "sessionTarget": "main",
    "schedule": {
      "kind": "cron",
      "expr": "0 7 * * *",
      "timezone": "Europe/London"
    },
    "payload": {
      "kind": "systemEvent",
      "text": "Test message"
    }
  }
}

Error:

invalid cron.add params: at /schedule: must have required property 'atMs'; 
at /schedule: unexpected property 'expr'; at /schedule: unexpected property 'timezone'; 
at /schedule/kind: must be equal to constant; at /schedule: must have required property 'everyMs'; 
at /schedule: 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

Expected behavior

The tool should accept the same job structure that the CLI accepts:

clawdbot cron add --name "test" --cron "0 7 * * *" --tz "Europe/London" \
  --session main --system-event "Test"

This works and creates:

{
  "schedule": { "kind": "cron", "expr": "0 7 * * *", "tz": "Europe/London" },
  "payload": { "kind": "systemEvent", "text": "Test" }
}

Root cause hypothesis

The JSON Schema for the cron tool's job parameter appears to define schedule and payload as discriminated unions (anyOf) but:

  1. The kind discriminator isn't being recognized (error: "must be equal to constant")
  2. Fields like expr, timezone, text are marked as "unexpected" even though they're valid for their respective kind variants
  3. The schema may be requiring all fields from all variants simultaneously

Workaround

Use the CLI directly instead of the agent tool.

Environment

  • Clawdbot 2026.1.24-3 (885167d)
  • Node v22.17.0
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions