void icon indicating copy to clipboard operation
void copied to clipboard

Error: Error: The edit was not applied. The text in ORIGINAL must EXACTLY match lines of code in the file, but there was no match for: Has this situation not been handled?

Open 394988736 opened this issue 8 months ago • 4 comments

VSCode Version: 1.99.3 Void Version: 1.4.1 Commit: Unknown Date: Unknown Electron: 34.3.2 ElectronBuildId: undefined Chromium: 132.0.6834.210 Node.js: 20.18.3 V8: 13.2.152.41-electron.0 OS: Windows_NT x64 10.0.26100

Error: Error: The edit was not applied. The text in ORIGINAL must EXACTLY match lines of code in the file, but there was no match for:
Has this situation not been handled?

394988736 avatar Jun 05 '25 08:06 394988736

+1, tried with multiple gemini models.

maximilian-armuss-dev avatar Jun 05 '25 11:06 maximilian-armuss-dev

Yeah, i tend to use slow apply a lot. The fast apply only really works with some models and only if you're given code that has a single change in the code block with function name (or class etc.) visible in that codeblock.

paryska99 avatar Jun 05 '25 11:06 paryska99

Having same problem with Gemma3 12B qat and Qwen2.5 14B q4.

64jcl avatar Jun 08 '25 10:06 64jcl

Same issue with deepseek R1 671b, it appears in both slow and fast apply edits. For reference I use venice.ai api and the issue is not specific to a single model

mscorupco avatar Jun 09 '25 17:06 mscorupco

This is unfortunately a model intelligence problem -- it happens when the model outputs SEARCH/REPLACE blocks when it goes to edit, but the code it searches for doesn't actually exist. We do some things to get around this like ignoring whitespace differences, but it doesn't always work.

Tools like Windsurf and Cursor do occasionally have these issue too, but they sweep them under the rug a little better. We're working on this. We might want to update our prompt so the LLM outputs only 1 change at a time, but we thought it made more sense to give it some freedom to do whatever it does in its pretraining. Will keep this open for now.

andrewpareles avatar Jun 29 '25 22:06 andrewpareles