Issue
While working on a project that has a lot of human written text in Markdown files with long lines, the LLM fails to match the diff-fenced format because it does not return the full line.
Returning the full line would be a full paragraph of text, so it makes sense the LLM only returns a full sentece. That should be enough to fully search-replace the improved version.
Currently however Aider always expects a full line, and thus it refuses to do search-replace on results like these:
The LLM did not conform to the edit format.
https://aider.chat/docs/troubleshooting/edit-errors.html
# 2 SEARCH/REPLACE blocks failed to match!
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in content/post/web-browser-tab-tips/index.md
<<<<<<< SEARCH
All popular browsers support defining customer keywords so that what you type in the address bar can take you where you are going even faster.
=======
All popular browsers support defining custom keywords so that what you type in the address bar can take you where you are going even faster.
>>>>>>> REPLACE
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in content/post/web-browser-tab-tips/index.md
<<<<<<< SEARCH
No more wasting time on skimming through unrelevant search result pages!
=======
No more wasting time on skimming through irrelevant search result pages!
>>>>>>> REPLACE
The SEARCH section must exactly match an existing block of lines including all white space, comments, indentation, docstrings, etc
# The other 2 SEARCH/REPLACE blocks were applied successfully.
Don't re-send them.
Just reply with fixed versions of the blocks above that failed to match.
I wonder if it would be feasible for Aider to have this kind of logic in the search/replace action:
- Attempt search/replace with full line (like now)
- If 1 fails, but the search value is big (e.g. 60+ characters) and likely unique, attempt search/replace with the it without
^ prefixed and $ suffixed so that partial matches on a line are allowed
Version and model info
Aider v0.86.1
Model: openrouter/moonshotai/kimi-k2 with diff edit format
Git repo: .git with 80 files
Repo-map: using 4096 tokens, manual refresh
Issue
While working on a project that has a lot of human written text in Markdown files with long lines, the LLM fails to match the diff-fenced format because it does not return the full line.
Returning the full line would be a full paragraph of text, so it makes sense the LLM only returns a full sentece. That should be enough to fully search-replace the improved version.
Currently however Aider always expects a full line, and thus it refuses to do search-replace on results like these:
I wonder if it would be feasible for Aider to have this kind of logic in the search/replace action:
^prefixed and$suffixed so that partial matches on a line are allowedVersion and model info
Aider v0.86.1
Model: openrouter/moonshotai/kimi-k2 with diff edit format
Git repo: .git with 80 files
Repo-map: using 4096 tokens, manual refresh