Skip to content

Conversation

@kevinfjiang
Copy link
Contributor

Summary

When the editor is invalid, will spam an error message. It will spam so many messages, that the user can't even select a new editor nor ctrl+c out the program. Instead of spamming the message, we will simply clear the invalid preferredEditor to prevent the spam.

Details

This only occurs if the preferredEditor field in settings.json is set to an invalid editor. Which is rare but can happen if the user is adding an editor to gemini cli

Related Issues

Closes #16091

How to Validate

To validate, modify your preferredEditor in your .gemini/settings.json to an invalid editor. Then open the /editor menu.

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

@kevinfjiang kevinfjiang requested a review from a team as a code owner January 8, 2026 04:57
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kevinfjiang, 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 critical usability issue where an invalid preferredEditor setting would cause the application to become unresponsive due to an endless stream of error messages. The core change introduces a mechanism to automatically clear any unsupported editor configuration, ensuring a more robust and user-friendly experience by preventing application lock-ups and enabling users to easily rectify their editor preferences.

Highlights

  • Error Spam Prevention: The change prevents the application from spamming error messages when an invalid preferredEditor is configured, which previously led to an unresponsive state.
  • Invalid Editor Handling: Instead of continuous errors, the system now automatically clears the invalid preferredEditor setting, allowing users to select a valid editor.
  • Test Coverage: A new test case has been added to EditorSettingsDialog.test.tsx to specifically validate the clearing of an invalid preferredEditor.
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.

@kevinfjiang
Copy link
Contributor Author

/gemini review

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 addresses a critical bug where an invalid editor configuration causes the application to spam errors and become unresponsive. The proposed fix of clearing the invalid setting is a good approach. However, the implementation introduces a side effect in the render function of a React component, which is a critical anti-pattern. My review includes a suggestion to refactor this using a useEffect hook to align with React best practices and prevent potential issues.

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

The pull request effectively addresses the issue of the CLI spamming error messages when an invalid preferredEditor is configured. By clearing the invalid setting, the user experience is significantly improved, preventing the application from becoming unresponsive. The added test case thoroughly validates this new behavior, ensuring the fix works as intended and preventing regressions. The changes are well-implemented and directly resolve the reported problem.

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spam loop Editor is not supported: ${currentPreference} when the preferredEditor is an invalid value

1 participant