← 返回 Skills 市场
ramsbaby

OpenClaw Self-Healing System

作者 Ramsbaby · GitHub ↗ · v3.1.1
cross-platform ⚠ suspicious
4792
总下载
2
收藏
15
当前安装
10
版本数
在 OpenClaw 中安装
/install openclaw-self-healing
功能描述
4-tier autonomous self-healing and auto-recovery system for OpenClaw Gateway. Monitors gateway health, auto-restarts on crash, detects OAuth token expiry, ki...
使用说明 (SKILL.md)

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.sh covers 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 erroropenclaw doctor --fix auto-applied on exit_1 pattern
  • Level 3 triggered — Claude Code diagnosed and fixed broken config in \x3C 15 min

Links

License

MIT — built by @ramsbaby + Jarvis 🦞

安全使用建议
Install only if you intentionally want a persistent self-healing system with authority to restart OpenClaw and let Claude Code attempt repairs. Inspect the included install.sh and scripts first, prefer a pinned release over curl/bash from main, back up ~/.openclaw configuration, keep webhook channels private, and consider disabling or manually gating the Level 3 AI repair path until you trust the behavior.
功能分析
Type: OpenClaw Skill Name: openclaw-self-healing Version: 3.1.1 The bundle implements a multi-tiered 'self-healing' system that grants an AI agent (Claude Code or Aider) broad shell access to autonomously diagnose and repair the OpenClaw Gateway. It establishes persistence via LaunchAgents (macOS) and systemd (Linux) and exfiltrates system logs and recovery reports to external Discord and Telegram webhooks. While these high-risk capabilities (AI-driven RCE, persistence, and network communication) are aligned with the stated purpose of autonomous recovery, they create a significant attack surface for prompt injection and unauthorized system modification. Key files include emergency-recovery-v2.sh (AI orchestration), gateway-watchdog.sh (process management), and install.sh (persistence setup).
能力评估
Purpose & Capability
The self-healing purpose is coherent with monitoring and restarts, but the artifacts describe autonomous AI diagnosis and repair of the local OpenClaw environment, including config fixes and process control, without clearly bounded paths or approval steps.
Instruction Scope
The visible instructions describe automatic escalation to Claude Code for a 30-minute repair window and auto-applied fixes; the reviewed artifacts do not show clear human confirmation, dry-run mode, or modification limits.
Install Mechanism
Installation uses normal package managers for tmux, Claude Code, and jq, but the quick setup recommends executing an unpinned remote install script from GitHub main via curl/bash.
Credentials
Killing zombie processes, restarting the gateway, and changing OpenClaw configuration are proportionate to self-healing, but they are high-impact local mutations when performed autonomously by a background system.
Persistence & Privilege
The skill is designed to run persistently through LaunchAgent/systemd/timers/cron and can continue taking recovery actions after installation; this is disclosed but materially increases the impact of any bad diagnosis or misconfiguration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install openclaw-self-healing
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /openclaw-self-healing 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v3.1.1
v3.1.1: Improved search discoverability. Same features as v3.1.0.
v3.1.0
v3.1.0: Complete healing chain fix. Watchdog v4.4 with OAuth detection + zombie kill + exponential backoff. Emergency Recovery v2 with persistent learning. Installer rewrite for macOS+Linux.
v2.0.2
🐛 Hotfix: Discord webhook HTTP 404 버그 수정 - DISCORD_WEBHOOK_URL 의존성 제거 - stdout으로 알림 출력 → 크론 delivery 자동 전달 - 설정 복잡도 제거 - 실제 장애 시나리오로 검증 완료
v2.0.1
Major update introducing persistent learning, reasoning logs, and expanded alerting. - Added persistent learning with automatic documentation of failures and fixes. - Introduced reasoning logs to explain AI-driven recovery actions. - Expanded alerts to support both Discord and Telegram. - Added metrics dashboard script for visualizing recovery statistics. - New documentation and contributor guides. - Requires new dependency: jq (for metrics dashboard).
v1.3.4
GitHub Actions CI fix
v1.3.3
ShellCheck 100% clean
v1.3.2
Critical bug fixes: file order, lock security, completion detection
v1.3.1
- Added README.md for better documentation and onboarding. - Added demo-script.sh and install.sh example scripts. - Updated CHANGELOG.md and SKILL.md for the new version. - Improved emergency-recovery-monitor.sh and emergency-recovery.sh scripts.
v1.2.1
Add cleanup trap, log permissions, Linux systemd guide
v1.2.0
openclaw-self-healing 1.2.0 - Introduces a 4-tier autonomous self-healing architecture for OpenClaw Gateway. - Adds Claude Code as Level 3 emergency doctor for AI-powered diagnosis and repair. - Integrates Watchdog, Health Check (HTTP 200 with retries), Claude Recovery, and Discord Alert escalation. - Provides macOS LaunchAgent setup and step-by-step installation instructions. - All configuration is now handled via environment variables for easier setup and management.
元数据
Slug openclaw-self-healing
版本 3.1.1
许可证
累计安装 16
当前安装数 15
历史版本数 10
常见问题

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。

💬 留言讨论