feat(tools): use installed ripgrep for native file search (#5948)

* feat(tools): expose installed ripgrep through exec

* refactor(tools): launch ripgrep with native argument vectors

* refactor(tools): reuse the fresh exec parameter schema

* fix(tools): select search backend in loader and display rg arguments

* fix(ui): simplify rg previews and localize search completion

* docs: simplify ripgrep configuration note

* docs: keep ripgrep note on one line
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-28 13:44:51 +08:00
1 parent b8893aba56
commit e0b8efa0be
33 files changed
+514 -204

No files matched your search

+11
View File
@@ -16,6 +16,17 @@ def _hint(calls, max_length=40):
class TestToolHintKnownTools:
"""Test registered tool types produce correct formatted output."""
def test_rg_shows_argument_boundaries(self):
assert _hint([_tc("rg", {"args": ["-n", "hello world", "src"]})]) == 'rg -n "hello world" src'
def test_rg_shows_regex_and_empty_argument(self):
assert _hint([_tc("rg", {"args": [r"resolve\(", ""]})]) == 'rg resolve\\( ""'
def test_rg_truncates_long_arguments(self):
result = _hint([_tc("rg", {"args": ["x" * 100]})])
assert result.endswith("…")
assert len(result) == 43
def test_read_file_short_path(self):
result = _hint([_tc("read_file", {"path": "foo.txt"})])
assert result == 'read foo.txt'