From 646ed365274050fb1593198b80c44cd891e16a4c Mon Sep 17 00:00:00 2001 From: "Amar Sood (tekacs)" Date: Sat, 12 Apr 2025 07:42:08 -0400 Subject: [PATCH] Remind the LLM that it doesn't need to use View on files found by Discovery --- aider/coders/navigator_prompts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aider/coders/navigator_prompts.py b/aider/coders/navigator_prompts.py index 03cb7b760..96904d21b 100644 --- a/aider/coders/navigator_prompts.py +++ b/aider/coders/navigator_prompts.py @@ -38,18 +38,18 @@ Act as an expert software engineer with the ability to autonomously navigate and ### File Discovery Tools - **ViewFilesAtGlob**: `[tool_call(ViewFilesAtGlob, pattern="**/*.py")]` - Find files matching a glob pattern and add them to context as read-only. + Find files matching a glob pattern. **Found files are automatically added to context as read-only.** Supports patterns like "src/**/*.ts" or "*.json". - **ViewFilesMatching**: `[tool_call(ViewFilesMatching, pattern="class User", file_pattern="*.py")]` - Search for text in files and add matching files to context as read-only. + Search for text in files. **Matching files are automatically added to context as read-only.** Files with more matches are prioritized. `file_pattern` is optional. - **Ls**: `[tool_call(Ls, directory="src/components")]` List files in a directory. Useful for exploring the project structure. - **ViewFilesWithSymbol**: `[tool_call(ViewFilesWithSymbol, symbol="my_function")]` - Find files containing a specific symbol (function, class, variable) and add them to context as read-only. + Find files containing a specific symbol (function, class, variable). **Found files are automatically added to context as read-only.** Leverages the repo map for accurate symbol lookup. ### Context Management Tools @@ -131,8 +131,8 @@ When you include any tool call, the system will automatically continue to the ne 7. **Final Response:** Provide the final answer or result. Omit tool calls unless further exploration is needed. ### Exploration Strategy -- Use discovery tools (`ViewFilesAtGlob`, `ViewFilesMatching`, `Ls`, `ViewFilesWithSymbol`) to identify relevant files initially. -- Add promising files to context with `View` for focused investigation. +- Use discovery tools (`ViewFilesAtGlob`, `ViewFilesMatching`, `Ls`, `ViewFilesWithSymbol`) to identify relevant files initially. **These tools automatically add found files to context as read-only.** +- Use `View` *only* if you need to add a specific file *not* already added by discovery tools, or one that was previously removed or is not part of the project structure (like an external file path mentioned by the user). - Remove irrelevant files with `Remove` to maintain focus. - Convert files to editable with `MakeEditable` *only* when you are ready to propose edits. - Include any tool call to automatically continue exploration to the next round. @@ -141,7 +141,7 @@ When you include any tool call, the system will automatically continue to the ne - All tool calls MUST be placed after a '---' line separator at the end of your message - Use the exact syntax `[tool_call(ToolName, param1=value1, param2="value2")]` for execution - Tool names are case-insensitive; parameters can be unquoted or quoted -- Verify files aren't already in context before adding them with `View` +- **Remember:** Discovery tools (`ViewFilesAtGlob`, `ViewFilesMatching`, `ViewFilesWithSymbol`) automatically add found files to context. You usually don't need to use `View` immediately afterward for the same files. Verify files aren't already in context *before* using `View`. - Use precise search patterns with `ViewFilesMatching` and `file_pattern` to narrow scope - Target specific patterns rather than overly broad searches - Remember the `ViewFilesWithSymbol` tool is optimized for locating symbols across the codebase