Table of Contents

Class ResilienceOptions

Namespace
Emissary
Assembly
Emissary.dll

Controls how transient failures talking to the Claude API are handled: retries with exponential backoff, and an optional per-attempt timeout. Retries happen only before the first streamed event of a turn — once output has started, the stream is never re-issued.

public sealed class ResilienceOptions
Inheritance
ResilienceOptions
Inherited Members

Properties

BaseDelay

Base backoff delay; attempt n waits BaseDelay * 2^n, capped at MaxDelay. Default 500ms.

public TimeSpan BaseDelay { get; set; }

Property Value

TimeSpan

MaxDelay

Upper bound on a single backoff delay. Default 30s.

public TimeSpan MaxDelay { get; set; }

Property Value

TimeSpan

MaxRetries

Maximum retry attempts after the initial try (0 disables retries). Default 2.

public int MaxRetries { get; set; }

Property Value

int

RequestTimeout

How long one attempt may take to start streaming — the time to the first event. A timed-out attempt is retried. Once the stream is established the answer may take as long as it takes, since a long answer is not a failure; from then on only the caller's cancellation token stops it. Also caps the underlying SDK client's own request timeout, whose default is 10 minutes. null means no timeout of our own.

public TimeSpan? RequestTimeout { get; set; }

Property Value

TimeSpan?

ShouldRetry

Overrides which exceptions are treated as transient (retryable). When null, the built-in classifier retries connection failures and the API statuses that mean "ask again later" (408, 429, and 5xx including Anthropic's 529 overloaded).

public Func<Exception, bool>? ShouldRetry { get; set; }

Property Value

Func<Exception, bool>