diff --git a/src/core/prompts/tools/index.ts b/src/core/prompts/tools/index.ts index d455abb8d7..b87c8c0724 100644 --- a/src/core/prompts/tools/index.ts +++ b/src/core/prompts/tools/index.ts @@ -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] diff --git a/src/core/prompts/types.ts b/src/core/prompts/types.ts index 3977ea98c5..875c38e931 100644 --- a/src/core/prompts/types.ts +++ b/src/core/prompts/types.ts @@ -5,4 +5,5 @@ export interface SystemPromptSettings { maxConcurrentFileReads: number todoListEnabled: boolean useAgentRules: boolean + alwaysAllowFollowupQuestions: boolean } diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 5e96b6fb16..7770589c38 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1898,6 +1898,7 @@ export class Task extends EventEmitter implements TaskLike { maxConcurrentFileReads, maxReadFileLine, apiConfiguration, + alwaysAllowFollowupQuestions, } = state ?? {} return await (async () => { @@ -1928,6 +1929,7 @@ export class Task extends EventEmitter implements TaskLike { maxConcurrentFileReads: maxConcurrentFileReads ?? 5, todoListEnabled: apiConfiguration?.todoListEnabled ?? true, useAgentRules: vscode.workspace.getConfiguration("roo-cline").get("useAgentRules") ?? true, + alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? true, }, ) })() diff --git a/src/core/webview/generateSystemPrompt.ts b/src/core/webview/generateSystemPrompt.ts index b8e87a1d4a..321a3b398d 100644 --- a/src/core/webview/generateSystemPrompt.ts +++ b/src/core/webview/generateSystemPrompt.ts @@ -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("useAgentRules") ?? true, + alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? true, }, ) diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index eb893d6c51..7c6bce9951 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -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": {