Skip to content

cron create/list fails with 'gateway closed (1000)' handshake timeout on Windows #52424

@cuizhou6463-lang

Description

@cuizhou6463-lang

🐛 Bug Description

openclaw cron commands (both create and list) fail with gateway closed (1000: normal closure) immediately after gateway restart, even when gateway is confirmed running and responsive.

Environment

  • OS: Windows (NT 10.0.26200)
  • OpenClaw: 2026.3.13 (61d171a)
  • Node.js: v24.13.0
  • Installation: npm global
  • Gateway: Running as Windows scheduled task (\OpenClaw Gateway)

Steps to Reproduce

  1. Gateway is installed as a scheduled task (service mode)
  2. Gateway is running (netstat shows 127.0.0.1:18789 LISTENING)
  3. Run any openclaw cron command:
    openclaw cron list
    openclaw cron create --name "test" ...
    
  4. Command immediately fails with:
    gateway connect failed: Error: gateway closed (1000):
    Error: gateway closed (1000 normal closure): no close reason
    Gateway target: ws://127.0.0.1:18789
    

Gateway Log (relevant entries)

{"subsystem":"gateway/ws"} handshake timeout {"handshake":"failed","durationMs":5172,"host":"127.0.0.1:18789","handshakeMs":3014}
"closed before connect conn=... remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1000 reason=n/a"

The CLI connects via WebSocket but the gateway closes the connection during handshake before the RPC completes.

Expected Behavior

openclaw cron list should return the list of cron jobs (empty if none exist).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions