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)
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install gw-self-heal - After installation, invoke the skill by name or use
/gw-self-heal - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 384 downloads so far.
How do I install Gateway Self-Heal Watchdog?
Run "/install gw-self-heal" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Gateway Self-Heal Watchdog free?
Yes, Gateway Self-Heal Watchdog is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Gateway Self-Heal Watchdog support?
Gateway Self-Heal Watchdog is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Gateway Self-Heal Watchdog?
It is built and maintained by mupengi-bot (@mupengi-bot); the current version is v1.0.0.