aider icon indicating copy to clipboard operation
aider copied to clipboard

Aider tries to execute search/replace blocks in a terminal shell

Open jmarkmorris opened this issue 8 months ago • 6 comments

Issue

I've been having a lot of issues with diff and edit-diff lately. Aider will try to make edits with search/replace blocks but they fail rapidly and there is no detail about why. Ocassionally it will finish with one sad search/replace block in a different visual format and it will ask if I want the shell to execute it. I mean actually execute the search/replace text. I would guess that this area of aider is evolving quickly so this is mostly fyi and by the time anyone reads this it may already have been resolved. Thank you.

Version and model info

aider 0.81.2 i've been bouncing around between models gemini pro2.5, claude 3.7, and gemini 2.0 flash. I use both code and architect modes. I can't really isolated it to a particular model. I'll pay attention to see if it is related to a model and update this issue if it is.

jmarkmorris avatar Apr 12 '25 23:04 jmarkmorris

Does it look like #3811?

kanzure avatar Apr 17 '25 02:04 kanzure

I also encountered this situation while editing csharp; it seems that ```csharp was matched as ```csh, causing the command to be invoked.

     shell_starts = [
            "```bash",
            "```sh",
            "```shell",
            "```cmd",
            "```batch",
            "```powershell",
            "```ps1",
            "```zsh",
            "```fish",
            "```ksh",
            "```csh",
            "```tcsh",
        ]

zjy1412 avatar Apr 17 '25 05:04 zjy1412

Does it look like #3811?

Yes.

jmarkmorris avatar Apr 17 '25 13:04 jmarkmorris

The change is available in the main branch. You can get it by installing the latest version from github:

aider --install-main-branch

# or...

python -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/Aider-AI/aider.git

If you have a chance to try it, let me know if it works better for you.

paul-gauthier avatar Apr 19 '25 17:04 paul-gauthier

I ran with the change for one hour of coding and did not see the issue.

jmarkmorris avatar Apr 19 '25 18:04 jmarkmorris

Ok, I have done many (~12) hours of coding now with multiple models and editors. I have not seen this issue again. Should I close the issue?

jmarkmorris avatar Apr 22 '25 00:04 jmarkmorris

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

paul-gauthier avatar May 10 '25 20:05 paul-gauthier