← Back to Skills Marketplace
bryantegomoh

Gateway Watchdog

by Bryan Tegomoh, MD, MPH · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
156
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gateway-watchdog-v2
Description
Production-grade bash watchdog for the OpenClaw gateway. Runs via launchd every 5 minutes. Handles boot grace periods, progressive retry with backoff, port-l...
README (SKILL.md)

gateway-watchdog

Keeps the OpenClaw gateway alive without killing it during startup. Five defensive layers prevent false restarts and restart loops.

How It Works

  1. HTTP check — pings http://127.0.0.1:18789; exits immediately if the gateway responds
  2. Boot grace — if the process is \x3C180s old, waits without acting (avoids killing a booting gateway)
  3. Port check — if the port is bound but HTTP is slow, waits up to 15s for recovery
  4. Progressive retry — 3 retries at 15s / 30s / 45s intervals
  5. 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)
  • curl in PATH
  • OpenClaw gateway running under launchd as ai.openclaw.gateway
Usage Guidance
This skill appears to do what it says: local health checks and restart of the OpenClaw gateway via launchd. Before installing: (1) Verify the script path in the provided plist points to the actual location you intend to run; (2) ensure required binaries exist on your machine (launchctl, curl, lsof, and macOS date -j); (3) run the script manually once and inspect ~/.openclaw/logs/watchdog.log to confirm behavior; (4) confirm the launchd label ai.openclaw.gateway matches your gateway job and you want an automated restart capability; (5) because the source/homepage is unknown, review the script contents yourself and store it from a trusted location or repository before enabling it. If you do not want the agent to autonomously restart the gateway, avoid enabling autonomous invocation or run the plist under a controlled user account.
Capability Analysis
Type: OpenClaw Skill Name: gateway-watchdog-v2 Version: 1.0.0 The skill provides a legitimate watchdog utility for maintaining the uptime of a local OpenClaw gateway service on macOS. The bash script (scripts/gateway-watchdog.sh) uses standard system tools like launchctl, lsof, and curl to monitor the service, implementing defensive features such as boot grace periods and restart cooldowns to prevent loops. No indicators of data exfiltration, malicious execution, or unauthorized persistence were found; the behavior is entirely consistent with the stated purpose.
Capability Assessment
Purpose & Capability
The script's actions (HTTP health check, port check, PID/age checks, and restart via launchctl) match the described purpose of a gateway watchdog. Minor inconsistency: registry metadata lists 'Required binaries: none' while the SKILL.md/script rely on macOS tools (launchctl, lsof, date -j) and curl; those runtime dependencies are expected but not declared in metadata.
Instruction Scope
SKILL.md and the script confine activity to local checks and local restarts: curl against http://127.0.0.1:18789, lsof for port binding, ps/date for process age, and launchctl to restart the ai.openclaw.gateway job. Logs are written to ~/.openclaw/logs/watchdog.log and a cooldown file in /tmp. There are no external network endpoints or data exfiltration behaviors.
Install Mechanism
This is an instruction-only skill with an included shell script; there is no install spec that downloads or writes arbitrary code to disk beyond the provided script. Risk from installation is low (user-controlled plist creation + launchctl load).
Credentials
The skill requests no credentials or environment variables. It uses $HOME and standard system tools; no secrets are accessed or transmitted. The script acts only on a local service label (ai.openclaw.gateway), which is appropriate for a watchdog.
Persistence & Privilege
The skill is not 'always:true'. It can be invoked by the agent autonomously (default), and the script calls launchctl kickstart to restart the gateway job. Restarting another launchd job is a legitimate high-impact action for a watchdog, so users should be aware that installing and enabling this skill grants the agent the ability to restart the gateway process in the user's session.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gateway-watchdog-v2
  3. After installation, invoke the skill by name or use /gateway-watchdog-v2
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of gateway-watchdog for OpenClaw gateway. - Production-ready bash watchdog designed for maximum reliability and false positive prevention. - Five defensive layers: HTTP check, boot grace period, port-level fallback, progressive retry with backoff, and restart cooldown. - Runs automatically via launchd every 5 minutes on macOS. - Prevents restart loops and ensures the gateway remains available. - Logs written to `~/.openclaw/logs/watchdog.log`.
Metadata
Slug gateway-watchdog-v2
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

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.

💬 Comments