Auto mode occasionally cannot edit files unless repeatedly instructed to do so

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The agent will spit out blocks of code without using the live edit_file tool

a78c5772-1cf7-4628-9d96-d6ea4180021c

Steps to Reproduce

If your initial prompt is telling it to just analyze the situation. and then you go forwards with implementation, the agent will hesitate to use the edit file tool. i had to call it out 3 times sequentially, and eventually it started using the edit file tool

Expected Behavior

When i ask for it to implement changes, it shouldn’t create mark down blocks but instead edit the files requested

Screenshots / Screen Recordings

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.4.5
VSCode Version: 1.99.3
Commit: af58d92614edb1f72bdd756615d131bf8dfa5290
Date: 2025-08-13T02:08:56.371Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.15.9-arch1-1

Additional Information

how does the agent know this?
ā€œYou’re absolutely right - I’m not using the edit_file tool correctly. Let me actually use it properly to edit the live file:ā€
in the screen shot, the last edit, he actually edits the file

Does this stop you from using Cursor

No - Cursor works, but with this issue

hi @koltanl does this occur on a new chat or when the chat is longer?

above 40% context usage where the beginning of the conversation is a direct dialogue over how a particular set of code works with the specification that we aren’t going to make any changes yet.

and then we transition to, ā€œokay thank you, now we need to change this please to be have like this insteadā€œ

and rather than editing files he will in a phrase, hesitate, to actually hit the code due to the first prompt instructing him to not touch code yet

Thank you for the clarification. It may well be that the first prompt confuses AI in this case.

Could you share how you instruct AI to not edit code in first prompt? I may be able to suggest alternatives.

well largely it’ll be as described; ā€œplease look over @ xyz , and tell me how this works, walk me through step by step, if we were to run it. no changes at this time, just talkā€

or similarly ā€œdon’t touch the code just analyze pleaseā€

I can see how this would be disruptive, however if being instructed actively, ā€˜please update the code in @ this file now, with our new understanding,’ I would hope that directive would overwrite the old.

1 Like

Yes the follow up prompt should override it.

Does AI try to call the edit tool or just outputs the code block?

i would say 80%-90% of the time he calls the edit tool no problem. But that last 10%~ ai will stubbornly output code blocks. As demonstrated above, we can beat it over the head with ā€˜use the edit file tool!’ and he will get to it eventually, but usually at that point it’s not worth the effort. It’s new chat time.

Often those codeblocks contain todo’s or placeholder content, not being unified with the whole of the codebase itself. Cannot just copy paste it in into its place , is . . . unfinished or not unified with the rest of the codebase. Is making its own discrete sorta template for the user to finish the job or giving suggestions rather than actually attempting to ā€˜complete the job.’

In a phrase, if we end up in this state, I assume the ai to be disoriented from here on and basically a danger to the codebase ha

1 Like

We will track this issue, for the moment we do not have many other similar reports but will escalate if there are more occurring.

I would say ask AI to ā€œimplementā€ the change instead of telling it to call the edit tool.

Are you having any MCPs connected?

A long time ago I once grilled an agent what tools have been provided to it and it repeated back edit_file as one of its tools, hence why I’ve been using that specific verbage.

ā€œImplementā€ as a key word, i appreciate it!

Just one self made MCP which connects to a locally hosted server we’re using as the test enviroment; is just a rather risky sshpass command

Please let me know if the issue does not occur when you disable MCP. We have seen reports that some MCPs may provide info that confuses AI.

While edit_file may be the tool, if we rename it or replace it with a better tool your instruction may be not well understood by AI then.

Hope that asking AI to implement may improve the situation.

1 Like

9b397210-26bf-4753-891a-a8972de5b906

happened again; ā€˜implement’ key word was not satisfactory to get it to write into files. this time there wasn’t even any kind of ā€˜hold off on changes’ command. the do not output ``codeblocks`` wierdly got it to go

ok interesting, thank you for the update. I will watch out for similar cases in case we can reproduce it and see more whats causing it.

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