Retries a 5xx or 429 response with exponential backoff and jitter,
honoring a server-sent Retry-After ahead of its own schedule. Never
retries any other 4xx -- those won't succeed on a second attempt, and
retrying only delays the real error reaching the caller
(rules/sdk-generation.md's "Client shape").
Implemented as a wrapper around openapi-fetch's own fetch option
((input: Request) => Promise<Response>) rather than as middleware:
middleware's onResponse hook can inspect a response but has no way to
re-issue the underlying request, so the retry loop has to live where
the actual network call happens. This is the same shape the Go SDK
gets from wrapping http.RoundTripper.
Retries a 5xx or 429 response with exponential backoff and jitter, honoring a server-sent Retry-After ahead of its own schedule. Never retries any other 4xx -- those won't succeed on a second attempt, and retrying only delays the real error reaching the caller (rules/sdk-generation.md's "Client shape").
Implemented as a wrapper around openapi-fetch's own
fetchoption ((input: Request) => Promise<Response>) rather than as middleware: middleware'sonResponsehook can inspect a response but has no way to re-issue the underlying request, so the retry loop has to live where the actual network call happens. This is the same shape the Go SDK gets from wrappinghttp.RoundTripper.