-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error applying diffs - "No sufficiently similar match found at start: ..." #148
Comments
To add to this, I have seen Cline now intentially creating issues as it gets the line numbers wrong when editing. For example, you will wind up with something like:
|
@jeremy-returned @ryanjoachim can you try out 2.2.15 and let me know if you're still having issues? Thank you for the help tracking these down! |
I spoke too soon: Seems to be due to Cline not reading the file before writing to it.
|
Ugh. That's on 2.2.15? The export would be amazingly helpful if you can share. |
The behavior @jeremy-returned mentioned aligns with what we see in my screenshot, where every attempt to edit the file fails until Cline finally says "Maybe I should try reading the file again...". I wonder if my random theory - It kind of feels more like a "short term memory loss" situation and reminded me of a known issue in Cline revolving around the file picker/add context feature, where any new files/directories added locally during an open VSCode session are not visible to the To what extent (if at all) does Cline keep track of the state a previously read/modified file or directory, at least within each unique task? I'm getting the impression that unless a file is re-read by Cline prior to a new interaction with it, Cline isn't using the most recent structure/content to start with.
|
I have the export for this conversation if anyone really wants it. It just has ~10k lines in it and didn't want someone to open thinking they were in for a quick read 😆. I intentionally kept the conversation going to push overall token usage+fill up the webView+iFrame, and except to ask a single question (or set a task like creating a file) after each |
Interesting... this could be on to something. I believe that LLMs pay less attention to content in the middle of the conversation, so that could explain why they sometimes forget the current state of the files / line numbers / etc. Maybe there's some way to force it to re-read the file and then try applying the diff again after a failure, either with the prompt or with the response of the tool rejection 🤔 |
Which API Provider are you using?
Anthropic
Which Model are you using?
Claude 3.5 Sonnet
What happened?
Cline is in a workflow of its own creation, editing files in sequence one by one using diffs.
It seems to struggle with updating a file that was created after the extension (or the VSCode window itself) was initialized. Cline knows its there because it creates it, but it struggles to keep track of contextual information on it.
(random theory)
The general error that happens is below:
After this it will sometimes go on to read the file again, which allows it to successfully apply the diff.
Other times it'll go into a bit of a feedback loop until it kicks its way out, like in the image here:
Steps to reproduce
Relevant API REQUEST output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: