mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-01 07:24:38 -07:00
fix(plan): make question type required in AskUser tool (#18959)
This commit is contained in:
@@ -42,7 +42,7 @@ export class AskUserTool extends BaseDeclarativeTool<
|
||||
maxItems: 4,
|
||||
items: {
|
||||
type: 'object',
|
||||
required: ['question', 'header'],
|
||||
required: ['question', 'header', 'type'],
|
||||
properties: {
|
||||
question: {
|
||||
type: 'string',
|
||||
@@ -111,7 +111,7 @@ export class AskUserTool extends BaseDeclarativeTool<
|
||||
|
||||
for (let i = 0; i < params.questions.length; i++) {
|
||||
const q = params.questions[i];
|
||||
const questionType = q.type ?? QuestionType.CHOICE;
|
||||
const questionType = q.type;
|
||||
|
||||
// Validate that 'choice' type has options
|
||||
if (questionType === QuestionType.CHOICE) {
|
||||
@@ -186,7 +186,7 @@ export class AskUserInvocation extends BaseToolInvocation<
|
||||
): Promise<ToolAskUserConfirmationDetails | false> {
|
||||
const normalizedQuestions = this.params.questions.map((q) => ({
|
||||
...q,
|
||||
type: q.type ?? QuestionType.CHOICE,
|
||||
type: q.type,
|
||||
}));
|
||||
|
||||
return {
|
||||
@@ -210,9 +210,7 @@ export class AskUserInvocation extends BaseToolInvocation<
|
||||
}
|
||||
|
||||
async execute(_signal: AbortSignal): Promise<ToolResult> {
|
||||
const questionTypes = this.params.questions.map(
|
||||
(q) => q.type ?? QuestionType.CHOICE,
|
||||
);
|
||||
const questionTypes = this.params.questions.map((q) => q.type);
|
||||
|
||||
if (this.confirmationOutcome === ToolConfirmationOutcome.Cancel) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user