Gateway Self-Heal Watchdog
/install gw-self-heal
Gateway Watchdog
Automated self-healing system for OpenClaw gateway failures including config corruption, process crashes, and auth failures.
How It Works
Three-layer protection:
- Config Guard — Auto-backup
openclaw.jsonon every successful health check - Process Watchdog — Detect gateway process death → auto-restart
- Auth Health Check — Detect running-but-broken state → rollback config → restart
Setup
Run the setup script to install the watchdog:
bash scripts/setup-watchdog.sh
This will:
- Create the watchdog script at
~/.openclaw/watchdog.sh - Register it as a cron job (every minute)
- Take an initial config backup
Manual Commands
# Check watchdog status
bash scripts/watchdog-status.sh
# Force backup current config
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
# View watchdog logs
cat ~/.openclaw/watchdog.log | tail -20
# Disable watchdog
crontab -l | grep -v watchdog | crontab -
Recovery Levels
| Level | Condition | Action | Auto? |
|---|---|---|---|
| 1 | Process dead, config OK | Restart gateway | ✅ |
| 2 | Process alive, health check fail | Rollback config + restart | ✅ |
| 3 | No valid backup exists | Log alert, notify if possible | ⚠️ Manual |
Config Backup Strategy
- Auto-backup: On every successful health check, current config overwrites
.bak - Pre-change backup: Before any
openclaw.jsonedit, copy to.bak.prev - Broken config preserved: Failed configs saved as
.broken.\x3Ctimestamp>for debugging
Logs
All watchdog activity logged to ~/.openclaw/watchdog.log with timestamps.
Platform Support
- macOS: cron-based (launchd alternative in
references/launchd.md) - Linux: cron or systemd (see
references/systemd.md) - Docker: Use HEALTHCHECK directive (see
references/docker.md)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gw-self-heal - 安装完成后,直接呼叫该 Skill 的名称或使用
/gw-self-heal触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Gateway Self-Heal Watchdog 是什么?
Self-healing watchdog for OpenClaw gateway. Auto-backup openclaw.json before changes, health-check the gateway process, and auto-rollback to last known good... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 384 次。
如何安装 Gateway Self-Heal Watchdog?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gw-self-heal」即可一键安装,无需额外配置。
Gateway Self-Heal Watchdog 是免费的吗?
是的,Gateway Self-Heal Watchdog 完全免费(开源免费),可自由下载、安装和使用。
Gateway Self-Heal Watchdog 支持哪些平台?
Gateway Self-Heal Watchdog 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Gateway Self-Heal Watchdog?
由 mupengi-bot(@mupengi-bot)开发并维护,当前版本 v1.0.0。