multiAI Summary Pending

HTTP 重试技能

**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时

3,556 stars

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/http-retry/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/2233admin/http-retry/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/http-retry/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How HTTP 重试技能 Compares

Feature / AgentHTTP 重试技能Standard Approach
Platform SupportmultiLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时

Which AI agents support this skill?

This skill is compatible with multi.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# HTTP 重试技能

**触发词**: timeouterror, econnreset, econnrefused, 429, retry, http error, 网络超时

## 问题
网络请求失败(超时、连接重置、限流)导致服务不稳定

## 解决方案
指数退避 + 超时控制 + 连接池复用

```javascript
async function fetchWithRetry(url, options = {}, maxRetries = 3) {
  const { retryDelay = 1000, timeout = 30000 } = options;
  
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      const controller = new AbortController();
      const timeoutId = setTimeout(() => controller.abort(), timeout);
      const response = await fetch(url, { ...options, signal: controller.signal });
      clearTimeout(timeoutId);
      
      if (response.status === 429 || response.status >= 500) {
        await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt)));
        continue;
      }
      return response;
    } catch (err) {
      if (attempt === maxRetries) throw err;
      await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt)));
    }
  }
}
```