← 返回 Skills 市场
Gateway Watchdog
作者
Bryan Tegomoh, MD, MPH
· GitHub ↗
· v1.0.0
· MIT-0
156
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gateway-watchdog-v2
功能描述
Production-grade bash watchdog for the OpenClaw gateway. Runs via launchd every 5 minutes. Handles boot grace periods, progressive retry with backoff, port-l...
使用说明 (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
- 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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gateway-watchdog-v2 - 安装完成后,直接呼叫该 Skill 的名称或使用
/gateway-watchdog-v2触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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`.
元数据
常见问题
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 156 次。
如何安装 Gateway Watchdog?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gateway-watchdog-v2」即可一键安装,无需额外配置。
Gateway Watchdog 是免费的吗?
是的,Gateway Watchdog 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Gateway Watchdog 支持哪些平台?
Gateway Watchdog 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Gateway Watchdog?
由 Bryan Tegomoh, MD, MPH(@bryantegomoh)开发并维护,当前版本 v1.0.0。
推荐 Skills