RetryPolicyContext
type RetryPolicyContext = object;Properties
Section titled “Properties”attempt
Section titled “attempt”attempt: number;The 1-based number of the failed attempt.
conversationId?
Section titled “conversationId?”readonly conversationId?: string;The conversation identifier carried by the failed request, when present.
error: unknown;The error thrown by the failed model attempt.
maxRetries
Section titled “maxRetries”maxRetries: number;The configured number of retries allowed after the initial attempt.
normalized
Section titled “normalized”normalized: ModelRetryNormalizedError;Generic normalized facts extracted from the error and provider advice.
previousResponseId?
Section titled “previousResponseId?”readonly previousResponseId?: string;The previous response identifier carried by the failed request, when present.
providerAdvice?
Section titled “providerAdvice?”providerAdvice?: ModelRetryAdvice;Optional provider guidance for the failure.
replaySafety?
Section titled “replaySafety?”readonly replaySafety?: "safe" | "unsafe" | "unknown";Stable provider replay classification captured before the policy runs. The runner always supplies this field; it is optional for compatibility with code that constructs policy contexts directly.
responseStarted?
Section titled “responseStarted?”readonly responseStarted?: boolean;Stable response-start evidence captured before the policy runs.
The runner preserves undefined when the provider supplies no evidence.
The field is optional for compatibility with code that constructs policy
contexts directly.
statefulRequest?
Section titled “statefulRequest?”readonly statefulRequest?: boolean;Whether the failed request carried a previous response or conversation identifier. The runner always supplies this field; it is optional for compatibility with code that constructs policy contexts directly.
stream
Section titled “stream”stream: boolean;Whether the failed request was streaming.