[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75KZB0AF91BPF6YVRV5QCTS":3,"skill-same:01M75KZB0AF91BPF6YVRV5QCTS":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75KZB0AF91BPF6YVRV5QCTS","error-recovery-automation",null,"Standardize handling of common OpenClaw errors (gateway restart, browser service unavailable, cron failures) with automated recovery steps. Use when you need to automate detection and recovery from known failure modes, reducing manual intervention and increasing system resilience.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkonscious0beast\u002Ferror-recovery-automation\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: error-recovery-automation\ndescription: \"Standardize handling of common OpenClaw errors (gateway restart, browser service unavailable, cron failures) with automated recovery steps. Use when you need to automate detection and recovery from known failure modes, reducing manual intervention and increasing system resilience.\"\n---\n\n# Error Recovery Automation Skill\n\nThis skill provides patterns for automating the detection and recovery of common OpenClaw errors: gateway unresponsiveness, browser service failures, cron scheduler issues, and other recurring problems. It builds on health‑monitoring and system‑diagnostics by adding **automated recovery workflows** that can be triggered by cron jobs, heartbeat checks, or external monitoring.\n\n## When to use\n\n- A service (gateway, browser, cron) fails intermittently and you want to automate its restart.\n- You are setting up proactive monitoring and need a recovery plan beyond just detection.\n- You want to reduce the manual steps required when “Läuft alles?” reveals a failure.\n- You need to ensure critical OpenClaw components stay running with minimal user intervention.\n- You are asked to “create a skill for error recovery automation” (this is that skill).\n\n## Core patterns\n\n### 1. Error Detection Patterns\n\nBefore automating recovery, you must reliably detect the error. Use these detection methods:\n\n**Gateway unresponsive:**\n- `openclaw gateway status` returns non‑zero exit code or shows `\"running\": false`.\n- Gateway logs (`~\u002F.openclaw\u002Flogs\u002Fgateway.err.log`) contain recent `CRITICAL` or `ERROR` entries.\n- HTTP health endpoint (if configured) returns non‑2xx status.\n\n**Browser service unavailable:**\n- `openclaw browser --browser-profile openclaw status --json` shows `\"running\": false` or CDP not ready.\n- Browser logs contain connection timeouts or Chrome process failures.\n- Simple page load via `curl` to CDP endpoint fails.\n\n**Cron scheduler not running:**\n- `openclaw cron status` returns `\"running\": false` or error.\n- Cron logs show no recent activity.\n- Scheduled jobs are not triggered (check `openclaw cron list` for missed runs).\n\n**Memory search disabled:**\n- `memory_search` tool returns “disabled” or native‑module error.\n- `openclaw doctor --fix` reports better‑sqlite3 mismatch.\n\n**Permission errors:**\n- File operations fail with `EACCES`\u002F`EPERM`.\n- Logs indicate permission denied on specific paths (archive, logs, config).\n\n### 2. Automated Recovery Steps\n\nFor each error type, define a recovery script that attempts to restore service automatically. The script should:\n\n1. **Detect** the error (using the patterns above).\n2. **Attempt recovery** (restart service, fix permissions, rebuild module).\n3. **Verify** recovery (re‑run detection after a short wait).\n4. **Report outcome** (exit code 0 for success, non‑zero for persistent failure).\n\n#### Gateway Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"gateway\"\nMAX_ATTEMPTS=2\nSLEEP_SECONDS=5\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw gateway status > \u002Fdev\u002Fnull 2>&1\n}\n\nrestart() {\n  openclaw gateway restart\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE is healthy\"\n    exit 0\n  fi\n  log \"$SERVICE is unhealthy, restarting (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Browser Service Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"browser\"\nPROFILE=\"openclaw\"\nMAX_ATTEMPTS=2\nSLEEP_SECONDS=8\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw browser --browser-profile \"$PROFILE\" status --json 2>&1 | grep -q '\"running\":true'\n}\n\nrestart() {\n  openclaw browser --browser-profile \"$PROFILE\" stop\n  sleep 2\n  openclaw browser --browser-profile \"$PROFILE\" start\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE ($PROFILE) is healthy\"\n    exit 0\n  fi\n  log \"$SERVICE ($PROFILE) is unhealthy, restarting (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE ($PROFILE) could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Cron Scheduler Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"cron\"\nMAX_ATTEMPTS=1\nSLEEP_SECONDS=3\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw cron status 2>&1 | grep -q '\"running\":true'\n}\n\nrestart() {\n  # Cron is restarted automatically when gateway restarts.\n  # If cron is not running, restart gateway.\n  openclaw gateway restart\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE scheduler is running\"\n    exit 0\n  fi\n  log \"$SERVICE scheduler is not running, restarting gateway (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE scheduler still not running after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Memory Search Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"memory_search\"\nMAX_ATTEMPTS=1\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw memory search --query \"test\" 2>&1 | grep -q -v \"disabled\\|Module did not self-register\"\n}\n\nrestart() {\n  # Try rebuilding better‑sqlite3\n  cd \"$(dirname \"$(which openclaw)\")\u002F..\u002Flib\u002Fnode_modules\u002Fopenclaw\"\n  npm rebuild better-sqlite3\n  # Restart gateway to pick up the rebuilt module\n  openclaw gateway restart\n  sleep 5\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE is functional\"\n    exit 0\n  fi\n  log \"$SERVICE is disabled, rebuilding native module (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n### 3. Integration with Cron for Automated Recovery\n\nOnce you have a recovery script, schedule it as a cron job that runs **only when the service is likely to fail** (e.g., every 30 minutes for browser, every hour for gateway). Use an isolated agent session to execute the script and announce failures.\n\n**Example cron job for browser recovery:**\n\n```bash\nopenclaw cron add \\\n  --name \"Browser‑Recovery‑Automation\" \\\n  --schedule 'every 30 minutes' \\\n  --session isolated \\\n  --payload '{\"kind\":\"agentTurn\",\"message\":\"Run browser recovery automation script\",\"model\":\"default\",\"thinking\":\"low\"}' \\\n  --delivery '{\"mode\":\"announce\",\"channel\":\"telegram\"}'\n```\n\n**Agent response inside isolated session:** The agent reads the script (or inline logic) and executes it via `exec`. If the script exits with 0, the agent announces success; if non‑zero, the cron delivery forwards the failure message.\n\n**Alternative:** You can embed the recovery logic directly in the agent’s response (without a separate script) for simplicity, but a script is easier to test and reuse.\n\n### 4. Escalation When Automation Fails\n\nIf automated recovery fails after the maximum attempts, escalate:\n\n- **Log the failure** in `memory\u002FYYYY‑MM‑DD.md` with tag `error‑recovery‑failed`.\n- **Add a task** to `inbox\u002Fagent‑aufgaben.md` for manual diagnosis.\n- **Send a high‑priority notification** (if supported) to the user.\n- **Fallback to a safe state** (e.g., disable the problematic component if possible).\n\nExample escalation snippet:\n\n```bash\nif [ $? -ne 0 ]; then\n  echo \"Browser recovery failed. Adding manual diagnosis task.\"\n  # Append to agent-aufgaben.md\n  echo \"| 99 | Diagnose browser recovery failure – automated recovery failed after 2 attempts | ⬜ |\" >> inbox\u002Fagent-aufgaben.md\n  # Store in memory\n  echo \"## [error] Browser recovery automation failed\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Date: $(date +%Y-%m-%d)\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Tags: error, browser, recovery-failed\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Browser recovery script exited with code $?. Manual intervention required.\" >> memory\u002F$(date +%Y-%m-%d).md\nfi\n```\n\n### 5. Testing Recovery Scripts\n\nBefore deploying a recovery script as a cron job, test it manually:\n\n1. **Simulate the failure** (e.g., kill the gateway process, stop the browser service).\n2. **Run the recovery script** and verify it detects the failure and restarts the service.\n3. **Check that the service is functional** after recovery.\n4. **Verify logs** for any unintended side effects.\n\n**Example test command:**\n\n```bash\n# Stop browser service\nopenclaw browser --browser-profile openclaw stop\n\n# Run recovery script\n.\u002Fscripts\u002Fbrowser-recovery.sh\n\n# Verify browser is running\nopenclaw browser --browser-profile openclaw status --json | grep '\"running\":true'\n```\n\n## Examples\n\n### Example 1: Gateway Recovery Automation\n\nScript: `scripts\u002Fgateway-recovery.sh` (see template above). Cron schedule: every 1 hour. Announce only on failure.\n\n### Example 2: Browser Recovery Automation\n\nScript: `scripts\u002Fbrowser-recovery.sh` (see template above). Cron schedule: every 30 minutes. Announce only on failure.\n\n### Example 3: Combined Health‑Check + Recovery\n\nA single script that checks multiple services and recovers any that are unhealthy. Useful for a comprehensive “keep‑alive” cron job.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\n# Check gateway\nif ! openclaw gateway status > \u002Fdev\u002Fnull 2>&1; then\n  log \"Gateway unhealthy, restarting...\"\n  openclaw gateway restart\n  sleep 5\nfi\n\n# Check browser\nif ! openclaw browser --browser-profile openclaw status --json 2>&1 | grep -q '\"running\":true'; then\n  log \"Browser unhealthy, restarting...\"\n  openclaw browser --browser-profile openclaw stop\n  sleep 2\n  openclaw browser --browser-profile openclaw start\n  sleep 8\nfi\n\nlog \"All services healthy\"\nexit 0\n```\n\nSchedule this script every 30 minutes with an isolated agentTurn job.\n\n## Anti‑Patterns\n\n- **Over‑aggressive recovery:** Restarting a service too frequently can cause instability. Set reasonable intervals (≥30 minutes) and maximum attempts (≤2).\n- **Silent recovery:** If recovery succeeds but you never hear about it, you might not know the service was failing. At minimum, log recovery events to memory\u002F files.\n- **No verification:** Restarting a service without verifying it actually recovered can mask deeper issues. Always re‑check after restart.\n- **Hard‑coded assumptions:** Avoid assuming a specific Node version, path, or user ID. Use environment variables or detect them at runtime.\n- **Ignoring dependencies:** Browser depends on gateway; restarting browser while gateway is down will fail. Check dependencies in order.\n- **Automating unsafe actions:** Do not automate deletion of logs, modification of critical configs, or any irreversible action without a rollback plan.\n\n## Related Patterns\n\n- **Health‑Monitoring skill** – proactive health checks and monitoring.\n- **System‑Diagnostics skill** – diagnosing root causes of failures.\n- **Cron‑Job Creation playbook** – creating scheduled jobs.\n- **Gateway Health Check and Recovery playbook** – specific to gateway.\n- **Browser Service Health Monitoring and Recovery playbook** – specific to browser.\n- **Maintenance Execution playbook** – incorporating recovery into regular maintenance.\n\n## References\n\n- `scripts\u002Fgateway-recovery.sh` (template)\n- `scripts\u002Fbrowser-recovery.sh` (template)\n- `scripts\u002Fcron-recovery.sh` (template)\n- `skills\u002Fhealth-monitoring\u002FSKILL.md`\n- `skills\u002Fsystem-diagnostics\u002FSKILL.md`\n- `docs\u002FMAINTENANCE.md`\n- `memory\u002Fpatterns\u002Fplaybooks.md`\n- `openclaw cron --help`\n- `openclaw gateway --help`\n- `openclaw browser --help`\n\n## Skill Integration\n\nWhen an OpenClaw error occurs (gateway, browser, cron, memory search), read this skill to create or run an automated recovery script. Store successful recovery patterns in `memory\u002Fpatterns\u002Ftools.md`. Update `pending.md` if automation fails and manual intervention is needed.\n\nThis skill increases autonomy by providing standardized, automated recovery workflows for common failures, reducing the need for manual intervention and increasing system resilience.","# Error Recovery Automation Skill\n\nThis skill provides patterns for automating the detection and recovery of common OpenClaw errors: gateway unresponsiveness, browser service failures, cron scheduler issues, and other recurring problems. It builds on health‑monitoring and system‑diagnostics by adding **automated recovery workflows** that can be triggered by cron jobs, heartbeat checks, or external monitoring.\n\n## When to use\n\n- A service (gateway, browser, cron) fails intermittently and you want to automate its restart.\n- You are setting up proactive monitoring and need a recovery plan beyond just detection.\n- You want to reduce the manual steps required when “Läuft alles?” reveals a failure.\n- You need to ensure critical OpenClaw components stay running with minimal user intervention.\n- You are asked to “create a skill for error recovery automation” (this is that skill).\n\n## Core patterns\n\n### 1. Error Detection Patterns\n\nBefore automating recovery, you must reliably detect the error. Use these detection methods:\n\n**Gateway unresponsive:**\n- `openclaw gateway status` returns non‑zero exit code or shows `\"running\": false`.\n- Gateway logs (`~\u002F.openclaw\u002Flogs\u002Fgateway.err.log`) contain recent `CRITICAL` or `ERROR` entries.\n- HTTP health endpoint (if configured) returns non‑2xx status.\n\n**Browser service unavailable:**\n- `openclaw browser --browser-profile openclaw status --json` shows `\"running\": false` or CDP not ready.\n- Browser logs contain connection timeouts or Chrome process failures.\n- Simple page load via `curl` to CDP endpoint fails.\n\n**Cron scheduler not running:**\n- `openclaw cron status` returns `\"running\": false` or error.\n- Cron logs show no recent activity.\n- Scheduled jobs are not triggered (check `openclaw cron list` for missed runs).\n\n**Memory search disabled:**\n- `memory_search` tool returns “disabled” or native‑module error.\n- `openclaw doctor --fix` reports better‑sqlite3 mismatch.\n\n**Permission errors:**\n- File operations fail with `EACCES`\u002F`EPERM`.\n- Logs indicate permission denied on specific paths (archive, logs, config).\n\n### 2. Automated Recovery Steps\n\nFor each error type, define a recovery script that attempts to restore service automatically. The script should:\n\n1. **Detect** the error (using the patterns above).\n2. **Attempt recovery** (restart service, fix permissions, rebuild module).\n3. **Verify** recovery (re‑run detection after a short wait).\n4. **Report outcome** (exit code 0 for success, non‑zero for persistent failure).\n\n#### Gateway Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"gateway\"\nMAX_ATTEMPTS=2\nSLEEP_SECONDS=5\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw gateway status > \u002Fdev\u002Fnull 2>&1\n}\n\nrestart() {\n  openclaw gateway restart\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE is healthy\"\n    exit 0\n  fi\n  log \"$SERVICE is unhealthy, restarting (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Browser Service Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"browser\"\nPROFILE=\"openclaw\"\nMAX_ATTEMPTS=2\nSLEEP_SECONDS=8\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw browser --browser-profile \"$PROFILE\" status --json 2>&1 | grep -q '\"running\":true'\n}\n\nrestart() {\n  openclaw browser --browser-profile \"$PROFILE\" stop\n  sleep 2\n  openclaw browser --browser-profile \"$PROFILE\" start\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE ($PROFILE) is healthy\"\n    exit 0\n  fi\n  log \"$SERVICE ($PROFILE) is unhealthy, restarting (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE ($PROFILE) could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Cron Scheduler Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"cron\"\nMAX_ATTEMPTS=1\nSLEEP_SECONDS=3\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw cron status 2>&1 | grep -q '\"running\":true'\n}\n\nrestart() {\n  # Cron is restarted automatically when gateway restarts.\n  # If cron is not running, restart gateway.\n  openclaw gateway restart\n  sleep \"$SLEEP_SECONDS\"\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE scheduler is running\"\n    exit 0\n  fi\n  log \"$SERVICE scheduler is not running, restarting gateway (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE scheduler still not running after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n#### Memory Search Recovery Script Template\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nSERVICE=\"memory_search\"\nMAX_ATTEMPTS=1\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\ncheck() {\n  openclaw memory search --query \"test\" 2>&1 | grep -q -v \"disabled\\|Module did not self-register\"\n}\n\nrestart() {\n  # Try rebuilding better‑sqlite3\n  cd \"$(dirname \"$(which openclaw)\")\u002F..\u002Flib\u002Fnode_modules\u002Fopenclaw\"\n  npm rebuild better-sqlite3\n  # Restart gateway to pick up the rebuilt module\n  openclaw gateway restart\n  sleep 5\n}\n\nattempt=0\nwhile [ $attempt -lt $MAX_ATTEMPTS ]; do\n  if check; then\n    log \"$SERVICE is functional\"\n    exit 0\n  fi\n  log \"$SERVICE is disabled, rebuilding native module (attempt $((attempt+1))\u002F$MAX_ATTEMPTS)...\"\n  restart\n  ((attempt++))\ndone\n\nlog \"$SERVICE could not be recovered after $MAX_ATTEMPTS attempts\"\nexit 1\n```\n\n### 3. Integration with Cron for Automated Recovery\n\nOnce you have a recovery script, schedule it as a cron job that runs **only when the service is likely to fail** (e.g., every 30 minutes for browser, every hour for gateway). Use an isolated agent session to execute the script and announce failures.\n\n**Example cron job for browser recovery:**\n\n```bash\nopenclaw cron add \\\n  --name \"Browser‑Recovery‑Automation\" \\\n  --schedule 'every 30 minutes' \\\n  --session isolated \\\n  --payload '{\"kind\":\"agentTurn\",\"message\":\"Run browser recovery automation script\",\"model\":\"default\",\"thinking\":\"low\"}' \\\n  --delivery '{\"mode\":\"announce\",\"channel\":\"telegram\"}'\n```\n\n**Agent response inside isolated session:** The agent reads the script (or inline logic) and executes it via `exec`. If the script exits with 0, the agent announces success; if non‑zero, the cron delivery forwards the failure message.\n\n**Alternative:** You can embed the recovery logic directly in the agent’s response (without a separate script) for simplicity, but a script is easier to test and reuse.\n\n### 4. Escalation When Automation Fails\n\nIf automated recovery fails after the maximum attempts, escalate:\n\n- **Log the failure** in `memory\u002FYYYY‑MM‑DD.md` with tag `error‑recovery‑failed`.\n- **Add a task** to `inbox\u002Fagent‑aufgaben.md` for manual diagnosis.\n- **Send a high‑priority notification** (if supported) to the user.\n- **Fallback to a safe state** (e.g., disable the problematic component if possible).\n\nExample escalation snippet:\n\n```bash\nif [ $? -ne 0 ]; then\n  echo \"Browser recovery failed. Adding manual diagnosis task.\"\n  # Append to agent-aufgaben.md\n  echo \"| 99 | Diagnose browser recovery failure – automated recovery failed after 2 attempts | ⬜ |\" >> inbox\u002Fagent-aufgaben.md\n  # Store in memory\n  echo \"## [error] Browser recovery automation failed\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Date: $(date +%Y-%m-%d)\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Tags: error, browser, recovery-failed\" >> memory\u002F$(date +%Y-%m-%d).md\n  echo \"Browser recovery script exited with code $?. Manual intervention required.\" >> memory\u002F$(date +%Y-%m-%d).md\nfi\n```\n\n### 5. Testing Recovery Scripts\n\nBefore deploying a recovery script as a cron job, test it manually:\n\n1. **Simulate the failure** (e.g., kill the gateway process, stop the browser service).\n2. **Run the recovery script** and verify it detects the failure and restarts the service.\n3. **Check that the service is functional** after recovery.\n4. **Verify logs** for any unintended side effects.\n\n**Example test command:**\n\n```bash\n# Stop browser service\nopenclaw browser --browser-profile openclaw stop\n\n# Run recovery script\n.\u002Fscripts\u002Fbrowser-recovery.sh\n\n# Verify browser is running\nopenclaw browser --browser-profile openclaw status --json | grep '\"running\":true'\n```\n\n## Examples\n\n### Example 1: Gateway Recovery Automation\n\nScript: `scripts\u002Fgateway-recovery.sh` (see template above). Cron schedule: every 1 hour. Announce only on failure.\n\n### Example 2: Browser Recovery Automation\n\nScript: `scripts\u002Fbrowser-recovery.sh` (see template above). Cron schedule: every 30 minutes. Announce only on failure.\n\n### Example 3: Combined Health‑Check + Recovery\n\nA single script that checks multiple services and recovers any that are unhealthy. Useful for a comprehensive “keep‑alive” cron job.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\n\n# Check gateway\nif ! openclaw gateway status > \u002Fdev\u002Fnull 2>&1; then\n  log \"Gateway unhealthy, restarting...\"\n  openclaw gateway restart\n  sleep 5\nfi\n\n# Check browser\nif ! openclaw browser --browser-profile openclaw status --json 2>&1 | grep -q '\"running\":true'; then\n  log \"Browser unhealthy, restarting...\"\n  openclaw browser --browser-profile openclaw stop\n  sleep 2\n  openclaw browser --browser-profile openclaw start\n  sleep 8\nfi\n\nlog \"All services healthy\"\nexit 0\n```\n\nSchedule this script every 30 minutes with an isolated agentTurn job.\n\n## Anti‑Patterns\n\n- **Over‑aggressive recovery:** Restarting a service too frequently can cause instability. Set reasonable intervals (≥30 minutes) and maximum attempts (≤2).\n- **Silent recovery:** If recovery succeeds but you never hear about it, you might not know the service was failing. At minimum, log recovery events to memory\u002F files.\n- **No verification:** Restarting a service without verifying it actually recovered can mask deeper issues. Always re‑check after restart.\n- **Hard‑coded assumptions:** Avoid assuming a specific Node version, path, or user ID. Use environment variables or detect them at runtime.\n- **Ignoring dependencies:** Browser depends on gateway; restarting browser while gateway is down will fail. Check dependencies in order.\n- **Automating unsafe actions:** Do not automate deletion of logs, modification of critical configs, or any irreversible action without a rollback plan.\n\n## Related Patterns\n\n- **Health‑Monitoring skill** – proactive health checks and monitoring.\n- **System‑Diagnostics skill** – diagnosing root causes of failures.\n- **Cron‑Job Creation playbook** – creating scheduled jobs.\n- **Gateway Health Check and Recovery playbook** – specific to gateway.\n- **Browser Service Health Monitoring and Recovery playbook** – specific to browser.\n- **Maintenance Execution playbook** – incorporating recovery into regular maintenance.\n\n## References\n\n- `scripts\u002Fgateway-recovery.sh` (template)\n- `scripts\u002Fbrowser-recovery.sh` (template)\n- `scripts\u002Fcron-recovery.sh` (template)\n- `skills\u002Fhealth-monitoring\u002FSKILL.md`\n- `skills\u002Fsystem-diagnostics\u002FSKILL.md`\n- `docs\u002FMAINTENANCE.md`\n- `memory\u002Fpatterns\u002Fplaybooks.md`\n- `openclaw cron --help`\n- `openclaw gateway --help`\n- `openclaw browser --help`\n\n## Skill Integration\n\nWhen an OpenClaw error occurs (gateway, browser, cron, memory search), read this skill to create or run an automated recovery script. Store successful recovery patterns in `memory\u002Fpatterns\u002Ftools.md`. Update `pending.md` if automation fails and manual intervention is needed.\n\nThis skill increases autonomy by providing standardized, automated recovery workflows for common failures, reducing the need for manual intervention and increasing system resilience.",{"name":5,"description":7},"main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fkonscious0beast\u002Ferror-recovery-automation",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill error-recovery-automation",{"tool":39,"command":40},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill error-recovery-automation",{"tool":42,"command":43},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill error-recovery-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fkonscious0beast\u002Ferror-recovery-automation\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]