-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Labels
Description
Description
Currently, the textEditor tool throws an error when trying to use the 'create' command on a file that already exists. This behavior can be limiting in many workflows where overwriting files is a valid use case.
Proposed Change
Modify the textEditor implementation to allow overwriting existing files when using the 'create' command, rather than throwing an error when a file already exists.
Implementation Details
- Modify the 'create' command in the textEditor tool to check if a file exists but not throw an error
- Update the file with the new content instead of failing
- Add appropriate history tracking for the undo functionality
- Update tests to verify this new behavior
Files to Modify
/packages/agent/src/tools/io/textEditor.ts
/packages/agent/src/tools/io/textEditor.test.ts
(to add tests for the new behavior)
Impact
This change will improve the flexibility of the textEditor tool, allowing users to more easily update files without having to use different commands depending on whether the file exists.