feat: configurable max follow-up suggestions for ask_followup_question tool#11896
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
feat: configurable max follow-up suggestions for ask_followup_question tool#11896roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
Add maxFollowUpSuggestions setting (default: 4, range: 1-10) to ProviderSettings. This allows users to configure how many follow-up suggestions the model can offer, addressing the limitation where skills needing more than 4 options were constrained. Changes: - Add maxFollowUpSuggestions to baseProviderSettingsSchema - Convert ask_followup_question tool from static to dynamic (createAskFollowupQuestionTool) - Thread setting through NativeToolsOptions, build-tools, SystemPromptSettings - Update rules section "2-4" text to be dynamic - Add MaxFollowUpSuggestionsControl slider UI component - Add i18n strings for the new control - Add tests for the dynamic tool generation Closes #11895
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11895
Description
This PR attempts to address Issue #11895. The
ask_followup_questiontool previously hard-codedmaxItems: 4for follow-up suggestions, which prevented skills/modes needing more options (e.g., 7 choices) from presenting them all as buttons.Changes:
packages/types/src/provider-settings.ts: AddedmaxFollowUpSuggestionsfield tobaseProviderSettingsSchema(optional, range 1-10) and exportedDEFAULT_MAX_FOLLOW_UP_SUGGESTIONS(4),MIN_MAX_FOLLOW_UP_SUGGESTIONS(1),MAX_MAX_FOLLOW_UP_SUGGESTIONS(10) constants.src/core/prompts/tools/native-tools/ask_followup_question.ts: Converted from a static export to acreateAskFollowupQuestionTool(maxSuggestions)factory function. Default export preserved for backward compatibility.src/core/prompts/tools/native-tools/index.ts: AddedmaxFollowUpSuggestionstoNativeToolsOptionsand used it ingetNativeTools()to generate the dynamic tool definition.src/core/task/build-tools.ts: PassesapiConfiguration.maxFollowUpSuggestionstogetNativeTools().src/core/prompts/sections/rules.ts: Replaced hard-coded "2-4" in rules text with dynamic2-${maxSuggestions}.src/core/prompts/types.ts: AddedmaxFollowUpSuggestionstoSystemPromptSettings.src/core/webview/generateSystemPrompt.tsandsrc/core/task/Task.ts: Thread the setting through to the system prompt generation.webview-ui/src/components/settings/MaxFollowUpSuggestionsControl.tsx: New slider UI control (1-10 range).webview-ui/src/components/settings/ApiOptions.tsx: Wired up the new control in Advanced Settings.webview-ui/src/i18n/locales/en/settings.json: Added i18n strings for the new control.Default behavior is identical to before (max 4 suggestions).
Feedback and guidance are welcome.
Test Procedure
src/core/prompts/tools/native-tools/__tests__/ask_followup_question.spec.ts(8 tests) verify:getNativeToolsintegration withmaxFollowUpSuggestionsoptionsections.spec.tsandaskFollowupQuestionTool.spec.tspass (33 tests).Pre-Submission Checklist
Interactively review PR in Roo Code Cloud