From 548466df0928bf031be13088096588a33d8de4a6 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 7 Aug 2025 15:23:31 -0700 Subject: [PATCH] [client] Tune retries and backoff (#1956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary 10 is a bit excessive 😅 Also updates our backoff factor to space out requests further. --- codex-rs/core/src/model_provider_info.rs | 2 +- codex-rs/core/src/util.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/model_provider_info.rs b/codex-rs/core/src/model_provider_info.rs index a9802111..887917f4 100644 --- a/codex-rs/core/src/model_provider_info.rs +++ b/codex-rs/core/src/model_provider_info.rs @@ -15,7 +15,7 @@ use std::time::Duration; use crate::error::EnvVarError; const DEFAULT_STREAM_IDLE_TIMEOUT_MS: u64 = 300_000; -const DEFAULT_STREAM_MAX_RETRIES: u64 = 10; +const DEFAULT_STREAM_MAX_RETRIES: u64 = 5; const DEFAULT_REQUEST_MAX_RETRIES: u64 = 4; /// Wire protocol that the provider speaks. Most third-party services only diff --git a/codex-rs/core/src/util.rs b/codex-rs/core/src/util.rs index 5ba1e256..fb5f45de 100644 --- a/codex-rs/core/src/util.rs +++ b/codex-rs/core/src/util.rs @@ -7,7 +7,7 @@ use tokio::sync::Notify; use tracing::debug; const INITIAL_DELAY_MS: u64 = 200; -const BACKOFF_FACTOR: f64 = 1.3; +const BACKOFF_FACTOR: f64 = 2.0; /// Make a CancellationToken that is fulfilled when SIGINT occurs. pub fn notify_on_sigint() -> Arc {