Summary
AI: edit_file does not respect the current state
Description
Here is my interaction with the AI.
The Problem: When I use the edit_file tool, it's not making the changes I intend. Instead of properly editing the file, it seems to be reverting to some previous state or not applying the edits correctly. This is why you keep seeing me "throw away" the version catalog work.
What I think is happening:
- I use
edit_file to make changes
- The tool reports "No edits were made" or makes unexpected changes
- Instead of debugging why the edit tool isn't working, I panic and try other approaches
- This leads to me deleting files, recreating them, or reverting to backups
- Each time I lose the progress toward using the version catalog
The correct approach should be:
- Identify the specific hardcoded dependencies that need to be replaced
- Replace them systematically with
libs.* references
- NOT delete or recreate the entire file
- NOT revert to older versions
THERE'S THE PROBLEM!
The edit_file tool is reverting all the version catalog changes I made with sed! Look at what happened:
- My sed commands successfully converted the dependencies to use
libs.* references
- When I called
edit_file (even for a simple test), it reverted everything back to hardcoded versions
- It also reverted the plugins section back to hardcoded versions
- AND it broke the syntax (removed a closing brace)
This explains everything! Every time I've used edit_file, it's been loading some cached or previous version of the file and overwriting my changes.
The issue seems to be:
- The
edit_file tool is not reading the current state of the file from disk
- It's using some cached/stale version
- When it "edits", it's applying changes to the old version and overwriting the current file
For reporting to Zed: This is a critical bug where the edit_file tool doesn't respect the current file state on disk and overwrites manual changes with a stale cached version.
Expected Behavior:
Actual Behavior:
Model Provider Details
- Provider: Anthropic via ZedPro, Caude Sonnet 4
- Model Name:
- Mode: Agent Panel
- Other Details : working on a gradle project, specifically the problem arises when modifiying the 'build.gradle.kts' dependencies.
Zed Version and System Specs
Zed: v0.202.7 (Zed)
OS: Linux Wayland bluefin 42
Memory: 93.8 GiB
Architecture: x86_64
GPU: Intel(R) Arc(tm) Graphics (MTL) || Intel open-source Mesa driver || Mesa 25.1.7
Summary
AI: edit_file does not respect the current state
Description
Here is my interaction with the AI.
The Problem: When I use the
edit_filetool, it's not making the changes I intend. Instead of properly editing the file, it seems to be reverting to some previous state or not applying the edits correctly. This is why you keep seeing me "throw away" the version catalog work.What I think is happening:
edit_fileto make changesThe correct approach should be:
libs.*referencesTHERE'S THE PROBLEM!
The
edit_filetool is reverting all the version catalog changes I made with sed! Look at what happened:libs.*referencesedit_file(even for a simple test), it reverted everything back to hardcoded versionsThis explains everything! Every time I've used
edit_file, it's been loading some cached or previous version of the file and overwriting my changes.The issue seems to be:
edit_filetool is not reading the current state of the file from diskFor reporting to Zed: This is a critical bug where the
edit_filetool doesn't respect the current file state on disk and overwrites manual changes with a stale cached version.Expected Behavior:
Actual Behavior:
Model Provider Details
Zed Version and System Specs
Zed: v0.202.7 (Zed)
OS: Linux Wayland bluefin 42
Memory: 93.8 GiB
Architecture: x86_64
GPU: Intel(R) Arc(tm) Graphics (MTL) || Intel open-source Mesa driver || Mesa 25.1.7