Skip to content

Commit d89a8f7

Browse files
committed
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
1 parent 76e5a72 commit d89a8f7

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

src/core/prompts/tools/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ export function getToolDescriptionsForMode(
118118
tools.delete("update_todo_list")
119119
}
120120

121+
// Conditionally exclude ask_followup_question if disabled in settings
122+
if (settings?.alwaysAllowFollowupQuestions === false) {
123+
tools.delete("ask_followup_question")
124+
}
125+
121126
// Map tool descriptions for allowed tools
122127
const descriptions = Array.from(tools).map((toolName) => {
123128
const descriptionFn = toolDescriptionMap[toolName]

src/core/prompts/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface SystemPromptSettings {
55
maxConcurrentFileReads: number
66
todoListEnabled: boolean
77
useAgentRules: boolean
8+
alwaysAllowFollowupQuestions: boolean
89
}

src/core/task/Task.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
18981898
maxConcurrentFileReads,
18991899
maxReadFileLine,
19001900
apiConfiguration,
1901+
alwaysAllowFollowupQuestions,
19011902
} = state ?? {}
19021903

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

src/core/webview/generateSystemPrompt.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
2525
language,
2626
maxReadFileLine,
2727
maxConcurrentFileReads,
28+
alwaysAllowFollowupQuestions,
2829
} = await provider.getState()
2930

3031
// Check experiment to determine which diff strategy to use
@@ -85,6 +86,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
8586
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
8687
todoListEnabled: apiConfiguration?.todoListEnabled ?? true,
8788
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
89+
alwaysAllowFollowupQuestions: alwaysAllowFollowupQuestions ?? true,
8890
},
8991
)
9092

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
},
173173
"followupQuestions": {
174174
"label": "Question",
175-
"description": "Automatically select the first suggested answer for follow-up questions after the configured timeout",
175+
"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",
176176
"timeoutLabel": "Time to wait before auto-selecting the first answer"
177177
},
178178
"execute": {

0 commit comments

Comments
 (0)