From 4b2202cd26627845ae5a1a1ee65fba75f45cba74 Mon Sep 17 00:00:00 2001 From: "Amar Sood (tekacs)" Date: Sat, 12 Apr 2025 10:29:53 -0400 Subject: [PATCH] Even more strident (and proximal) reminders to use tool-use editing --- aider/coders/navigator_prompts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/coders/navigator_prompts.py b/aider/coders/navigator_prompts.py index 6f911c415..8ec4f2741 100644 --- a/aider/coders/navigator_prompts.py +++ b/aider/coders/navigator_prompts.py @@ -337,6 +337,7 @@ Use SEARCH/REPLACE blocks **only** as a fallback mechanism when granular tools * If you must use SEARCH/REPLACE, adhere strictly to this format: +# Justification: I'm using SEARCH/REPLACE because [specific reasons why granular tools can't achieve this edit] ````python path/to/file.ext <<<<<<< SEARCH @@ -354,6 +355,7 @@ NOTE that this uses four backticks as the fence and not three! - For new files, use an empty SEARCH section. - To move code within a file, use two separate SEARCH/REPLACE blocks. - Respect the file paths exactly as they appear. + ### Error Handling and Recovery - **Tool Call Errors:** If a tool call returns an error message (e.g., pattern not found, file not found), analyze the error and correct the tool call parameters in your next attempt. - **Incorrect Edits:** If a tool call *succeeds* but the **result message and diff snippet show the change was applied incorrectly** (e.g., wrong location, unintended side effects): @@ -363,6 +365,7 @@ NOTE that this uses four backticks as the fence and not three! - **Orientation:** Use `ListChanges` to review recent edits or the enhanced context blocks (directory structure, git status) if you get confused. +Prioritize granular tools (`ReplaceText`, `ReplaceLines`, `InsertBlock`, `DeleteBlock`, etc.) over SEARCH/REPLACE blocks. Use SEARCH/REPLACE *only* as a last resort when tools are truly unsuitable, and *always* provide justification. Failure to prioritize tools is a failure to follow instructions. Always reply to the user in {language}. """ @@ -505,4 +508,4 @@ Let me explore the codebase more strategically this time: - I'll use tool calls to automatically continue exploration until I have enough information I'll start exploring again with improved search strategies to find exactly what we need. -""" \ No newline at end of file +"""