Provider retry, backoff, fallback, and streaming dispatch logic.
Handles exponential backoff with full jitter, retryable error
classification, fallback provider chains, and receive-timeout
injection. Extracted from Alloy.Agent.Turn to separate
provider-oriented concerns from agent loop control flow.
Summary
Functions
Call a provider with retry, backoff, and fallback logic.
Functions
@spec call_with_retry( Alloy.Agent.State.t(), module(), map(), boolean(), function(), integer() ) :: {:ok, map()} | {:error, term()}
Call a provider with retry, backoff, and fallback logic.
Single entry point for all provider calls. Retries on transient errors with exponential backoff and jitter, then falls back to configured fallback providers if the primary provider fails.
Returns {:ok, response} or {:error, reason}.