diff --git a/packages/opencode/src/tool/edit.txt b/packages/opencode/src/tool/edit.txt index 863efb8409c..a64f23f1eeb 100644 --- a/packages/opencode/src/tool/edit.txt +++ b/packages/opencode/src/tool/edit.txt @@ -7,4 +7,5 @@ Usage: - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked. - The edit will FAIL if `oldString` is not found in the file with an error "oldString not found in content". - The edit will FAIL if `oldString` is found multiple times in the file with an error "oldString found multiple times and requires more code context to uniquely identify the intended match". Either provide a larger string with more surrounding context to make it unique or use `replaceAll` to change every instance of `oldString`. +- The edit will FAIL if `oldString` and `newString` are identical strings: you MUST NEVER pass identical arguments for the `oldString` and `newString` arguments! - Use `replaceAll` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.