From 10e93c6ab958c7ec61cfc4416f4d4459e72ca8a7 Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Sun, 19 Jul 2026 19:09:58 -0400 Subject: [PATCH] fix(skills): drop redundant identical-strings guard and its vacuous tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guard and the tests around it pinned behavior that already existed. fuzzy_find_and_replace rejects old_string == new_string at tools/fuzzy_match.py:69-70, returning "old_string and new_string are identical" — so main already answered success=False, and the three tests asserting "identical" in the error passed with the guard deleted. The earlier claim that this case "silently applies a no-op the model reports as success" was wrong. Verified against main: {"success": false, "error": "old_string and new_string are identical", "file_preview": "..."} The duplicate guard was also strictly worse: it fired before the skill lookup and returned no file_preview, shadowing the richer message. Removes the guard, the two identical-strings tests, and the third parametrize case. What remains is the genuinely new behavior: an actionable missing-old_string error, reachable through the public tool. --- tools/skill_manager_tool.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/skill_manager_tool.py b/tools/skill_manager_tool.py index fa1c11d02e..a9f41ad3be 100644 --- a/tools/skill_manager_tool.py +++ b/tools/skill_manager_tool.py @@ -1128,14 +1128,10 @@ def _patch_skill( } if new_string is None: return {"success": False, "error": "new_string is required for 'patch'. Use an empty string to delete matched text."} - if old_string == new_string: - return { - "success": False, - "error": ( - "old_string and new_string are identical — this patch would change nothing. " - "Supply the actual replacement text." - ), - } + # No old_string == new_string guard here: fuzzy_find_and_replace already + # rejects that with "old_string and new_string are identical" + # (tools/fuzzy_match.py), and its error carries a file_preview this layer + # cannot produce. Duplicating it here would only shadow the richer message. existing = _find_skill(name) if not existing: