← Back to Skills Marketplace
stevojarvisai-star

Self-Healing Agent

by stevojarvisai-star · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
251
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install self-healing-agent
Description
Self-recovery and auto-repair system for OpenClaw agents. Monitors agent health, detects failures (crashed cron jobs, broken skills, config corruption, memor...
README (SKILL.md)

Self-Healing Agent

Automated failure detection, diagnosis, and recovery for OpenClaw agents. The watchdog that keeps your agent running.

Quick Start

# Full health check — scan all systems, diagnose issues, suggest fixes
python3 scripts/self-healing-agent.py check

# Auto-heal — detect and fix what it can automatically
python3 scripts/self-healing-agent.py heal

# Monitor mode — run continuously, fix issues as they appear
python3 scripts/self-healing-agent.py monitor --interval 300

# Check specific subsystem
python3 scripts/self-healing-agent.py check --target cron
python3 scripts/self-healing-agent.py check --target memory
python3 scripts/self-healing-agent.py check --target config
python3 scripts/self-healing-agent.py check --target sessions

Commands

check — Health Check

Runs diagnostic suite:

  • Cron health — Failed jobs, consecutive errors, stuck jobs, timeout patterns
  • Memory health — File sizes, bloated sessions, orphaned files, growth rate
  • Config health — Valid JSON, required fields present, deprecated settings
  • Session health — Active sessions, zombie processes, memory usage
  • Skill health — Broken scripts, missing dependencies, syntax errors
  • Network health — API endpoint reachability, DNS resolution, SSL cert validity

Options: --target \x3Csubsystem> to check one area, --json for machine output.

heal — Auto-Repair

For each detected issue, applies the safest fix:

  • Restarts failed cron jobs (after diagnosing root cause)
  • Clears bloated session files (with backup)
  • Fixes JSON syntax errors in config (common trailing comma, etc.)
  • Removes orphaned process files
  • Restores corrupted memory files from git history
  • Rotates oversized log files

Options: --dry-run to preview, --aggressive for riskier fixes.

monitor — Continuous Watchdog

Runs in a loop, checking health every N seconds:

  • Logs findings to memory/self-healing-log.json
  • Auto-heals fixable issues
  • Escalates unfixable issues to the agent's main session
  • Tracks MTTR (mean time to recovery) and failure patterns

Options: --interval \x3Cseconds> (default: 300), --max-heals \x3Cn> per cycle.

report — Health Report

Generates a markdown health report covering:

  • Last 24h failure count and types
  • MTTR statistics
  • Most common failure modes
  • Recommendations for prevention

What It Monitors

Subsystem Checks Auto-Heals
Cron Failed runs, timeouts, consecutive errors Restart jobs, clear error state
Memory File sizes >1MB, growth rate, duplicates Archive old files, compact
Config JSON validity, required fields, deprecated keys Fix syntax, add defaults
Sessions Zombie processes, bloated contexts Kill zombies, archive contexts
Skills Syntax errors, missing deps, broken imports Log issue, skip broken skill
Network API endpoints, DNS, SSL certs Retry with backoff, switch endpoints

Healing Log

All actions are logged to memory/self-healing-log.json:

{
  "timestamp": "2026-04-05T06:00:00Z",
  "issue": "cron job 'daily-intel' failed 3 consecutive times",
  "diagnosis": "Script timeout — API rate limit hit",
  "action": "Reset error count, added 30s backoff, restarted",
  "result": "success",
  "mttr_seconds": 12
}
Usage Guidance
This skill appears coherent for auto-recovery of an OpenClaw agent, but it performs high-impact actions (editing configs, truncating/archiving files, restarting jobs, killing sessions). Before enabling automatic 'heal' or running as a monitor: 1) Review the entire scripts/self-healing-agent.py file (the provided snippet is truncated) for any network calls, remote endpoints, or commands that could exfiltrate data. 2) Run the script in --dry-run mode and inspect logs (use 'check' first). 3) Back up ~/.openclaw (config and memory) and test in a staging environment. 4) Prefer manual or moderated use of --aggressive fixes; avoid enabling autonomous continuous monitor without an audit. 5) Note the skill's source/homepage is unknown — lack of publisher info reduces trust; consider requesting provenance or a signed release from the author before granting this skill broad operational use.
Capability Analysis
Type: OpenClaw Skill Name: self-healing-agent Version: 1.0.0 The self-healing-agent skill is a maintenance utility designed to monitor and repair the OpenClaw environment. The main script, scripts/self-healing-agent.py, performs health checks on cron jobs, memory usage, and configuration files, offering automated fixes like restarting failed jobs or archiving bloated logs. All operations are confined to the ~/.openclaw directory, and network activity is limited to connectivity checks for standard AI API endpoints (Anthropic, OpenAI, Ollama) without data exfiltration.
Capability Assessment
Purpose & Capability
The name/description (self-recovery, cron/memory/config/session checks) matches the included script's behavior: it reads/writes ~/.openclaw files, queries and restarts jobs via the 'openclaw' CLI, archives memory files, and attempts JSON fixes. No unrelated credentials, binaries, or install artifacts are requested.
Instruction Scope
SKILL.md tells the agent to run the shipped Python script (check/heal/monitor/report). The script performs file I/O under ~/.openclaw, can truncate/archive files, restart cron jobs via subprocess calls, and (per SKILL.md) may kill zombie sessions. Those actions are within the stated purpose but are high‑impact: they modify config and session files and invoke system commands. SKILL.md also promises escalation to the main session and network checks — verify how escalation is implemented in the remaining code before enabling autonomous heals.
Install Mechanism
No install spec; this is instruction-only with a bundled Python script. Nothing is downloaded or installed automatically by the registry metadata, so no third‑party install URLs or archives to audit.
Credentials
The skill requests no environment variables or credentials. It operates on local OpenClaw paths (~/.openclaw) and calls the local 'openclaw' CLI. This access is proportionate to a self‑healing agent. Note: if the code invokes git, remote network calls, or other CLIs (not fully visible in the truncated file), that could broaden its needs — review the remainder of the script for any network/credential usage.
Persistence & Privilege
always:false and default autonomous invocation are set (normal). The monitor mode runs continuously and will auto-apply fixes if invoked; that autonomous ability plus the script's capability to modify files and processes increases blast radius. There is no evidence it modifies other skills' configurations or requests permanent registry-level privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install self-healing-agent
  3. After installation, invoke the skill by name or use /self-healing-agent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release — Self-recovery and auto-repair system for OpenClaw agents
Metadata
Slug self-healing-agent
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Self-Healing Agent?

Self-recovery and auto-repair system for OpenClaw agents. Monitors agent health, detects failures (crashed cron jobs, broken skills, config corruption, memor... It is an AI Agent Skill for Claude Code / OpenClaw, with 251 downloads so far.

How do I install Self-Healing Agent?

Run "/install self-healing-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Self-Healing Agent free?

Yes, Self-Healing Agent is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Self-Healing Agent support?

Self-Healing Agent is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Self-Healing Agent?

It is built and maintained by stevojarvisai-star (@stevojarvisai-star); the current version is v1.0.0.

💬 Comments