Implement RetryOrchestrator as the top-level coordinator that:
- Manages the full retry lifecycle per request
- Integrates backoff, error detection, provider selection
- Handles request deduplication via content hashing
- Supports both same-provider retry and cross-provider failover
- Emits structured attempt records for observability
Signed-off-by: Troy Mitchell <i@troy-y.org>
Implement ProviderSelector that determines the next provider
for retry attempts based on:
- Failover provider list with priority ordering
- Latency-blocked provider filtering
- Retry-After header honoring
- Round-robin and priority-based selection strategies
Signed-off-by: Troy Mitchell <i@troy-y.org>
Add three state management components:
- LatencyBlockStateManager: tracks providers blocked due to
high latency with configurable block duration and scope
- LatencyTriggerCounter: counts consecutive latency threshold
breaches before triggering provider blocking
- RetryAfterStateManager: honors Retry-After headers with
per-provider/model/endpoint blocking scope
Signed-off-by: Troy Mitchell <i@troy-y.org>
Implement RetryErrorResponseBuilder that constructs structured
JSON error responses when all retry attempts are exhausted,
including per-attempt error details and provider information.
Signed-off-by: Troy Mitchell <i@troy-y.org>
Add the retry module with core type definitions including:
- RequestContext, RequestSignature for request deduplication
- RetryExhaustedError, AllProvidersExhaustedError for error handling
- AttemptError, AttemptErrorType for attempt tracking
- ValidationError, ValidationWarning for config validation
- Helper functions for provider extraction and hashing
Wire up pub mod retry in lib.rs.
Signed-off-by: Troy Mitchell <i@troy-y.org>