Problem
HttpClient has no retry logic. Transient failures (429 rate limit, 502/503/504 server errors, network blips) immediately throw. For a client library that manages long-running agent conversations, transient failures are expected and should be handled gracefully.
Proposed Fix
Add configurable retry with exponential backoff:
interface HttpClientOptions {
baseUrl: string;
apiKey?: string;
timeout?: number;
retry?: {
maxRetries?: number; // default: 3
baseDelay?: number; // default: 1000ms
maxDelay?: number; // default: 30000ms
retryableStatuses?: number[]; // default: [429, 502, 503, 504]
};
}
- Retry only idempotent requests (GET) by default, with opt-in for POST
- Use exponential backoff with jitter:
delay = min(baseDelay * 2^attempt + random_jitter, maxDelay)
- Respect
Retry-After header from 429 responses
- Support
AbortSignal to cancel retries
Impact
Medium — improves reliability for production deployments where transient failures are common.
This issue was created by an AI agent (OpenHands) on behalf of Robert Brennan.
Problem
HttpClienthas no retry logic. Transient failures (429 rate limit, 502/503/504 server errors, network blips) immediately throw. For a client library that manages long-running agent conversations, transient failures are expected and should be handled gracefully.Proposed Fix
Add configurable retry with exponential backoff:
delay = min(baseDelay * 2^attempt + random_jitter, maxDelay)Retry-Afterheader from 429 responsesAbortSignalto cancel retriesImpact
Medium — improves reliability for production deployments where transient failures are common.
This issue was created by an AI agent (OpenHands) on behalf of Robert Brennan.