Package:
@hexos/runtimeExecutes an async operation with exponential backoff retry on transient failures.
Retries the operation up to maxAttempts times. The delay between retries grows as
initialDelayMs * multiplier^attempt, capped at maxDelayMs. When jitter is enabled,
each delay is randomized by 50-100% to prevent thundering herd effects.
By default uses isRetryableError to determine if an error is retryable.
Override via the shouldRetry option for custom classification.
Used by AgentRuntime for LLM API calls and MCP server connections.
function retryWithBackoff<T>(operation: (attempt: number) => Promise<T>, options: RetryOptions): Promise<T>Parameters
operation
(attempt: number) => Promise