Skip to content

The agent that grows with you

fix(tools): improve patch tool parameter description

Elisa Martinez Abad9c541de91a39
diff --git a/tests/tools/test_file_tools.py b/tests/tools/test_file_tools.py
index d3683851427..9502eae3505 100644
--- a/tests/tools/test_file_tools.py
+++ b/tests/tools/test_file_tools.py
@@ -506,6 +506,7 @@ class TestPatchSchemaShape:
for name in ("path", "old_string", "new_string"):
assert "REQUIRED when mode='replace'" in props[name]["description"]
assert "REQUIRED when mode='patch'" in props["patch"]["description"]
+ assert "must differ from old_string" in props["new_string"]["description"]
def test_no_anyof_required_stays_mode_only(self):
# anyOf/oneOf at parameters level break Anthropic, Fireworks, and the
diff --git a/tools/file_tools.py b/tools/file_tools.py
index 43b460864fb..096b2070e2d 100644
--- a/tools/file_tools.py
+++ b/tools/file_tools.py
@@ -2572,7 +2572,7 @@ PATCH_SCHEMA = {
},
"new_string": {
"type": "string",
- "description": "REQUIRED when mode='replace'. Replacement text. Pass empty string '' to delete the matched text.",
+ "description": "REQUIRED when mode='replace'. Changed replacement text; it must differ from old_string. Pass empty string '' to delete the matched text.",
},
"replace_all": {
"type": "boolean",