Retry
ModelRetryBackoffSettings
Backoff configuration for runner-managed model retries.
Source code in src/agents/retry.py
initial_delay
class-attribute
instance-attribute
Delay in seconds before the first retry attempt.
max_delay
class-attribute
instance-attribute
Maximum delay in seconds between retry attempts.
multiplier
class-attribute
instance-attribute
Multiplier applied after each retry attempt.
ModelRetryNormalizedError
dataclass
Normalized error facts exposed to retry policies.
Source code in src/agents/retry.py
ModelRetryAdvice
dataclass
Provider-specific retry guidance returned by model adapters.
Source code in src/agents/retry.py
ModelRetryAdviceRequest
dataclass
Context passed to a model adapter when deriving retry advice.
Source code in src/agents/retry.py
RetryDecision
dataclass
Explicit retry decision returned by retry policies.
Source code in src/agents/retry.py
approve_unsafe_replay
class-attribute
instance-attribute
Explicit application approval to replay a request the provider marked replay-unsafe.
This is deliberately separate from retry: an ordinary RetryDecision(retry=True)
never bypasses replay protection. Set this only for workloads where repeating
provider-side work that may already have happened is acceptable.
RetryPolicyContext
dataclass
Context passed to runtime retry policy callbacks.
Source code in src/agents/retry.py
response_started
property
Whether the provider had begun emitting the response when the failure occurred.
replay_safety
property
Provider replay classification: "safe", "unsafe" or "unknown".
ModelRetrySettings
Opt-in runner-managed retry settings for model calls.
Source code in src/agents/retry.py
max_retries
class-attribute
instance-attribute
Retries allowed after the initial model request.
backoff
class-attribute
instance-attribute
Backoff settings applied when the policy retries without an explicit delay.