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 <roo-code@z.ewheeler.org>
This commit is contained in:
Eric Wheeler 2025-05-22 18:13:56 -07:00 committed by Daniel Riccio
parent 6a9503da1d
commit ec976f6a66

View file

@ -1,6 +1,11 @@
export function getAskFollowupQuestionDescription(): string {
return `## ask_followup_question
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.
IMPORTANT: Before asking the user for information:
1. YOU MUST FIRST use available tools (eg, search_files, list_files, ...) to locate any needed information
2. YOU MUST ONLY request user-provided details when those tools cannot retrieve them (eg, design specific considerations).
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.
Parameters:
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
- 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: