OpenClaw SDK
    Preparing search index...

    Class ReconnectManager

    Reconnection manager with Fibonacci backoff and auth-aware retry logic.

    Features:

    • Fibonacci backoff with jitter
    • Separate retry limits for auth errors
    • Terminal auth errors stop reconnection immediately
    • Token refresh support for retryable auth errors
    Index

    Constructors

    Methods

    • Set a callback for handling errors thrown by reconnection event listeners.

      By default, listener errors are silently ignored to prevent one buggy listener from breaking the entire reconnection flow. Use this method to customize error handling (e.g., logging to error tracking service).

      Parameters

      Returns void

    • Start reconnection process.

      Parameters

      • connectFn: () => Promise<void>

        Function to call to attempt connection

      • OptionalrefreshTokenFn: () => Promise<RefreshResult | null>

        Optional function to refresh token

      Returns Promise<void>