From da9facf036af9286f2da67344e7c55168e12d96a Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Mon, 13 Apr 2026 23:54:50 -0300 Subject: [PATCH] fix: add 5s connect_timeout to LLM HTTP client so unreachable APIs fail fast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without connect_timeout, reqwest can hang for the full 60s timeout when the remote server is unreachable (DNS, TCP connect, etc.). Now fails in 5s max for connection issues, 30s for full request. This means one user's LLM failure no longer blocks new users for a full minute — the channel closes quickly and the WebSocket is freed. Co-authored-by: Qwen-Coder --- src/llm/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llm/mod.rs b/src/llm/mod.rs index bb411f36..e254ea01 100644 --- a/src/llm/mod.rs +++ b/src/llm/mod.rs @@ -200,7 +200,8 @@ impl OpenAIClient { Self { client: reqwest::Client::builder() - .timeout(Duration::from_secs(60)) + .connect_timeout(Duration::from_secs(5)) + .timeout(Duration::from_secs(30)) .build() .unwrap_or_else(|_| reqwest::Client::new()), base_url: base,