Skip to content

Conversation

@tommaso-moro
Copy link
Contributor

@tommaso-moro tommaso-moro commented Dec 9, 2025

This PR introduces logic to allow non-breaking tool renaming. It does so by introducing Deprecation Aliases, i.e. mappings that map "old"/deprecated tool names (e.g. get_issue) to their new equivalent (e.g. issue_read) to gracefully handle cases where users have a server configuration that references old tool names.

Overview of changes:

  • Added DeprecatedToolAliases in deprecated_tool_aliases.go to have a single source of truth for tool names when renaming tools
  • Added logic to resolve aliases before registering tools
  • Added tests

Demo
You can see that mapping "test_1" to "get_me" enables "get_me"
Screenshot 2025-12-11 at 15 09 16

@tommaso-moro tommaso-moro changed the title Tommy/safe tool rename logic Add support for safe tool renaming Dec 9, 2025
@tommaso-moro tommaso-moro marked this pull request as ready for review December 11, 2025 15:14
@tommaso-moro tommaso-moro requested a review from a team as a code owner December 11, 2025 15:14
Copilot AI review requested due to automatic review settings December 11, 2025 15:14
Copy link
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 introduces a deprecation alias mechanism to enable safe, non-breaking tool renaming. When tools are renamed, old tool names can be mapped to their new canonical names, allowing existing configurations to continue working while issuing deprecation warnings.

Key changes:

  • Added infrastructure for mapping deprecated tool names to canonical names
  • Implemented alias resolution with user warnings when deprecated names are used
  • Empty alias map ready for future tool renames

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/github/deprecated_tool_aliases.go New file defining DeprecatedToolAliases map for maintaining backward compatibility when tools are renamed
pkg/toolsets/toolsets.go Added deprecatedAliases field to ToolsetGroup, implemented AddDeprecatedToolAliases and ResolveToolAliases methods
pkg/toolsets/toolsets_test.go Comprehensive test coverage for alias functionality including mockTool helper and tests for adding, resolving aliases, and registering specific tools
pkg/github/tools.go Integration point where aliases are added to the default toolset group
internal/ghmcp/server.go Resolves tool aliases after cleaning tool names and before registering specific tools

tommaso-moro and others added 3 commits December 11, 2025 15:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ub-mcp-server into tommy/safe-tool-rename-logic
@tonytrg
Copy link
Contributor

tonytrg commented Dec 11, 2025

LGTM if we stick to removing these mappings again and not carry them with us all the time.

@tommaso-moro tommaso-moro merged commit 94ee074 into main Dec 11, 2025
16 checks passed
@tommaso-moro tommaso-moro deleted the tommy/safe-tool-rename-logic branch December 11, 2025 16:46
@tommaso-moro
Copy link
Contributor Author

@tonytrg Fully agree! DMing you about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants