Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(vibey): recommend direct ripgrep use for file searches (#2610)

Call Whitea20017df0733
diff --git a/docs/plans/ripgrep-runtime.md b/docs/plans/ripgrep-runtime.md
index 11035daa4..e84074dee 100644
--- a/docs/plans/ripgrep-runtime.md
+++ b/docs/plans/ripgrep-runtime.md
@@ -25,10 +25,21 @@ The prompt had stated a tool that did not exist.
verified Git under its existing rules, then the managed ripgrep only when the
effective PATH has no `rg`, so a user's own ripgrep keeps precedence, as for
Git. An absent or unverifiable install leaves PATH unchanged.
-- Vibey's bash rule names `rg` only when the Turn's composed PATH finds it, and
- `grep` otherwise. That PATH changes only when the service's PATH or the
- installed tools change, so a Session's system prompt stays byte-stable and
- cacheable between Turns. No per-Session state is kept.
+- Vibey's command guidance names `rg` only when the Turn's composed PATH finds
+ it. With a Bash or PowerShell tool available, one shared hint recommends
+ ripgrep for file searches and direct invocation of the `rg` command. Without
+ `rg`, the existing `grep` / `Select-String` guidance remains; without a command
+ tool, no search command is recommended.
+ This is a short recommendation, not a file-discovery tutorial: it introduces no
+ CLI option examples or claim to include hidden/ignored files. Existing file
+ discovery guidance remains unchanged. That PATH changes only when the service's
+ PATH or installed tools change, so the system prompt stays byte-stable between
+ Turns. No per-Session state is kept.
+
+The prompt contract is tested at both the rendered rule and real Turn/job-host
+boundaries: available and missing ripgrep, POSIX and Windows wording, no shell,
+and no duplicate hint with multiple command tools. Runtime installation, PATH
+precedence and dependency failure behavior are unchanged.
## Availability
diff --git a/modules/agents/vibey/prompt.py b/modules/agents/vibey/prompt.py
index d12aff199..ff7f0477a 100644
--- a/modules/agents/vibey/prompt.py
+++ b/modules/agents/vibey/prompt.py
@@ -97,6 +97,8 @@ def coding_prompt(tool_names: Iterable[str], *, builtin_agent: bool, rg: bool) -
rules.append(f"Use bash for file operations like ls, {'rg' if rg else 'grep'}, find")
if "powershell" in names:
rules.append(f"Use powershell for file operations like Get-ChildItem, {'rg' if rg else 'Select-String'}")
+ if rg and ("bash" in names or "powershell" in names):
+ rules.append("Prefer rg (ripgrep) for file searches. Run the `rg` command directly.")
for name in names:
rules.extend(TOOL_GUIDELINES.get(name, ()))
if names:
diff --git a/tests/test_vibey_agent.py b/tests/test_vibey_agent.py
index c8cae969e..0c788a341 100644
--- a/tests/test_vibey_agent.py
+++ b/tests/test_vibey_agent.py
@@ -81,6 +81,7 @@ from vibe.i18n import t as i18n_t
NOW = "2026-10-02T00:00:00.000000Z"
SESSION = "ses_vibey"
+RG_HINT = "Prefer rg (ripgrep) for file searches. Run the `rg` command directly."
@pytest.fixture()
@@ -1742,16 +1743,31 @@ async def test_a_relative_tool_path_is_shown_under_the_runs_cwd(engine, session,
assert shown(other_drive) == other_drive
-def test_on_windows_the_command_tool_is_powershell_with_its_own_rule() -> None:
[email protected]("finds_rg", (True, False))
+def test_on_windows_the_command_tool_is_powershell_with_its_own_rule(finds_rg) -> None:
from modules.agents.vibey.prompt import coding_prompt
- text = coding_prompt(["read", "powershell", "edit", "write"], builtin_agent=True, rg=True)
+ text = coding_prompt(["read", "powershell", "edit", "write"], builtin_agent=True, rg=finds_rg)
assert "- powershell: Execute PowerShell commands (Get-ChildItem, Select-String, etc.)" in text
- assert "Use powershell for file operations like Get-ChildItem, rg" in text
+ assert ("Use powershell for file operations like Get-ChildItem, rg" in text) is finds_rg
+ assert ("Use powershell for file operations like Get-ChildItem, Select-String" in text) is not finds_rg
+ assert text.count(RG_HINT) == int(finds_rg)
assert "bash" not in text
[email protected]("tool_names", ([], ["read"], ["bash", "powershell"]))
[email protected]("finds_rg", (True, False))
+def test_rg_path_hint_is_once_and_only_with_an_available_command_tool(tool_names, finds_rg) -> None:
+ """The PATH fact needs an offered shell; two shell tools must not duplicate it."""
+ from modules.agents.vibey.prompt import coding_prompt
+
+ system = coding_prompt(tool_names, builtin_agent=True, rg=finds_rg)
+ assert system.count(RG_HINT) == int(finds_rg and bool({"bash", "powershell"} & set(tool_names)))
+ # Search options and exhaustive discovery are not part of this PATH hint.
+ assert "rg --files" not in system
+
+
async def test_the_system_prompt_lists_every_tool_the_run_offers(engine, session, tmp_path, published) -> None:
harness = _Harness(
engine, tmp_path, "avibe", [[Done(assistant("ok"))]],
@@ -1785,6 +1801,7 @@ async def test_the_bash_rule_names_rg_only_when_the_turns_commands_find_it(
system = harness.provider.requests[0].system
assert ("- Use bash for file operations like ls, rg, find" in system) is finds_rg
assert ("- Use bash for file operations like ls, grep, find" in system) is not finds_rg
+ assert system.count(RG_HINT) == int(finds_rg)
def _agent_store(engine):
@@ -2909,6 +2926,7 @@ async def test_a_turns_bash_runs_the_managed_rg_when_the_service_path_has_none(
result = (await harness.context_rows())[2].message
assert not result.is_error and "ripgrep 15.2.0" in result.content[0].text
assert "- Use bash for file operations like ls, rg, find" in harness.provider.requests[0].system
+ assert harness.provider.requests[0].system.count(RG_HINT) == 1
async def test_bash_runs_with_the_turns_caller_environment(engine, session, tmp_path, published) -> None: