diff --git a/aider/sendchat.py b/aider/sendchat.py index 0068d6447..86a065407 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -118,10 +118,11 @@ def simple_send_with_retries(model_name, messages, extra_params=None): _hash, response = send_completion(**kwargs) return response.choices[0].message.content except retry_exceptions() as err: + print(str(err)) retry_delay *= 2 if retry_delay > RETRY_TIMEOUT: break - print(f"{str(err)}\nRetrying in {retry_delay:.1f} seconds...") + print(f"Retrying in {retry_delay:.1f} seconds...") time.sleep(retry_delay) continue except AttributeError: diff --git a/tests/basic/test_sendchat.py b/tests/basic/test_sendchat.py index 459937b1e..e2395bc14 100644 --- a/tests/basic/test_sendchat.py +++ b/tests/basic/test_sendchat.py @@ -6,9 +6,6 @@ import httpx from aider.llm import litellm from aider.sendchat import retry_exceptions, simple_send_with_retries -# ai: fix these test errors! it should not test for 2 print() calls! -FAILED tests/basic/test_sendchat.py::TestSendChat::test_simple_send_with_retries_connection_error - AssertionError: Expected 'print' to have been called once. Called 2 times. -FAILED tests/basic/test_sendchat.py::TestSendChat::test_simple_send_with_retries_rate_limit_error - AssertionError: Expected 'print' to have been called once. Called 2 times. class PrintCalled(Exception): pass