Skip to content

Fix infinite dialog loop and add ESC key support in the /skills link command#26005

Closed
JayMeDotDot wants to merge 2 commits into
google-gemini:mainfrom
JayMeDotDot:fix/skills-link-dialog-loop
Closed

Fix infinite dialog loop and add ESC key support in the /skills link command#26005
JayMeDotDot wants to merge 2 commits into
google-gemini:mainfrom
JayMeDotDot:fix/skills-link-dialog-loop

Conversation

@JayMeDotDot

Copy link
Copy Markdown

Summary

When running the gemini skills link /path/to/my-skills-repo command, a confirmation dialog appears to request user consent. However, after the user selects "Yes" or "No," the dialog would not disappear, blocking further interaction.
And I found the dialog shows it supports ESC to exit, but it didn't work.

Fixed an infinite dialog loop in the /skills link command and added ESC key support to the ConsentPrompt component.

Details

  • Updated CommandUIContext to allow setConfirmationRequest(null).
  • Modified skillsCommand.ts to clear the confirmation request state after the user responds.
  • Added useKeypress handling to ConsentPrompt.tsx to handle the ESC key, which now triggers a cancellation (onConfirm(false)).
  • Updated the DialogFooter in ConsentPrompt to include "Esc cancel" hint.
  • Refactored ConsentPrompt.test.tsx to use renderWithProviders for proper context and added a test case for ESC key handling.

Related Issues

N/A

How to Validate

  1. Run npm run start.
  2. Execute /skills link <any_path>.
  3. Verify the confirmation dialog appears.
  4. Press Esc and verify the dialog disappears and focus returns to the input.
  5. Execute the command again and select "Yes" or "No" using the keyboard/Enter, verify the dialog disappears and doesn't reappear in a loop.
  6. Run npm test --workspace @google/gemini-cli --src/ui/components/ConsentPrompt.test.tsx.

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

@JayMeDotDot JayMeDotDot requested a review from a team as a code owner April 26, 2026 13:48
@google-cla

google-cla Bot commented Apr 26, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a usability issue where the confirmation dialog in the /skills link command would persist indefinitely after user input. By refactoring the state management for confirmation requests and introducing keyboard event handling, the dialog now correctly closes upon user response or when the ESC key is pressed, improving the overall user experience and command flow.

Highlights

  • Infinite Loop Resolution: Updated the confirmation request handling in skillsCommand.ts to properly clear the dialog state after user interaction, preventing the infinite loop.
  • ESC Key Support: Implemented useKeypress in the ConsentPrompt component to allow users to cancel the dialog using the ESC key.
  • Type Safety: Updated CommandContext and nonInteractiveUi to allow setConfirmationRequest to accept null, enabling explicit state clearing.
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.

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.

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

Copy link
Copy Markdown
Contributor

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 modifies the CLI's confirmation request flow to allow resetting the UI state and introduces ESC key support for the ConsentPrompt component. The skillsCommand.ts file was updated to manually clear the confirmation request upon user action, and the CommandContext type was adjusted to support null values. Additionally, the ConsentPrompt component now includes a keypress listener to handle the ESC key as a negative confirmation, supported by a new unit test. I have no feedback to provide.

@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Apr 26, 2026
@JayMeDotDot

Copy link
Copy Markdown
Author

Related Issues

#21297

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 27, 2026
- BerriAI/litellm#26577 fix(proxy): skip redundant tiktoken recount (merge-after-nits)
- BerriAI/litellm#26576 fix(proxy): load REDIS_* env vars when cache_params has non-connection keys (merge-as-is)
- QwenLM/qwen-code#3667 fix(cli): refresh static header on model switch (merge-after-nits)
- google-gemini/gemini-cli#26005 Fix infinite dialog loop and add ESC support in /skills link (merge-after-nits)
@gemini-cli

gemini-cli Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'.

This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

@gemini-cli

gemini-cli Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

@gemini-cli gemini-cli Bot closed this May 11, 2026
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m A medium sized PR status/need-issue Pull requests that need to have an associated issue. status/pr-nudge-sent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants