Invalid patch format trying to write or create a file

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m getting errors when agent from chat is trying to write a file in the project. File is not written and “Invalid patch format” appears.
After the error, the agent provides the following thoughts:
“Preparing documentation patch
I need to create the file doc/arquitectura.md with specific content. I tried using the apply_patch tool but realized I used the wrong wrapper method. The patch must include the specified V4A diff format with the correct starting and ending lines. I should be cautious about the file path—ensuring it matches the requested location. The project root doesn’t have a doc/ directory, but the tool can create it, which is typical. I’ll include content derived from the codebase.”

Steps to Reproduce

Prompt asking for document generation from a template with a concrete path

Expected Behavior

The file is created correctly in the path

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.45 (user setup)
VSCode Version: 1.99.3
Commit: 3ccce8f55d8cca49f6d28b491a844c699b8719a0
Date: 2025-09-22T18:22:38.013Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor