diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index a69f23241..ae596fd18 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -70,6 +70,7 @@ class Coder: lint_outcome = None test_outcome = None multi_response_content = "" + partial_response_content = "" @classmethod def create( @@ -907,12 +908,7 @@ class Coder: if retry_delay > 60: break self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...") - countdown = retry_delay - while countdown > 0: - print(f"Retrying in {countdown:.1f} seconds...\r", end="") - time.sleep(0.1) - countdown -= 0.1 - print(" " * 50 + "\r", end="") # Clear the line after countdown + time.sleep(retry_delay) continue except KeyboardInterrupt: interrupted = True diff --git a/tests/basic/test_sendchat.py b/tests/basic/test_sendchat.py deleted file mode 100644 index 6ac02a47b..000000000 --- a/tests/basic/test_sendchat.py +++ /dev/null @@ -1,47 +0,0 @@ -import unittest -from unittest.mock import MagicMock, patch - -import httpx - -from aider.llm import litellm -from aider.sendchat import send_with_retries - - -class PrintCalled(Exception): - pass - - -class TestSendChat(unittest.TestCase): - @patch("litellm.completion") - @patch("builtins.print") - def test_send_with_retries_rate_limit_error(self, mock_print, mock_completion): - mock = MagicMock() - mock.status_code = 500 - - # Set up the mock to raise - mock_completion.side_effect = [ - litellm.exceptions.RateLimitError( - "rate limit exceeded", - response=mock, - llm_provider="llm_provider", - model="model", - ), - None, - ] - - # Call the send_with_retries method - send_with_retries("model", ["message"], None, False) - mock_print.assert_called_once() - - @patch("litellm.completion") - @patch("builtins.print") - def test_send_with_retries_connection_error(self, mock_print, mock_completion): - # Set up the mock to raise - mock_completion.side_effect = [ - httpx.ConnectError("Connection error"), - None, - ] - - # Call the send_with_retries method - send_with_retries("model", ["message"], None, False) - mock_print.assert_called_once()