ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified system Safety 4/5

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-level fallback checks, stale PID detection, and restart cooldowns — preventing restart loops while keeping the gateway reliably alive.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/bryantegomoh/gateway-watchdog-v2
Or

What This Skill Does

The gateway-watchdog is a production-grade bash utility designed specifically for the OpenClaw ecosystem. Its primary function is to ensure maximum uptime for the OpenClaw gateway process by acting as a defensive, intelligent monitor. Unlike simple cron jobs that blindly kill processes, this watchdog employs five distinct layers of logic: HTTP heartbeat verification, boot-time grace periods, active port-binding checks, progressive retry backoff, and strict restart cooldowns. By detecting stale PIDs and unresponsive services, it automatically remediates issues while strictly adhering to safety constraints that prevent dangerous restart loops.

Installation

Installation is performed via the OpenClaw CLI. Run clawhub install openclaw/skills/skills/bryantegomoh/gateway-watchdog-v2. After the files are localized, create the macOS launchd configuration file at ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist using the provided XML template. Ensure the path to the script points correctly to your local installation directory. Once the file is saved, execute launchctl load ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist to register the watchdog with the system process manager. Verify success by checking ~/.openclaw/logs/watchdog.log.

Use Cases

  • Production Stability: Ensures the OpenClaw gateway remains responsive in headless macOS environments.
  • Remote Maintenance: Acts as a reliable safety net for OpenClaw nodes that are hard to access manually.
  • Service Recovery: Automatically recovers from transient network socket lockups without requiring human intervention.
  • Development Workflows: Prevents developer frustration by handling the lifecycle management of local gateway processes.

Example Prompts

  • "OpenClaw, please verify if the gateway-watchdog is currently running and check the status of my gateway logs."
  • "Can you help me install the latest version of the gateway-watchdog and set up the launchd agent?"
  • "I noticed my gateway restarted; show me the last ten entries in the watchdog logs to understand why."

Tips & Limitations

This skill requires macOS due to its dependency on native launchctl and lsof commands. It is optimized for the ai.openclaw.gateway process. Avoid running multiple instances of the watchdog, as they may conflict with the cooldown timers. If you are experiencing frequent restarts, check the gateway logs independently to ensure the issue isn't a configuration error causing immediate process crashes.

Metadata

Stars4190
Views1
Updated2026-04-18
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-bryantegomoh-gateway-watchdog-v2": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#watchdog#uptime#system-admin#macos#automation
Safety Score: 4/5

Flags: file-read, file-write, code-execution