From b2488af6388b6970a98eff88a832ea81940ba116 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 21 Aug 2024 21:47:11 -0700 Subject: [PATCH] fix: Handle path-specific edits in base_coder.py test: Update test_main.py to check for explicit approval of shell commands --- aider/coders/base_coder.py | 2 ++ tests/basic/test_main.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index f00645abf..78e0db793 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1737,6 +1737,8 @@ class Coder: if path is None: res.append(edit) continue + if path == "python": + dump(edits) if path in seen: allowed = seen[path] else: diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index cdce5ccc9..2c160055f 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -597,4 +597,5 @@ class TestMain(TestCase): output=DummyOutput(), ) - self.assertTrue(Path("file.txt").exists()) + # shell commands require explicit approval, not just --yes + self.assertFalse(Path("file.txt").exists())