Roo-Code: Unable to write to local md files
Which version of the app are you using?
3.7.12
Which API Provider are you using?
OpenRouter but also direct to Anthropic
Which Model are you using?
Claude 3.7 Sonnet (both via OpenRouter and directly) also on Gemini Flash 2.0
What happened?
Unable to get Roo to write to local MD files. It’s able to create them but unable to write to them. The size of the content isn’t large (only about 1 page of markdown)
Giving me the above error… more messages below.
the write_to_file tool failed again. It seems like there is an issue with opening the diff editor. I will try to switch to code mode and then try to write the file.
Error Error writing file: Failed to open diff editor, please try again…
The write_to_file tool failed again with the same error. It seems like the diff editor is causing the issue
Steps to reproduce
- in architect mode: Ask Roo to plan in markdown (just 1-2 pages)
- ask Roo to save it to a subfolder in my project root with a specific file naming convention
- Roo is able to create the file, and give it the proper name - but is then unable to actually edit the file
Relevant API REQUEST output
Additional context
Initially thought it was a context /token limit so I copied and pasted what I wanted from an old Roo thread to a new one but it still failed. Even changed models (tried claude 3.7 both from openrouter and direct from Anthropic, gemini etc) None are able to to access the write_to_file tool. Which is strange as they could all do so yesterday…
Also Reset Roo to a fresh State … no luck
Also Uninstalled and Re-installed v 3.7.12 again … still no luck and in addition to the “write_to_file tool failed” error its also giving me a “Failed to open diff editor,” error
I think this happened this is probably after ver 3.3.10 or 3.7.11 (because I have files from 3/2/25 2:53 pm ET that were written properly)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19
WOW. that’s what it was. thanks @mrubens!!
I did not have a markdown extension but had the following in my VScode settings.json (to open all md files in preview mode)
"markdown.preview.openMarkdownLinks": "inPreview", "workbench.editorAssociations": { "*.md": "vscode.markdown.preview.editor" },I removed those lines and it worked. Roo is nwow able to write to md files!
this probably is still a minor inconvenience because the write_to_file tool is getting blocked by this auto-preview mode - but at least there is a workaround!
Sounds like it’s related to the Markdown Preview extension: https://github.com/cline/cline/issues/578#issuecomment-2425217620
Thanks, this helped!