fix(cli): improve command conflict handling for skills#21942
fix(cli): improve command conflict handling for skills#21942NTaylorMullen merged 1 commit intomainfrom
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 addresses an issue where built-in CLI commands were being inadvertently renamed when extensions provided skills with conflicting names. The changes ensure that built-in commands take precedence, and any conflicting extension skills are automatically prefixed with their extension name, maintaining clarity and preventing unexpected command remappings. This improves the reliability and predictability of the command-line interface for users interacting with both core functionalities and installed extensions. 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 pull request effectively addresses the command conflict issue by prioritizing built-in commands and improving the conflict resolution logic for skills. The changes are well-structured and include necessary test updates. I've identified one critical issue regarding a potential type mismatch for agent definitions that should be addressed.
|
Size Change: +279 B (0%) Total Size: 26.5 MB ℹ️ View Unchanged
|
5174b9c to
92d6fae
Compare
mattKorwel
left a comment
There was a problem hiding this comment.
Looks reasonable pending passing tests and double check of 1 comment.
e727bf6 to
0647dc4
Compare
- Prioritize built-in commands in slashCommandProcessor to ensure they retain their intended names. - Add extensionName to SkillDefinition to track source extensions. - Update ExtensionManager to tag loaded skills with their source extension name. - Update SlashCommandResolver and SlashCommandConflictHandler to properly handle and describe conflicts involving skills. - Skill conflicts from extensions now produce clear notifications like "Extension 'google-workspace' skill '/chat' was renamed to '/google-workspace.chat'" instead of generic "Existing command" messages. Fixes built-in command rename issues observed on startup.
0647dc4 to
bc8c52f
Compare
Summary
Improve slash command conflict handling for skills and ensure built-in commands retain their intended names.
Otherwise with common extensions it's more likely to get conflicts like:

Details
Built-in commands like
/chatand/docswere being renamed (e.g., to/chat1) on startup if an extension (likegoogle-workspace) provided skills with the same name. This happened becauseSkillCommandLoaderwas prioritized overBuiltinCommandLoaderand the conflict resolution logic didn't properly identify skills.Changes:
BuiltinCommandLoaderto the top of the loaders array inslashCommandProcessorto give core commands precedence.extensionNamemetadata toSkillDefinitionand ensuredExtensionManagerpopulates it.SlashCommandResolverto recognize theSKILLkind and use theextensionNamefor standard/extension.commandprefixing.SlashCommandConflictHandlerto provide descriptive notifications for skill conflicts.Related Issues
Part of issue where built-in commands were being renamed on startup.
How to Validate
chat(e.g.google-workspace)./chatremains the built-in command.npm test -w @google/gemini-cli -- src/services/SlashCommandResolver.test.ts src/services/SlashCommandConflictHandler.test.ts src/services/SkillCommandLoader.test.tsto verify unit tests.Pre-Merge Checklist