mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-07 05:05:01 +00:00
Ask GPT to retry if original block is not found
This commit is contained in:
parent
691c013272
commit
4bc35a7376
3 changed files with 14 additions and 3 deletions
|
@ -32,7 +32,17 @@ class EditBlockCoder(Coder):
|
|||
self.io.write_text(full_path, content)
|
||||
edited.add(path)
|
||||
continue
|
||||
self.io.tool_error(f"Failed to apply edit to {path}")
|
||||
raise ValueError(f"""InvalidEditBlock: edit failed!
|
||||
|
||||
{path} does not contain the *exact sequence* of ORIGINAL lines you specified.
|
||||
Try again.
|
||||
DO NOT skip blank lines, comments, docstrings, etc!
|
||||
The ORIGINAL block needs to be EXACTLY the same as the lines in {path} with nothing missing!
|
||||
|
||||
{path} does not contain these {len(original.splitlines())} exact lines in a row:
|
||||
```
|
||||
{original}```
|
||||
""")
|
||||
|
||||
return edited
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue