Skip to main content

Module file_edit

Module file_edit 

Source
Expand description

FileEdit tool: targeted search-and-replace editing.

Performs exact string replacement within a file. The old_string must match uniquely (unless replace_all is set) to prevent ambiguous edits.

Before writing, the tool checks whether the file’s modification time has changed since it was last read (via the session file cache). If the file is stale the edit is rejected so the model re-reads first.

After a successful edit the tool returns a unified diff of the changes so the model (and user) can see exactly what happened.

Structs§

FileEditTool