/install openclaw-self-healing
OpenClaw Self-Healing System
"The system that heals itself — or calls for help when it can't."
A 4-tier autonomous recovery system for OpenClaw Gateway, featuring AI-powered diagnosis via Claude Code. Tested in production on macOS + Linux.
Architecture
Level 1: config-watch → Config file change detection + instant reload
Level 2: Watchdog v4.4 → OAuth detection, zombie kill, exponential backoff
Level 3: Claude Code Doctor → AI-powered diagnosis & repair (30 min window) 🧠
Level 4: Discord/Telegram → Human escalation with full context
What's New in v3.1.0
- Complete healing chain fix — config-watch → Watchdog → Emergency Recovery now fully connected
- Installer rewrite — single
install.shcovers macOS (LaunchAgent) + Linux (systemd) - Watchdog v4.4 — OAuth token expiry detection, zombie process auto-kill, Exponential Backoff
- Emergency Recovery v2 — persistent learning repo, reasoning logs, multi-model support (Claude Code + Aider)
- Metrics dashboard — success rate, MTTR, trending analysis via tmux
Quick Setup
bash \x3C(curl -fsSL https://raw.githubusercontent.com/Ramsbaby/openclaw-self-healing/main/install.sh)
Or install via ClawHub:
npx clawhub@latest install openclaw-self-healing
The 4 Tiers in Detail
| Level | Script | Trigger | Action |
|---|---|---|---|
| L1 | config-watch.sh |
Config file change | Validate + reload gateway |
| L2 | gateway-watchdog.sh |
Process down / HTTP fail | Kill zombie → restart → backoff |
| L3 | emergency-recovery-v2.sh |
30min continuous failure | Claude Code PTY diagnosis |
| L4 | emergency-recovery-monitor.sh |
L3 triggered | Discord + Telegram alert |
Configuration
All settings via environment variables in ~/.openclaw/.env:
| Variable | Default | Description |
|---|---|---|
DISCORD_WEBHOOK_URL |
(none) | Discord webhook for L4 alerts |
OPENCLAW_GATEWAY_URL |
http://localhost:18789/ |
Gateway health check URL |
HEALTH_CHECK_MAX_RETRIES |
3 |
Restart attempts before L3 escalation |
EMERGENCY_RECOVERY_TIMEOUT |
1800 |
Claude recovery timeout (30 min) |
Verified Recovery Cases
- OAuth token expiry — Watchdog v4.4 detects 401 in logs, restarts before agent dies
- Zombie process — Preflight detects PID mismatch, SIGKILL + launchctl kickstart
- Config schema error —
openclaw doctor --fixauto-applied on exit_1 pattern - Level 3 triggered — Claude Code diagnosed and fixed broken config in \x3C 15 min
Links
- GitHub: https://github.com/Ramsbaby/openclaw-self-healing
- Changelog: https://github.com/Ramsbaby/openclaw-self-healing/blob/main/CHANGELOG.md
- Linux setup: https://github.com/Ramsbaby/openclaw-self-healing/blob/main/docs/LINUX_SETUP.md
License
MIT — built by @ramsbaby + Jarvis 🦞
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install openclaw-self-healing - 安装完成后,直接呼叫该 Skill 的名称或使用
/openclaw-self-healing触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
OpenClaw Self-Healing System 是什么?
4-tier autonomous self-healing and auto-recovery system for OpenClaw Gateway. Monitors gateway health, auto-restarts on crash, detects OAuth token expiry, ki... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 4792 次。
如何安装 OpenClaw Self-Healing System?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install openclaw-self-healing」即可一键安装,无需额外配置。
OpenClaw Self-Healing System 是免费的吗?
是的,OpenClaw Self-Healing System 完全免费(开源免费),可自由下载、安装和使用。
OpenClaw Self-Healing System 支持哪些平台?
OpenClaw Self-Healing System 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Self-Healing System?
由 Ramsbaby(@ramsbaby)开发并维护,当前版本 v3.1.1。