Xpersona
E

Error Recovery

CLAWHUB · Unverified

Error Recovery - Strategies for handling failures gracefully Skill: Error Recovery Owner: hanxiao-bot Summary: Error Recovery - Strategies for handling failures gracefully Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-02T15:47:24.111Z | auto - Initial release of the error-recovery skill. - Documents common OpenClaw error types and recommended recovery strategies. - Provides JavaScript code patterns for retry with backoff, graceful degradation, and circuit breaker. - Det

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s177wn48nxdm9a73g3sj4awv1583gddz:error-recovery
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-hanxiao-bot-error-recovery/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

5,772 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: error-recovery
description: Error Recovery - Strategies for handling failures gracefully
---

# Error Recovery - Handling Failures Gracefully

## OpenClaw Error Types

| Error | Cause | Recovery |
|-------|-------|----------|
| 429 Rate Limit | Too many requests | Wait + retry with backoff |
| 402 Billing | API credits exhausted | Switch model or wait |
| 503 Overloaded | Provider busy | Wait + retry |
| Context Overflow | Context window full | Trigger compaction |
| Role Ordering | Corrupted session | Reset session |
| Transient HTTP | Network issue | Auto-retry (built-in) |

## Error Handling Patterns

### Pattern 1: Retry with Backoff

```javascript
async function retryWithBackoff(fn, maxAttempts = 3) {
  for (let i = 0; i < maxAttempts; i++) {
    try {
      return await fn();
    } catch (err) {
      if (isRetryable(err) && i < maxAttempts - 1) {
        await sleep(1000 * Math.pow(2, i)); // 1s, 2s, 4s
        continue;
      }
      throw err;
    }
  }
}
```

### Pattern 2: Graceful Degradation

```javascript
async function withFallback(primary, fallback) {
  try {
    return await primary();
  } catch (err) {
    console.warn("Primary failed, trying fallback:", err.message);
    return await fallback();
  }
}

// Usage
const result = await withFallback(
  () => callExpensiveModel(msg),
  () => callCheapModel(msg)
);
```

### Pattern 3: Circuit Breaker

```javascript
class CircuitBreaker {
  constructor(fn, threshold = 3) {
    this.fn = fn;
    this.failures = 0;
    this.threshold = threshold;
    this.state = "closed"; // open/closed/half-open
  }

  async execute() {
    if (this.state === "open") {
      throw new Error("Circuit breaker open");
    }
    try {
      const result = await this.fn();
      this.failures = 0;
      this.state = "closed";
      return result;
    } catch (err) {
      this.failures++;
      if (this.failures >= this.threshold) {
        this.state = "open";
      }
      throw err;
    }
  }
}
```

## Tool Failure Handling

Tools in OpenClaw are **non-fatal** — if a tool fails, the agent continues:

```javascript
// In agent-runner, tool errors are caught but don't stop execution
.catch((err) => {
  log(`Tool ${toolName} failed: ${err.message}`);
  // Continue execution
});
```

## Session Corruption Recovery

If session becomes corrupted:

1. **Detection**: Role ordering errors, malformed messages
2. **Action**: Session auto-reset by OpenClaw
3. **Recovery**: Fresh session, context preserved via MEMORY.md

## Built-in Recovery Mechanisms

| Mechanism | Trigger | Action |
|----------|---------|--------|
| Auto-retry | 408/429/5xx | Exponential backoff |
| Context overflow | Token limit | Trigger compaction |
| Session corruption | Role error | Reset session |
| Model switch | persistent failure | Fallback model |

## Best Practices

1. **Don't suppress errors silently** — log them
2. **Prefer retries for transient failures** — network/timeout
3. **Reset for corruption** — don't try to fix corr

_meta.json

{
  "ownerId": "kn70vha5hn6te369fgm7bvmq8582hbrq",
  "slug": "error-recovery",
  "version": "1.0.0",
  "publishedAt": 1775144844111
}

skill-card.md

## Description:

Error Recovery - Strategies for handling failures gracefully

This skill is ready for commercial/non-commercial use.

## Publisher:

[hanxiao-bot](https://clawhub.ai/user/hanxiao-bot)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill to guide agents through resilient handling of rate limits, billing failures, provider overload, context overflow, role-ordering corruption, transient HTTP failures, and tool errors.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Sensitive or unnecessary private data may be placed into MEMORY.md when following session recovery advice.

Mitigation: Avoid storing secrets or unnecessary private data in MEMORY.md, and review memory content before use or sharing.

Risk: Recovery patterns can hide persistent failures if errors are suppressed or retries are unbounded.

Mitigation: Log failures, keep retries bounded, use fallback or circuit breaker behavior, and escalate persistent errors for review.

## Reference(s):

- [ClawHub Skill Page](https://clawhub.ai/hanxiao-bot/skills/error-recovery)

## Skill Output:

**Output Type(s):** [guidance, markdown, code]

**Output Format:** [Markdown guidance with JavaScript code examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Provides retry, fallback, circuit breaker, tool failure, and session recovery patterns.]

## Skill Version(s):

1.0.0 (source: release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Error Recovery and adjacent AI workflows.