Vereda
    Preparing search index...

    Interface CircuitBreakerConfig

    interface CircuitBreakerConfig {
        enabled?: boolean;
        failureThreshold?: number;
        window?: {
            sizeMs: number;
            failureRatePercent: number;
            minimumRequests: number;
        };
        resetTimeoutMs?: number;
        halfOpenMaxAttempts?: number;
        isFailure?: (error: AppError) => boolean;
    }
    Index
    enabled?: boolean

    Turns the breaker on. In 1.x a circuitBreaker without enabled: true is inert; in 2.0, setting circuitBreaker turns it on, as with retryBudget and rateLimit, and only enabled: false turns it off. Pass enabled explicitly, or remove a config you don't use, so 2.0 doesn't change your behavior.

    false
    
    failureThreshold?: number

    Consecutive-failure trip mode (default strategy).

    window?: { sizeMs: number; failureRatePercent: number; minimumRequests: number }

    Rolling-window trip mode. If set, used INSTEAD of failureThreshold.

    resetTimeoutMs?: number

    ms to stay open before allowing a half-open trial.

    halfOpenMaxAttempts?: number

    concurrent trial requests allowed while half-open.

    isFailure?: (error: AppError) => boolean

    Override default failure classification (network/timeout/retryable_status). Not consulted for an error that shows the attempt never reached the host (e.g. a body factory that threw before the request was dispatched) — those are always ignored, since there is no host-health signal to classify.