{
  "id": "llm/rate-limit-with-retry-after-header-misread",
  "signature": "Error 429: Rate limit exceeded — Retry-After header missing or malformed",
  "signature_zh": "错误429：超过速率限制 — Retry-After标头缺失或格式错误",
  "regex": "429.*Rate limit|Retry-After missing|Retry-After malformed",
  "domain": "llm",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The API returns a 429 error with a missing or non-standard Retry-After header, causing automatic retry logic to fail or use incorrect wait times.",
  "root_cause_type": "generic",
  "root_cause_zh": "API返回429错误，但缺少Retry-After标头或标头不符合标准，导致自动重试逻辑失败或使用错误的等待时间。",
  "versions": [
    {
      "version": "openai==1.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "anthropic==0.30.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "requests==2.31.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "httpx==0.27.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gpt-4-turbo-2024-04-09",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "claude-3-opus-20240229",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hardcoding a fixed retry delay (e.g., 10 seconds) may be too short or too long, leading to repeated 429s or unnecessary waiting.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring the Retry-After header and using exponential backoff from scratch can cause multiple rapid retries that all fail.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Switching to a different HTTP library (e.g., from requests to httpx) doesn't fix missing headers from the server.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement a custom retry handler that first checks for Retry-After header; if missing, use a default exponential backoff (e.g., 1s, 2s, 4s) up to a max of 60 seconds.",
      "success_rate": 0.9,
      "how": "Implement a custom retry handler that first checks for Retry-After header; if missing, use a default exponential backoff (e.g., 1s, 2s, 4s) up to a max of 60 seconds.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a third-party retry library like `tenacity` with a custom retry condition that handles missing Retry-After headers gracefully.",
      "success_rate": 0.85,
      "how": "Use a third-party retry library like `tenacity` with a custom retry condition that handles missing Retry-After headers gracefully.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "实现一个自定义重试处理器，首先检查Retry-After标头；如果缺失，使用默认的指数退避（例如，1秒、2秒、4秒），最多60秒。",
    "使用第三方重试库如`tenacity`，配合自定义重试条件，优雅地处理缺失的Retry-After标头。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://platform.openai.com/docs/guides/rate-limits/error-mitigation",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.87,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}