ZIm/assets
Oleksiy Syvokon 99df1190a9
agent: Include grep-related instructions in the prompt only if the tool is available (#29536)
This change updates the system prompt to conditionally include
`grep`-related instructions based on whether the `grep` tool is enabled.

Implementation details:
1. Add a `has_tool` handlebars helper.
2. Pass the `model` to all locations where the prompt is built.
3. Use `{{#if has_tool "grep"}}` in the system prompt to gate
`grep`-specific instructions.

Testing:
- Unit tests for the `hasTool` helper.
- Unit tests to verify that `grep`-related instructions are included /
omitted from the prompt as appropriate.
- Manual agent evaluation:
- Setup: Asked the Agent "List all impls of MyTrait in the project"
using a custom "No tools" profile (all tools disabled).
- Before the change: The Agent attempted to call `grep`, encountered an
error, then realized the tool was unavailable.
- After the change: The Agent immediately asked to enable a search tool.

Note: in principle, `grep`/`read_file` tool descriptions alone might be
enough, but to confirm this we need more evaluation. If it turns out to
be true, we'll be able to remove grep-specific instructions from the
system prompt and undo this change.

Release Notes:

- N/A
2025-04-28 19:47:40 +00:00
..
fonts Fix font selection on macOS (#13615) 2024-06-27 17:02:45 -06:00
icons agent: Support pasting images as context (#29177) 2025-04-22 09:01:01 +00:00
images add ui::Vector and separate images from icons (#17815) 2024-09-13 17:44:16 -04:00
keymaps vim: Add neovim 0.11 default mappings (#28602) 2025-04-28 14:14:43 -04:00
prompts agent: Include grep-related instructions in the prompt only if the tool is available (#29536) 2025-04-28 19:47:40 +00:00
settings editor: Add setting for snippet sorting behavior for code completion (#29429) 2025-04-25 22:35:12 +05:30
sounds Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
themes theme: Make Gruvbox terminal ANSI magenta more vibrant (#27166) 2025-04-07 18:25:24 +00:00