Skip to content

[BUG] CronToolSchema: job property has empty properties — causes GPT-5.4 to send job: {} #55035

Description

@brunolorente

Summary

When using GPT-5.4 (via OpenRouter) with OpenClaw 2026.3.24 (cff6dc9), asking the agent to create a cron job results in an infinite retry loop. The agent sends job: {} on every cron.add call, and the gateway rejects it with INVALID_REQUEST.

Root Cause

In the bundled file dist/pi-embedded-BaSvmUpW.js, the CronToolSchema defines the job parameter as:

job: Type.Optional(Type.Object({}, { additionalProperties: true }))

This produces the following JSON Schema fragment:

{
  "job": {
    "type": "object",
    "properties": {},
    "additionalProperties": true
  }
}

Because properties is an empty object, GPT-5.4 strictly follows the schema and sends job: {}. The gateway then rejects this as invalid, the agent retries, and the loop continues (aseq reaching 300+).

Reproduction

  1. Install [email protected]
  2. Ask the agent: "Create a cron job that says hello every 3 minutes"
  3. Observe session logs — every cron.add call sends job: {}

Expected Behavior

The job property should have explicit sub-properties so the model knows what fields to populate. For example:

job: Type.Optional(Type.Object({
  name: Type.Optional(Type.String()),
  schedule: Type.Optional(Type.Object({
    kind: Type.String(),           // "every" | "cron"
    everyMs: Type.Optional(Type.Number()),
    cron: Type.Optional(Type.String()),
  })),
  payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   payload:   paylol(Type.String()),
  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Typet-  wakeMode: Type.Op  onal(Type.Strin  wakeMode: Type.Op  onal( with the explicit schema above.
- After patching, GPT-5.4 correctly sends fully-populated `job` objects:

```json
{
  "job": {
    "name": "hello-cron",
    "schedule": { "kind": "every", "everyMs": 180000 },
    "sessionTarget": "main",
    "payload": { "kind": "systemEvent", "text": "Hello world" },
    "wakeMode": "reuse-or-create",
    "delivery": "enqueue",
    "enabled": true
  }
}

Environment

  • OpenClaw: 2026.3.24 (cff6dc9)
  • Model: openrouter/openai/gpt-5.4
  • OS: macOS (also tested in Docker/Node 22 Alpine)
  • Node: 22.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions