ReplaceContentTool: Improve error case message

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-01-13 22:14:34 +01:00
1 parent 16792389d7
commit 5c60f1e8b5
1 file changed
+2 -1
+2 -1
View File
@@ -228,7 +228,8 @@ class ReplaceContentTool(Tool, ToolMarkerCanEdit):
if "\n" in matched_text and re.search(regex_pattern, matched_text[1:], flags=regex_flags):
raise ValueError(
"Match is ambiguous: the search pattern matches multiple overlapping occurrences. "
"Please revise the search pattern to be more specific to avoid ambiguity."
"Please revise the search pattern to be more specific to avoid ambiguity, "
"e.g. by matching specific context after the match, or try using the literal mode."
)
# Handle backreferences: replace $!1, $!2, etc. with actual matched groups