Skip to content

Commit 9849077

Browse files
Eric Wheelerdaniel-lxs
authored andcommitted
fix: ensure AI uses tools before asking user questions
This change adds explicit instructions to the ask_followup_question tool to ensure the AI first attempts to use available tools like search_files and list_files to locate information before asking the user questions. Fixes #3873 Signed-off-by: Eric Wheeler <[email protected]>
1 parent 6a9503d commit 9849077

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/prompts/tools/ask-followup-question.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
export function getAskFollowupQuestionDescription(): string {
22
return `## ask_followup_question
33
Description: Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.
4+
IMPORTANT: Before asking the user for information:
5+
1. YOU MUST FIRST use available tools (eg, search_files, list_files, ...) to locate any needed information
6+
2. YOU MUST ONLY request user-provided details when those tools cannot retrieve them (eg, design specific considerations).
7+
3. YOU MUST PRIORITIZE your own knowledge and ONLY ask the user if you lack the answer when multiple options are suitable and require human consideration.
8+
49
Parameters:
510
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
611
- follow_up: (required) A list of 2-4 suggested answers that logically follow from the question, ordered by priority or logical sequence. Each suggestion must:

0 commit comments

Comments
 (0)