Skip to content
providerkit
GitHub

RetryAfterOutputPolicy

Defined in: agents/src/types.ts:110

Opt in to retrying a model call that failed transiently after chunks arrived, for runs whose stream nobody watches. The default keeps core’s invariant 1 (never retry after output). Each attempt is journaled and priced, counts toward treeLimits.modelCalls and limits.costUsd, and refuses agents or runs that declare hostedTools (invariant 19).

optional baseDelayMs?: number;

Defined in: agents/src/types.ts:115

Base delay in ms for full-jitter exponential backoff. Default 1,000.


optional maxDelayMs?: number;

Defined in: agents/src/types.ts:117

Maximum backoff delay in ms. Default 30,000.


maxRetries: number;

Defined in: agents/src/types.ts:113

Maximum transient mid-stream retries per model turn (not counting the initial attempt). Must be a positive integer up to 10.


optional sleep?: (ms, signal?) => Promise<void>;

Defined in: agents/src/types.ts:119

Custom sleep for tests. Not saved in snapshots.

Parameter Type
ms number
signal? AbortSignal

Promise<void>