-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Bug description
When using filesystem tools (such as write_file, edit_file, etc.), only the most recently edited file remains in the files state. All other previously existing files disappear after performing an operation.
Steps to reproduce
- Create multiple files using the tool (e.g.,
write_file) - Edit or write a new file
- Check the state - only the most recent file is found in the state, all others are missing
Expected behavior
- When a filesystem tool updates a file, the new file state should include all existing files plus the updated one
- Previously created files should not disappear
Root cause analysis
- The code merges file updates incorrectly by including only the update from the current operation, ignoring existing files.
- In
src/middleware/fs.ts, the code should merge file updates into the full existing state. - This causes data loss and prevents multiple file operations from coexisting in the application state.
Fix
Metadata
Metadata
Assignees
Labels
No labels