Agent Panel: zed decides to use cat to modify source
Summary
I don't really know how or why this is happening, but sometimes zed will decide it can't edit code with its builtin tools, so instead it will fall back to using a shell exec of cat to edit code.
This is annoying because it has to prompt for permissions for the shell exec.
I think this may reflect an issue with the editing tools, though I have no idea what.
This is using claude sonnet 3.7 via github copilot chat.
Zed Version and System Specs
Zed: v0.185.15 (Zed) OS: macOS 15.4.1 Memory: 64 GiB Architecture: aarch64
I experienced something similar. In "ask" profile, that don't have permissions to write files, zed try to modified anyway with cli commands.
Ouch that's not good. Thanks for reporting.
The Ask profile doesn't have the terminal tool enabled.
So one of two things is almost certainly happening:
- You've modified their Ask profile to enable the terminal tool, in which case it's working as expected
- The agent hallucinated its own ability to run a terminal command, and printed out cat foo.txt > bar with shell formatting, which looks like real tool call.
The "model concluding edit_file is broken after too many failed edit attempts and gives up and falls back on terminal" is a longstanding known behavior (particularly with newer models which have been fine tuned to try to more aggressively use tool calls) but not something we have a solution to at this time.
Thanks for reporting.
My original report was not using the ask profile, it was the write profile.