Fix duplicate command registration for custom chat modes#290010
Merged
bryanchen-d merged 1 commit intomainfrom Jan 23, 2026
Merged
Fix duplicate command registration for custom chat modes#290010bryanchen-d merged 1 commit intomainfrom
bryanchen-d merged 1 commit intomainfrom
Conversation
Custom modes with names conflicting with builtin modes are now skipped. Also handles name collisions among custom modes (later wins). Fixes #289890
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a duplicate command registration error that occurred when custom chat modes had naming conflicts with builtin modes or with each other. The issue manifested as "Cannot register two commands with the same id" errors during workbench startup.
Changes:
- Introduced a helper function
getCustomModesWithUniqueNamesthat filters custom modes to exclude those with names conflicting with builtin modes and resolves custom-to-custom name collisions - Updated the
ChatAgentActionsContributionconstructor to fetch builtin modes and apply collision detection during initialization - Refactored the mode change event handler to use the same filtering logic for consistency
rzhao271
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom modes with names conflicting with builtin modes are now skipped.
Fixes #289890