evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility for performing HTTP GET requests with automatic retries, exponential backoff, and attempt reporting so callers can reason about transient failures.
initialDelayMs of 100 and backoffFactor of 2, the onAttempt hook receives delays of 100 then 200 milliseconds for attempts 2 and 3 before a third-attempt success. @testattempts count that matches the retry-aware metadata from the HTTP client (for example, the x-fetch-attempts response header). @testmaxAttempts. @test/**
* Perform a GET request with configurable retries/backoff and attempt tracking.
* @param {string|URL} url - Target resource.
* @param {{
* maxAttempts?: number,
* initialDelayMs?: number,
* backoffFactor?: number,
* onAttempt?: (attempt: number, reason: Error|Response, nextDelayMs: number) => void,
* }} [options]
* Attempts are counted inclusively (the first request is attempt 1).
* @returns {Promise<{status: number, body: string, attempts: number, headers: Record<string, string>}>}
*/
export async function fetchWithResilience(url, options);Provides a fetch-compatible HTTP client with automatic retry/backoff.