Skip to content

Fix duplicate command registration for custom chat modes#290010

Merged
bryanchen-d merged 1 commit intomainfrom
brchen/fix-duplicate-mode-action-registration
Jan 23, 2026
Merged

Fix duplicate command registration for custom chat modes#290010
bryanchen-d merged 1 commit intomainfrom
brchen/fix-duplicate-mode-action-registration

Conversation

@bryanchen-d
Copy link
Copy Markdown
Contributor

Custom modes with names conflicting with builtin modes are now skipped.

Fixes #289890

Custom modes with names conflicting with builtin modes are now skipped.
Also handles name collisions among custom modes (later wins).

Fixes #289890
Copilot AI review requested due to automatic review settings January 23, 2026 20:37
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getCustomModesWithUniqueNames that filters custom modes to exclude those with names conflicting with builtin modes and resolves custom-to-custom name collisions
  • Updated the ChatAgentActionsContribution constructor to fetch builtin modes and apply collision detection during initialization
  • Refactored the mode change event handler to use the same filtering logic for consistency

@bryanchen-d bryanchen-d merged commit ab29635 into main Jan 23, 2026
27 of 28 checks passed
@bryanchen-d bryanchen-d deleted the brchen/fix-duplicate-mode-action-registration branch January 23, 2026 23:51
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to create workbench contribution 'workbench.contrib.chatAgentActions'.

3 participants