← 返回
未分类 中文

Skill Error Recovery

Detect, attempt recovery from, report, and log errors to prevent silent data loss and ensure proper human intervention when needed.
检测、尝试恢复、报告并记录错误,防止数据静默丢失,确保必要时人工介入。
aptratcn aptratcn 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 349
下载
💾 0
安装
1
版本
#debugging#error-handling#latest#reliability

概述

Error Recovery 🚨

4R framework. Never lose work silently.

The 4 Rs

R1: RECOGNIZE  → Did something go wrong?
R2: RESCUE     → Can I recover automatically?
R3: REPORT     → Does the human need to know?
R4: REMEMBER   → What should I learn from this?

R1: RECOGNIZE (Don't Ignore Errors)

Error signals I must not ignore:

□ Command exit code ≠ 0
□ Exception thrown
□ Timeout exceeded
□ Empty/unexpected output
□ "error", "failed", "exception" in logs
□ Behavior different from expected

Anti-patterns:

  • ❌ Command failed, but I continue anyway
  • ❌ Error logged, but not mentioned in my response
  • ❌ "Probably fine" without verification

What to do:

  1. Stop and acknowledge the error
  2. Read the full error message
  3. Check if it's recoverable or needs human input

R2: RESCUE (Can I Fix It?)

Automatic recovery strategies:

Error TypeRecovery Strategy
-------------------------------
Network timeoutRetry with exponential backoff (max 3)
Rate limitWait and retry
Missing dependencyInstall/suggest installation
Permission deniedSuggest elevated permissions or fix
File not foundCreate or point to correct path
Invalid inputSanitize or request correct input
API errorCheck status, retry if transient

Retry protocol:

Attempt 1: Immediate
Attempt 2: Wait 5 seconds
Attempt 3: Wait 15 seconds
If all fail → Report to human

When NOT to auto-retry:

  • Authentication errors (wrong credentials)
  • Permission errors (needs human action)
  • Data validation errors (needs correct input)
  • Destructive operation failures (don't risk double-execution)

R3: REPORT (Does Human Need to Know?)

Always report when:

  • Auto-recovery failed after 3 attempts
  • Error affects the final outcome
  • Human action is required
  • Something unexpected happened

Report format:

⚠️ Error encountered: [brief description]

What happened:
[What I was doing]

Error details:
[Full error message]

What I tried:
[Recovery attempts made]

Current state:
[What's broken / what's still working]

What I need:
[What human action is needed, if any]

Example:

⚠️ Error encountered: GitHub push failed

What happened:
Pushing to aptratcn/cognitive-debt-guard

Error details:
fatal: could not read Username for 'https://github.com'

What I tried:
1. Retried push (failed)
2. Checked git remote config

Current state:
- Commit is saved locally
- Not pushed to remote

What I need:
Git credentials not configured. Will try using token auth.

R4: REMEMBER (Learn From Errors)

After error recovery:

□ Did this error happen before?
  → If yes, what's the pattern?
  → Document the fix

□ Could this happen again?
  → Add guard for this case
  → Update skill/workflow

□ Is there a systemic issue?
  → Suggest process improvement
  → Update AGENTS.md if needed

Error log:

memory/errors/YYYY-MM-DD.md

## [Error Type] - [Timestamp]

**Context:** What I was doing
**Error:** Full error message
**Cause:** Root cause (if known)
**Fix:** How I resolved it
**Prevention:** How to avoid in future

Quick Reference

ERROR → STOP → READ ERROR → CAN I FIX?
                                 ↓
        NO → REPORT to human → WAIT for action
        YES → FIX → VERIFY → CONTINUE
                      ↓
                   Still broken? → REPORT

Trigger Phrases

  • "error", "failed", "crash"
  • "something went wrong", "exception"
  • "retry", "try again"
  • "报错", "失败", "错误"

Integration

  • EVR Framework — Verify after recovery
  • Systematic Debugging — When root cause is unknown
  • Workflow Checkpoint — Save state before risky operations

License

MIT

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 17:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 30,998
dev-programming

Systematic Debugging

aptratcn
系统性调试:四阶段根本原因流程,不盲目猜测,不随机修复,追踪证据、定位根因、系统性修复。
★ 0 📥 582
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 31,038