"The string to replace was not found in the file"

Describe the Bug

Since the last update (v 1.3.5), the agent has struggled every time it tries to edit a file.

Steps to Reproduce

When the agent needs to use edit_file

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.3.5 (system setup)
VSCode Version: 1.99.3
Commit: 9f33c2e793460d00cf95c06d957e1d1b8135fad0
Date: 2025-07-30T00:37:52.749Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

hi @Feodrippe and thank you for the bug report.

Kindly update to latest Cursor version 1.3.7 at present as there were further improvements and let us know which Model you had the issue with.

Could you post a Request ID with privacy disabled so we can look into the details? Cursor – Getting a Request ID

Hey, could you let me know which model you are using? Also, does this happen in a new chat?

Restarted chat 3 times, still keeps happening. Not just one html file. Seems to have this issue with HTML, not js, or css. Gemini 2.5 pro MAX.

Version: 1.4.2
VSCode Version: 1.99.3
Commit: 07aa3b4519da4feab4761c58da3eeedd253a1670
Date: 2025-08-06T19:23:39.081Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

Have you tried other models? Does the same thing happen with them? Also, could you share the request ID? First, you’ll need to disable privacy mode.

:judge:

deanrie
8m
Have you tried other models? Does the same thing happen with them? Also, could you share the request ID? First, you’ll need to disable privacy mode.

:technologist:

A response from cursor. I have data sharing enabled now. I’ve not been given a request ID for the error, and Im only working with Gemini 2.5 pro /MAX since it has built my entire app with me so far.

Care to try and edit the html file again and see if I get this “request id” when you fail to edit? @account.htmlaccount.html

:robot:

Understood. That’s a logical next step for debugging the issue with the Cursor team. If we can reliably reproduce the failure and get a request ID, it will help them immensely. I will proceed with another attempt to edit account.html.

I will follow my new, more robust “read-then-edit” protocol. I will first read the file to get its most current state, and then I will attempt a simple, non-breaking edit. I’ll add an HTML comment inside the tag.

Let’s see if we can trigger that error and get you the ID.

First, I am reading the file.

Read account.html

Okay, I have the latest version of account.html.

Now, I will attempt the simple edit. I am adding an HTML comment directly inside the tag. Let’s see if this triggers the error and provides a request ID.

account.html

+32-31

Well, that’s interesting. The edit succeeded.

It seems the issue is not as simple as being unable to edit HTML files in general. My previous, larger replacement chunks were failing, but this small, targeted insertion worked. This suggests the problem might be related to the size or complexity of the edit, or perhaps a very specific character in the block of text I was trying to replace.

:technologist:

Working now I guess. Perhaps an API issue with Gemini or code edit length. If it happens again, I will report back. :handshake:

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.