feat: add option to disable follow-up questions from LLM

- Add alwaysAllowFollowupQuestions to SystemPromptSettings interface
- Pass setting through generateSystemPrompt and Task.ts
- Conditionally exclude ask_followup_question tool when disabled
- Update UI description to clarify behavior when disabled

Fixes #6940
This commit is contained in:
Roo Code 2025-08-11 16:33:05 +00:00
parent 76e5a726a3
commit d89a8f7647
5 changed files with 11 additions and 1 deletions

View file

@ -118,6 +118,11 @@ export function getToolDescriptionsForMode(
tools.delete("update_todo_list")
}
// Conditionally exclude ask_followup_question if disabled in settings
if (settings?.alwaysAllowFollowupQuestions === false) {
tools.delete("ask_followup_question")
}
// Map tool descriptions for allowed tools
const descriptions = Array.from(tools).map((toolName) => {
const descriptionFn = toolDescriptionMap[toolName]

View file

@ -5,4 +5,5 @@ export interface SystemPromptSettings {
maxConcurrentFileReads: number
todoListEnabled: boolean
useAgentRules: boolean
alwaysAllowFollowupQuestions: boolean
}

View file

@ -1898,6 +1898,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
maxConcurrentFileReads,
maxReadFileLine,
apiConfiguration,
alwaysAllowFollowupQuestions,
} = state ?? {}
return await (async () => {
@ -1928,6 +1929,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
todoListEnabled: apiConfiguration?.todoListEnabled ?? true,
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? true,
},
)
})()

View file

@ -25,6 +25,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
language,
maxReadFileLine,
maxConcurrentFileReads,
alwaysAllowFollowupQuestions,
} = await provider.getState()
// Check experiment to determine which diff strategy to use
@ -85,6 +86,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
todoListEnabled: apiConfiguration?.todoListEnabled ?? true,
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? true,
},
)

View file

@ -172,7 +172,7 @@
},
"followupQuestions": {
"label": "Question",
"description": "Automatically select the first suggested answer for follow-up questions after the configured timeout",
"description": "Allow the AI to ask follow-up questions. When disabled, the AI will not have access to the question-asking tool and must proceed without clarification",
"timeoutLabel": "Time to wait before auto-selecting the first answer"
},
"execute": {