diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index f00a8be22..662fac486 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -664,7 +664,7 @@ class Coder: return self.commands.run(inp) self.check_for_file_mentions(inp) - inp = self.check_for_urls(inp) + self.check_for_urls(inp) return inp @@ -676,7 +676,7 @@ class Coder: inp += "\n\n" inp += self.commands.cmd_web(url) - return inp + return urls def keyboard_interrupt(self): now = time.time() @@ -1227,12 +1227,13 @@ class Coder: sys.stdout.write(text) except UnicodeEncodeError: # Safely encode and decode the text - safe_text = text.encode(sys.stdout.encoding, errors='backslashreplace').decode(sys.stdout.encoding) + safe_text = text.encode(sys.stdout.encoding, errors="backslashreplace").decode( + sys.stdout.encoding + ) sys.stdout.write(safe_text) sys.stdout.flush() yield text - def live_incremental_response(self, final): show_resp = self.render_incremental_response(final) self.mdstream.update(show_resp, final=final) diff --git a/tests/basic/test_coder.py b/tests/basic/test_coder.py index 8e1213e4a..1643aeeb5 100644 --- a/tests/basic/test_coder.py +++ b/tests/basic/test_coder.py @@ -668,7 +668,7 @@ two issue_cases = [ ("check http://localhost:3002, there is an error", "http://localhost:3002"), ( - "can you check out https://example.com/setup#whatever?", + "can you check out https://example.com/setup#whatever", "https://example.com/setup#whatever", ), ] @@ -687,10 +687,13 @@ two # Test case with no URL no_url_input = "This text contains no URL" result = coder.check_for_urls(no_url_input) - self.assertEqual(result, no_url_input) + self.assertEqual(result, []) # Test case with the same URL appearing multiple times - repeated_url_input = "Check https://example.com, then https://example.com again, and https://example.com one more time" + repeated_url_input = ( + "Check https://example.com, then https://example.com again, and https://example.com one" + " more time" + ) result = coder.check_for_urls(repeated_url_input) self.assertEqual(result.count("https://example.com"), 1) self.assertIn("https://example.com", result)