Gateway Watchdog
/install gateway-watchdog-v2
gateway-watchdog
Keeps the OpenClaw gateway alive without killing it during startup. Five defensive layers prevent false restarts and restart loops.
How It Works
- HTTP check — pings
http://127.0.0.1:18789; exits immediately if the gateway responds - Boot grace — if the process is \x3C180s old, waits without acting (avoids killing a booting gateway)
- Port check — if the port is bound but HTTP is slow, waits up to 15s for recovery
- Progressive retry — 3 retries at 15s / 30s / 45s intervals
- Cooldown — enforces a 10-minute gap between restarts to prevent loops
Logs go to ~/.openclaw/logs/watchdog.log.
Setup (macOS launchd)
Create ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist:
\x3C?xml version="1.0" encoding="UTF-8"?>
\x3C!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
\x3Cplist version="1.0">
\x3Cdict>
\x3Ckey>Label\x3C/key>
\x3Cstring>com.openclaw.gateway-watchdog\x3C/string>
\x3Ckey>ProgramArguments\x3C/key>
\x3Carray>
\x3Cstring>/bin/bash\x3C/string>
\x3Cstring>/path/to/skills/gateway-watchdog/scripts/gateway-watchdog.sh\x3C/string>
\x3C/array>
\x3Ckey>StartInterval\x3C/key>
\x3Cinteger>300\x3C/integer>
\x3Ckey>RunAtLoad\x3C/key>
\x3Ctrue/>
\x3C/dict>
\x3C/plist>
Then load it:
launchctl load ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist
Usage (manual)
bash scripts/gateway-watchdog.sh
Requirements
- macOS (uses
launchctl,lsof,date -j) curlin PATH- OpenClaw gateway running under
launchdasai.openclaw.gateway
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install gateway-watchdog-v2 - After installation, invoke the skill by name or use
/gateway-watchdog-v2 - Provide required inputs per the skill's parameter spec and get structured output
What is Gateway Watchdog?
Production-grade bash watchdog for the OpenClaw gateway. Runs via launchd every 5 minutes. Handles boot grace periods, progressive retry with backoff, port-l... It is an AI Agent Skill for Claude Code / OpenClaw, with 156 downloads so far.
How do I install Gateway Watchdog?
Run "/install gateway-watchdog-v2" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Gateway Watchdog free?
Yes, Gateway Watchdog is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Gateway Watchdog support?
Gateway Watchdog is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Gateway Watchdog?
It is built and maintained by Bryan Tegomoh, MD, MPH (@bryantegomoh); the current version is v1.0.0.