From 4841f318c1d99cb7948b1a8e0ba9d447f1fe34d2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 11 May 2024 15:01:56 -0700 Subject: [PATCH] always retry httpx errors --- aider/sendchat.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aider/sendchat.py b/aider/sendchat.py index 126bb50de..00833a27a 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -20,6 +20,13 @@ def should_giveup(e): if not hasattr(e, "status_code"): return False + if type(e) in ( + httpx.ConnectError, + httpx.RemoteProtocolError, + httpx.ReadTimeout, + ): + return False + return not litellm._should_retry(e.status_code)