Skip to content

feat: configurable max follow-up suggestions for ask_followup_question tool#11896

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/configurable-followup-suggestions
Draft

feat: configurable max follow-up suggestions for ask_followup_question tool#11896
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/configurable-followup-suggestions

Conversation

@roomote-v0
Copy link
Contributor

@roomote-v0 roomote-v0 bot commented Mar 8, 2026

Related GitHub Issue

Closes: #11895

Description

This PR attempts to address Issue #11895. The ask_followup_question tool previously hard-coded maxItems: 4 for 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: Added maxFollowUpSuggestions field to baseProviderSettingsSchema (optional, range 1-10) and exported DEFAULT_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 a createAskFollowupQuestionTool(maxSuggestions) factory function. Default export preserved for backward compatibility.

  • src/core/prompts/tools/native-tools/index.ts: Added maxFollowUpSuggestions to NativeToolsOptions and used it in getNativeTools() to generate the dynamic tool definition.

  • src/core/task/build-tools.ts: Passes apiConfiguration.maxFollowUpSuggestions to getNativeTools().

  • src/core/prompts/sections/rules.ts: Replaced hard-coded "2-4" in rules text with dynamic 2-${maxSuggestions}.

  • src/core/prompts/types.ts: Added maxFollowUpSuggestions to SystemPromptSettings.

  • src/core/webview/generateSystemPrompt.ts and src/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

  • New unit tests in src/core/prompts/tools/native-tools/__tests__/ask_followup_question.spec.ts (8 tests) verify:
    • Default maxItems of 4
    • Custom maxItems values (1, 7, 8, 10)
    • Dynamic description text updates
    • getNativeTools integration with maxFollowUpSuggestions option
  • Existing tests for sections.spec.ts and askFollowupQuestionTool.spec.ts pass (33 tests).
  • Full lint and type-check pass across all packages.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes.
  • Documentation Impact: No external documentation changes needed; the setting is self-explanatory in the UI.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Interactively review PR in Roo Code Cloud

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Question tool allowed number suggestions is hard coded to be 2-4

1 participant