feat(cli): implement dot-prefixing for slash command conflicts#20979
Conversation
Summary of ChangesHello, 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 significantly improves the handling of slash command conflicts within the CLI by introducing a robust dot-prefixing strategy for user, workspace, and extension-defined commands. This change ensures that all commands remain discoverable and uniquely addressable, even when their base names clash. Additionally, the system for reporting these conflicts has been refined to be more user-friendly and less intrusive. A new security feature has also been integrated to alert users to potentially deceptive URLs, bolstering the overall safety of command execution. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This PR introduces dot-prefixing for user and workspace slash command conflicts in the Gemini CLI, ensuring that multiple versions of a command are uniquely identifiable. It also enhances conflict reporting with consolidated feedback messages and updates unit tests to reflect the new behavior. The changes include modifications to CommandService, FileCommandLoader, SlashCommandConflictHandler, and several test files. The review focuses on ensuring the correctness of the conflict resolution logic and adherence to the repository's coding style.
d697cd6 to
981c1e8
Compare
Summary
This PR implements robust dot-prefixing for slash command name conflicts. It ensures that when multiple versions of a command exist, all are discoverable and uniquely identifiable via source-specific prefixes (e.g.,
user.launch,workspace.launch), while allowing Built-in commands to retain their primary names.Key Changes
CommandServiceinto a dedicated, pureSlashCommandResolverclass.SlashCommandResolverandSlashCommandConflictHandler.Related Issues
Related to: https://github.com/google-gemini/maintainers-gemini-cli/issues/1218
How to Validate
.gemini/commands/test-conflict.tomlin both your user config and project root.