Skip to content

Conversation

@tommaso-moro
Copy link
Contributor

@tommaso-moro tommaso-moro commented Jan 9, 2026

Summary

When using --tools to request a tool that has a deprecated alias (e.g., list_workflow_runs which has been consolidated into actions_list), the tool should be found if the consolidation feature flag (remote_mcp_consolidated_actions) is off.

For example consider this configuration:

"args": [
	"run",
	"./cmd/github-mcp-server",
	"--tools=list_workflow_runs",
	"stdio"
],

// note: `remote_mcp_consolidated_actions` feature flag here is NOT enabled, so `list_workflow_runs` should be enabled

Expected: list_workflow_runs is available
Actual: 0 tools available

With the feature flag on, it worked correctly (resolved to actions_list via alias). With --toolsets=actions and the feature flag turned off, it also worked correctly:

"args": [
	"run",
	"./cmd/github-mcp-server",
	"--toolsets=actions",
	"stdio"
],

// note: `remote_mcp_consolidated_actions` feature flag here is NOT enabled, and indeed `list_workflow_runs` is enabled

In short: with remote_mcp_consolidated_actions turned off, "old" (aka pre-consolidation) tools should be configurable both via --toolsets and --tools, but in this case only --toolsets was working.

Root Cause
This bug was in the logic that handles the interaction of feature flags and deprecation aliases. The deprecated alias resolution always mapped old names to canonical names (list_workflow_runsactions_list), regardless of which tool variant was actually active. When the feature flag was off, only list_workflow_runs existed, but we were looking for actions_list because we had resolved the list_workflow_runs to actions_list regardless of the feature flag controlling which tools (pre vs post consolidation) should be enabled.

Solution
In this fix we store both the original name and the resolved alias in additionalTools. The feature flag filtering ensures only one tool variant is ever active, so there's no risk of enabling both.

I also added tests to avoid future regressions.

Demo (Screenshots)

FF is OFF, `list_workflow_runs` can be individually enabled Screenshot 2026-01-09 at 11 56 20
FF is ON, `list_workflow_runs` correctly maps to `actions_list` via the deprecation alias Screenshot 2026-01-09 at 11 57 21
Generally, tool-specific config works as intended Screenshot 2026-01-09 at 11 57 46

Why

Fixes https://github.com/github/copilot-agent-services/issues/1136

What changed

In this fix we store both the original name and the resolved alias in additionalTools.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

Copilot AI review requested due to automatic review settings January 9, 2026 11:53
@tommaso-moro tommaso-moro requested a review from a team as a code owner January 9, 2026 11:53
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 fixes a bug where the --tools flag wasn't working correctly with feature-flagged tools that have deprecated aliases. When a deprecated tool name was specified via --tools (e.g., list_workflow_runs), and the consolidation feature flag was off, the tool wasn't found because the alias resolution always mapped to the new canonical name regardless of which variant was actually active.

Key Changes

  • Modified alias resolution logic in builder.go to store both the original tool name and the resolved canonical name in additionalTools
  • Added comprehensive test coverage for the deprecated alias + feature flag interaction

Reviewed changes

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

File Description
pkg/inventory/builder.go Updated Build() method to store both original and canonical names in additionalTools map, allowing feature flag filtering to select the correct variant
pkg/inventory/registry_test.go Added TestWithTools_DeprecatedAliasAndFeatureFlag to verify correct behavior with both flag ON and OFF scenarios

Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

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

I think this looks good and is well tested. Good catch.

@tommaso-moro tommaso-moro merged commit b1ab893 into main Jan 9, 2026
22 checks passed
@tommaso-moro tommaso-moro deleted the tommy/ff-and-aliases-bug-fix branch January 9, 2026 12:10
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.

3 participants