Skip to content

fix(plan): make question type required in AskUser tool#18959

Merged
Adib234 merged 4 commits intomainfrom
adibakm/question-type-required
Feb 13, 2026
Merged

fix(plan): make question type required in AskUser tool#18959
Adib234 merged 4 commits intomainfrom
adibakm/question-type-required

Conversation

@Adib234
Copy link
Contributor

@Adib234 Adib234 commented Feb 12, 2026

Summary

This PR makes the type property required in the Question interface for the ask_user tool. Previously, this property was optional and defaulted to 'choice' in the implementation. Making it required ensures explicit intent from the model, improves type safety across the codebase, and aligns the implementation with its telemetry requirements.

Details

Related Issues

Fixes #18930

How to Validate

AskUser tool should be working as expected with the set of changes

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@Adib234 Adib234 self-assigned this Feb 12, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Adib234, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request strengthens the ask_user tool by making the type property explicitly required within the Question interface. This change eliminates implicit behavior, improves type safety across the codebase, and ensures that the model's intent for question types is always clearly defined, aligning with better telemetry and overall code quality. It also updates the associated schema and test cases to reflect this new mandatory requirement.

Highlights

  • Type Property Made Required: The type property within the Question interface for the ask_user tool has been changed from optional to required, ensuring explicit definition of question types.
  • Schema Enforcement: The JSON schema for the ask_user tool was updated to enforce the type property as a mandatory field for all questions.
  • Implicit Defaulting Removed: The implicit defaulting of the type property to QuestionType.CHOICE when omitted has been removed from the AskUserTool implementation.
  • Test Case Updates: Numerous test cases across AskUserDialog.test.tsx, BubblingRegression.test.tsx, and ask-user.test.ts were updated to explicitly include the now-required type property in Question objects.
  • Validation Logic Refinement: A test case in ask-user.test.ts was modified to correctly validate against the absence of the type property, aligning with the new requirement.
Changelog
  • packages/cli/src/ui/components/AskUserDialog.test.tsx
    • Added type: QuestionType.CHOICE to numerous Question objects in test cases.
  • packages/cli/src/ui/components/BubblingRegression.test.tsx
    • Imported QuestionType.
    • Added type: QuestionType.CHOICE to a Question object in a test case.
  • packages/core/src/confirmation-bus/types.ts
    • Changed the type property in the Question interface from optional (type?: QuestionType) to required (type: QuestionType).
    • Updated comments to reflect that type is no longer optional and does not default to 'choice'.
  • packages/core/src/tools/ask-user.test.ts
    • Imported QuestionType.
    • Added type: QuestionType.CHOICE to many Question objects in test cases.
    • Updated a test case to specifically check for an error when the type property is missing, instead of implicitly defaulting to 'choice' and checking for missing options.
  • packages/core/src/tools/ask-user.ts
    • Modified the JSON schema to include type in the required properties for questions items.
    • Removed the fallback ?? QuestionType.CHOICE when accessing q.type in validateToolParams, shouldConfirmExecute, and execute methods, as type is now guaranteed to be present.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Size Change: -89 B (0%)

Total Size: 24.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.4 MB -89 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly makes the type property required on the Question interface. This is a good change for type safety and explicitness. The author has done a thorough job of updating the type definition, the tool schema, the implementation logic, and all the associated tests across the codebase. The changes are comprehensive and well-executed. I have no issues to report.

@jerop jerop self-requested a review February 12, 2026 22:01
@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 12, 2026
@Adib234 Adib234 marked this pull request as ready for review February 12, 2026 22:40
@Adib234 Adib234 requested a review from a team as a code owner February 12, 2026 22:40
@jerop jerop added this pull request to the merge queue Feb 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@jerop jerop added this pull request to the merge queue Feb 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@Adib234 Adib234 added this pull request to the merge queue Feb 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@Adib234 Adib234 enabled auto-merge February 13, 2026 03:24
@Adib234 Adib234 added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit d5dfae6 Feb 13, 2026
26 of 27 checks passed
@Adib234 Adib234 deleted the adibakm/question-type-required branch February 13, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make question type required in AskUser tool

3 participants