OpenClaw Cron Commands Take 20 Seconds and Exit with SIGKILL

Published April 17, 2026 · Bug #67439 · Affects: 2026.4.11+ · Platform: Linux/VPS

You run openclaw cron add or openclaw cron list, the command prints the right output — then sits there for 15–20 seconds before finally exiting. Sometimes it gets killed with SIGKILL or SIGTERM instead of exiting cleanly. It's frustrating in scripts and absolutely breaks any cron setup automation.

The good news: the mutation always succeeds. Your job is in jobs.json. The cron engine is running it correctly. The slowness is purely in the CLI process teardown, not the operation itself.

What's Actually Happening

The OpenClaw CLI uses a WebSocket RPC connection to the gateway for cron operations. After the gateway processes the request and sends back the response JSON, the WebSocket connection teardown hangs — the CLI isn't getting a clean "done" signal and waits for the connection to time out before exiting.

The 15–20 second wall time is consistent across all cron subcommands, pointing to a shared transport-layer issue in the CLI rather than per-command logic. A direct HTTP health check to the same gateway returns instantly — so the gateway itself is fine.

Timing by command from the issue report:

CommandMutation succeeds?Exit behaviorWall time
cron listn/aClean exit~20s
cron add✅ YesClean or SIGTERM~21s
cron edit✅ YesSIGTERM/SIGKILL~10–15s
cron rm✅ YesSIGKILL after JSON~15s

Is My Cron Actually Working?

Yes. Verify directly:

# Check jobs.json directly — bypass the CLI
cat ~/.openclaw/jobs.json | python3 -m json.tool

# Or check via the gateway HTTP API (returns instantly)
curl -s http://127.0.0.1:18789/cron/jobs | python3 -m json.tool

If your job appears there, it's scheduled and will run. The slow exit is cosmetic from an operational standpoint.

Workarounds

1. Use a Timeout Wrapper in Scripts

If you're running cron commands in automation, wrap them with timeout to prevent blocking:

# Add a cron job — succeeds, killed after 5s instead of 20s
timeout 5 openclaw cron add --name "daily-brief" --at "6h30m" --model sonnet --message "morning brief"
# Exit code will be non-zero due to SIGTERM, but the job IS created
# Verify:
curl -s http://127.0.0.1:18789/cron/jobs | grep "daily-brief"

2. Edit jobs.json Directly

For bulk setup or scripted provisioning, you can write directly to jobs.json — the cron engine hot-reloads it:

# Backup first
cp ~/.openclaw/jobs.json ~/.openclaw/jobs.json.bak

# The gateway picks up changes within a few seconds
# Use jq to append a job safely
jq '. + [{"name":"test","schedule":"*/30 * * * *","model":"haiku","message":"ping"}]' \
  ~/.openclaw/jobs.json > /tmp/jobs-new.json && mv /tmp/jobs-new.json ~/.openclaw/jobs.json

3. Just Wait It Out

If you're doing one-off setup, the 20-second hang is annoying but not blocking. The job is created, the engine runs it. Track the GitHub issue for a proper fix: #67439.

4. Downgrade to 2026.4.10 or Earlier

If cron CLI responsiveness is critical for your workflow and you can tolerate an older version:

npm install -g openclaw@2026.4.10
openclaw gateway restart

Quick Diagnosis

# Confirm it's the CLI hang, not a gateway issue
time curl -s http://127.0.0.1:18789/health
# Should return in <100ms

time openclaw cron list
# If this takes 15-20s but curl was instant → CLI websocket teardown bug confirmed

Bottom Line

Your cron jobs are working. The 20-second hang is a CLI transport issue where the WebSocket connection to the gateway doesn't close cleanly after the response is received. Your automation works — it's just slow to exit. Use the HTTP API or direct jobs.json edits for scripted provisioning until a fix ships.

Need help setting up a reliable cron schedule for your OpenClaw deployment? ClawReady handles the whole setup including cron configuration.

← Back to blog