ZIm/assets/prompts
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
..
assistant_system_prompt.hbs agent: Include grep-related instructions in the prompt only if the tool is available (#29536) 2025-04-28 19:47:40 +00:00
content_prompt.hbs Tweak assistant prompt to only fix diagnostic issues when requested to do so (#18596) 2024-10-02 09:29:11 -04:00
suggest_edits.hbs Update suggest_edits prompt to clarify usage of <old_text> when using update/create operations (#22341) 2025-01-08 23:45:15 +00:00
terminal_assistant_prompt.hbs Allow prompt templates to be overridden in the zed configuration directory (#15887) 2024-08-06 19:30:48 -06:00