Closed lukewlms closed 3 months ago
Thanks for trying aider and filing this issue.
Have you read the FAQ entry that is linked from the errors? https://aider.chat/docs/faq.html#aider-isnt-editing-my-files
Have you added a lot of source code to the chat, more than just the file(s) that needs to be edited?
@paul-gauthier Thanks for the reply.
I recently made some improvements for partially applied edits. The change is available in the main branch. You can get it by installing the latest version from github:
python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
If you have a chance to try it, let me know if it works better for you.
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.
Issue
After seeing a "Malformed" error response from Aider, which didn't like Claude's answer, Aider still applied the updates. When Claude immediately sent a second, "corrected" set of updates at Aider's requests, these were also applied (and accepted without complaint). But the resulting code is clearly erroneous, with duplicated lines, unreachable code, and missing variables.
Related notes:
Example of unreachable code:
(These mistakes caught my attention since I've used Opus quite a bit directly in the web interface and it has never produced obvious, compile-preventing errors, as happened multiple times in a row here. I am pretty sure it is due to how the diff is being applied.)
Aiden's log during conversation:
Version and model info
Aider v0.31.1 Models: claude-3-opus-20240229 with diff edit format, weak model claude-3-haiku-20240307 Git repo: .git with 9 files Repo-map: using 1024 tokens
I hope it's an easy fix, this seems like quite a promising tool!
Edit: I've verified this again trying to make changes in a different code base. So far about half of responses have been identified as Malformed. Here is a partial log of the Aider output. I canceled the "correction" response but verified that the original "malformed" response was nevertheless applied.
src/ImportHtml/HtmlFileUploadControl.tsx
<<<<<<< SEARCH const { pageIds, sectionIds, joplinNoteIds, joplinFolderIds } = getIdsFromTags(groupTag);
These changes should resolve the errors related to the updated return value of getIdsFromTags. The callers now destructure the returned object and access the appropriate properties to get the desired IDs.
Please let me know if you have any further questions or if there are any other issues you need assistance with.
Malformed response #1, retrying... https://aider.chat/docs/faq.html#aider-isnt-editing-my-files InvalidEditBlock: edit failed!
src/ImportHtml/HtmlFileUploadControl.tsx does not contain the exact chunk of SEARCH lines you specified. Try again. DO NOT skip blank lines, comments, docstrings, etc! The SEARCH block needs to be EXACTLY the same as the lines in src/ImportHtml/HtmlFileUploadControl.tsx with nothing missing!
src/ImportHtml/HtmlFileUploadControl.tsx does not contain these 2 exact lines in a row:
I apologize for the confusion. Let me provide the correct changes for the callers of getIdsFromTags in the src/ImportHtml/HtmlFileUploadControl.tsx file.
src/ImportHtml/HtmlFileUploadControl.tsx src/ImportHtml/HtmlFileUploadControl.tsx
<<<<<<< SEARCH const allIdsToRemove = getIdsFromTags(ta
^C again to exit
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── src/Components/getPatch.test.tsx src/ImportHtml/HtmlFileUploadControl.tsx src/Joplin/JoplinShared.ts