Skip to content

As a developer I want jitter added to Anthropic API retry backoff so I can prevent thundering-herd during outages #239

@ChristopherRotnes

Description

@ChristopherRotnes

Summary

The retry loop in claude.js uses a plain exponential backoff (2^attempt * 1000ms) with no jitter. During an Anthropic 529 overload with many concurrent users, all clients would retry at the same intervals, creating synchronized burst traffic rather than spreading load. Adding randomized jitter is a minor, low-risk change that improves resilience.

Priority

Low

Acceptance criteria

  • Retry delay uses exponential backoff with random jitter, e.g. (2 ** attempt * 1000) + Math.random() * 500
  • Maximum delay is still capped at a reasonable ceiling (e.g. 32s)
  • Existing retry behavior on 529 is otherwise unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions