diff --git a/extensions/cli/src/quiz/types.ts b/extensions/cli/src/quiz/types.ts index a1915089f..04f27b837 100644 --- a/extensions/cli/src/quiz/types.ts +++ b/extensions/cli/src/quiz/types.ts @@ -1,7 +1,6 @@ export interface QuizQuestion { question: string; options?: string[]; - allowCustomAnswer?: boolean; defaultAnswer?: string; } diff --git a/extensions/cli/src/tools/askQuestion.ts b/extensions/cli/src/tools/askQuestion.ts index 2ca94fd62..c1f0f2f13 100644 --- a/extensions/cli/src/tools/askQuestion.ts +++ b/extensions/cli/src/tools/askQuestion.ts @@ -6,11 +6,13 @@ export const askQuestionTool: Tool = { name: "AskQuestion", displayName: "Ask Question", description: `Ask the user a clarifying question to gather requirements, preferences, or implementation details before proceeding. -**You should use this tool whenever you want to clarify your assumption or need answers to build your plan.** +Guidelines: +- You should use this tool **whenever you want to clarify your assumption or need answers to build your plan**. +- DO NOT supply "other" or "none of the above" or similar as an option. User can always provide a free-form answer when needed. `, parameters: { type: "object", - required: ["question"], + required: ["question", "options"], properties: { question: { type: "string", @@ -19,16 +21,11 @@ export const askQuestionTool: Tool = { options: { type: "array", description: - "Optional list of choices. If provided, user selects one. If omitted, user types a free-form answer.", + "The list of choices. Leave as empty array if user should provide a free-form answer.", items: { type: "string", }, }, - allowCustomAnswer: { - type: "boolean", - description: - "If true and options are provided, user can also type a custom answer instead of selecting from options", - }, defaultAnswer: { type: "string", description: @@ -41,15 +38,13 @@ export const askQuestionTool: Tool = { run: async (args: { question: string; options?: string[]; - allowCustomAnswer?: boolean; defaultAnswer?: string; }): Promise => { - const { question, options, allowCustomAnswer, defaultAnswer } = args; + const { question, options, defaultAnswer } = args; const answer = await quizService.askQuestion({ question, options, - allowCustomAnswer, defaultAnswer, }); diff --git a/extensions/cli/src/ui/components/ChatScreenContent.tsx b/extensions/cli/src/ui/components/ChatScreenContent.tsx index 44f0a38f7..49eed4058 100644 --- a/extensions/cli/src/ui/components/ChatScreenContent.tsx +++ b/extensions/cli/src/ui/components/ChatScreenContent.tsx @@ -57,7 +57,6 @@ export const ChatScreenContent: React.FC = ({ = ({ question, options: rawOptions, - allowCustomAnswer = false, defaultAnswer, requestId, onAnswer, @@ -54,12 +52,7 @@ export const QuizPrompt: React.FC = ({ return; } - if ( - hasOptions && - allowCustomAnswer && - key.upArrow && - customInput === "" - ) { + if (hasOptions && key.upArrow && customInput === "") { // exit out of typing a custom answer setIsCustomMode(false); setSelectedIndex(options.length - 1); @@ -89,7 +82,7 @@ export const QuizPrompt: React.FC = ({ ); } else if (key.downArrow) { if (hasOptions) { - if (selectedIndex === options.length - 1 && allowCustomAnswer) { + if (selectedIndex === options.length - 1) { setIsCustomMode(true); setSelectedIndex(0); } else { @@ -100,14 +93,7 @@ export const QuizPrompt: React.FC = ({ } } - if ( - allowCustomAnswer && - input && - !key.ctrl && - !key.meta && - !key.upArrow && - !key.downArrow - ) { + if (input && !key.ctrl && !key.meta && !key.upArrow && !key.downArrow) { setIsCustomMode(true); setCustomInput(input); } @@ -139,13 +125,11 @@ export const QuizPrompt: React.FC = ({ ); })} - {allowCustomAnswer && ( - - - {" "}(or start typing for custom answer) - - - )} + + + {" "}(or start typing for custom answer) + + )}