pub async fn retry_with_config<T, FutureFn, Fut>(
    config: &RetryConfig,
    operation: FutureFn,
) -> anyhow::Result<T>
where
    FutureFn: FnMut() -> Fut,
    Fut: Future<Output = anyhow::Result<T>>,
{
    let strategy = ExponentialBuilder::default()
        .with_min_delay(Duration::from_millis(config.min_delay_ms))
        .with_factor(config.backoff_factor as f32)
        .with_max_times(config.max_retry_attempts)
        .with_jitter();

    operation.retry(strategy).when(should_retry).await
}
Retry wrapper for operations that may fail with retryable errors
crates/forge_app/src/retry.rs