Skip to content

The agent that grows with you

merge: reconcile upstream bounded search with literal patterns

ethernetd2c14f4becf9
diff --cc tools/file_operations_search.py
index e3d164d497a,c97fe6ace17..5c6a6dc59b8
--- a/tools/file_operations_search.py
+++ b/tools/file_operations_search.py
@@@ -512,11 -595,9 +595,9 @@@ class SearchMixin
glob_expr_probe = f"{glob_expr} {self._search_prune_glob_args()}"
else:
glob_expr_probe = glob_expr
- probe = self._exec(
- f"{rg} {flags} --count-matches{glob_expr_probe} "
- f"{self._escape_shell_arg(pattern, translate_path=False)} {self._escape_native_tool_arg(path)} "
- f"2>/dev/null | head -50",
- timeout=30)
+ probe_words = [rg, flags, "--count-matches", glob_expr_probe,
- self._escape_shell_arg(pattern), self._escape_native_tool_arg(path)]
++ self._escape_shell_arg(pattern, translate_path=False), self._escape_native_tool_arg(path)]
+ probe = self._run_rg_bounded(probe_words, 50, timeout=30)
total, per_file = 0, []
for line in (probe.stdout or "").strip().splitlines():
p, _sep, n = line.rpartition(":")