fix: Handle path-specific edits in base_coder.py

test: Update test_main.py to check for explicit approval of shell commands
This commit is contained in:
Paul Gauthier 2024-08-21 21:47:11 -07:00 committed by Paul Gauthier (aider)
parent c7bf46bf68
commit b2488af638
2 changed files with 4 additions and 1 deletions

View file

@ -1737,6 +1737,8 @@ class Coder:
if path is None: if path is None:
res.append(edit) res.append(edit)
continue continue
if path == "python":
dump(edits)
if path in seen: if path in seen:
allowed = seen[path] allowed = seen[path]
else: else:

View file

@ -597,4 +597,5 @@ class TestMain(TestCase):
output=DummyOutput(), output=DummyOutput(),
) )
self.assertTrue(Path("file.txt").exists()) # shell commands require explicit approval, not just --yes
self.assertFalse(Path("file.txt").exists())