From a405defcff466f85795b478636fddb9ad6511b2a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 22 May 2024 21:27:59 -0700 Subject: [PATCH] ask for confirmation --- _posts/2024-05-22-swe-bench-lite.md | 3 +-- aider/coders/base_coder.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/_posts/2024-05-22-swe-bench-lite.md b/_posts/2024-05-22-swe-bench-lite.md index a69321ee3..10b89addf 100644 --- a/_posts/2024-05-22-swe-bench-lite.md +++ b/_posts/2024-05-22-swe-bench-lite.md @@ -67,8 +67,7 @@ The benchmarking process was similar to a user employing aider like this: tells aider to automatically proceed with every suggestion and use pytest to run tests. - `aider --yes --test-cmd pytest` -- Pasting the text of a GitHub issue into the chat, or adding it via URL with a command in the chat like: - - `/web https://github.com/django/django/issues/XXX` +- Pasting the URL of a GitHub issue into the chat. Aider will offer to pull in the URL's content. - If aider doesn't produce code that lints and tests clean, the user might decide to revert the changes and try again, maybe using aider with a different LLM this time. [Aider is tightly integrated with git](https://aider.chat/docs/faq.html#how-does-aider-use-git), so it's always easy to revert AI changes that don't pan out. diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index fd39baf76..5b2f303e2 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -586,9 +586,9 @@ class Coder: ) urls = url_pattern.findall(inp) for url in urls: - self.io.tool_output(f"Adding {url} to the chat.") - inp += "\n\n" - inp += self.commands.cmd_web(url) + if self.io.confirm_ask(f"Add {url} to the chat?"): + inp += "\n\n" + inp += self.commands.cmd_web(url) return inp