In 3 different projects, Cursor is getting stuck trying to apply a patch. I can’t seem to navigate around it and the agent just churns with no progress made. Here’s a thinking transcription from the one project:
“Diagnosing patch application failure
Suspecting patch failure due to syntax or environment issues, I’ll switch to creating the CI workflow file by writing it directly instead of applying a patch, ensuring correct file headers and newlines.”
And the other: “Preparing to add lint steps
I’m planning to insert ruff lint steps into the workflow after dependency installation and before tests, and will carefully create and apply a patch with correct indentation and context for both backend and frontend job sections.”
It previously got stuck patching scratchpad.
Steps to Reproduce
Give the agent a task to patch a file. In 2 out of 3 cases, the agents we’re trying to update an MD file and got stuck
Expected Behavior
The agent can update the file, and work can complete
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Logs from Help > Toggle Developer Tools > Console at the time of the freeze
Output from Cursor Settings > Network > Run Diagnostics
Exact attempt time and a fresh Request ID with Privacy turned off
Confirm if it only reproduces on .md and attach a minimal file plus exact steps
Quick checks:
Launch with extensions disabled: cursor --disable-extensions
If on VPN/corporate network, open app settings CMD+,, search for HTTP/2, and enable “Disable HTTP/2”
Try in a new window and with a small test .md
By the way, after @XavierHarkonnen2026’s comment it started working. Is it still reproducible on your side or only intermittently? Please share the diagnostics above.
I’m getting similar issues after the last update, but with any file I have.
It just cannot continue with any patching.
In my last response, Cursor said “I couldn’t apply the automated patch cleanly because the current file content doesn’t match the patch context.“
Previously, when asked why it can’t proceed with the change it said:
”Why I’m blocked right now:
The file I need to edit, {file}.swift, is listed as deleted in the provided state. Every patch attempt failed because the file context no longer matches (likely due to deletion or a major change).
To proceed, I need the current version of {file}.swift (or confirmation to restore it). Once I have the current file content, I can remove the duplicated selection initialization and rely on {file}.setGrid(…).”
When I give it any command, it just goes into a loop, saying it’s trying to apply patch, then says it needs to try on a smaller scope/single line.
The files are present, they exist, nothing is deleted.
It all happened after last update last week.
The app explaining why it couldn’t do the code edits:
”Why apply_patch kept failing even though only I was editing
apply_patch works like a super-strict diff:
It expects the exact “old” text (including indentation, spaces, and line breaks) to be present in the file.
If even one character differs (extra spaces, different wrapping, a line moved up/down, or I copied a slightly stale version of the block), it says “Failed to find context”.
What went wrong here:
I was sometimes building patches from an earlier snapshot of the file or from inline-line-number output (e.g. L123:) and then trying to apply those blocks.
Even tiny differences (like re-indented .alert chains, or your manual tweaks) made the “old” chunk in my patch not match the real file anymore.
That’s why you saw multiple failures until I switched to very small, precise operations (search_replace) that don’t depend on big context chunks.
So the problem isn’t that the project is out of sync; it’s that my patch chunks were.”