Skip to content

ensure-crons passes --timeout instead of --timeout-seconds, causing 120ms gateway timeout #307

@funsaized

Description

@funsaized

Summary

antfarm workflow ensure-crons <workflow> can fail while creating cron jobs because the CLI fallback passes the wrong OpenClaw flag for payload timeout (slow clients may fail under certain conditions). I believe antfarm intends to set the agent timeout, not the client gateway call timeout.

Observed behavior

ensure-crons fails with errors like:

  • gateway timeout after 120ms
  • gateway connect failed: Error: gateway client stopped

Root cause

In src/installer/gateway-api.ts, CLI fallback builds:

args.push("--timeout", `${job.payload.timeoutSeconds}`);

But in OpenClaw CLI:

  • --timeout = gateway/client timeout in milliseconds
  • --timeout-seconds = agent payload timeout in seconds

So when Antfarm passes --timeout 120 (intending 120s), OpenClaw interprets it as 120ms, causing spurious gateway timeouts.

Repro

This fails reliably:

openclaw cron add --json \
  --name test \
  --every 5m \
  --session isolated \
  --agent wedding-speech-research_planner \
  --message ping \
  --timeout 120

Control command (works):

openclaw cron add --json \
  --name test \
  --every 5m \
  --session isolated \
  --agent wedding-speech-research_planner \
  --message ping \
  --timeout-seconds 120

Proposed fix

Change Antfarm CLI fallback to pass --timeout-seconds for job.payload.timeoutSeconds.

I opened a PR with a one-line fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions