From 3e1ad070693d37fa900193ee6b8ac1c6e9dcbef1 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 28 Jul 2024 16:41:38 -0300 Subject: [PATCH] Fix the issue with repeated URLs in the `check_for_urls` method --- aider/coders/base_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 1d9b01c26..f00a8be22 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -670,7 +670,7 @@ class Coder: def check_for_urls(self, inp): url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*[^\s,.])") - urls = url_pattern.findall(inp) + urls = list(set(url_pattern.findall(inp))) # Use set to remove duplicates for url in urls: if self.io.confirm_ask(f"Add {url} to the chat?"): inp += "\n\n"