bug fix: --tools flag not working with feature-flagged tools and deprecation aliases #1775
+60
−3
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.
Summary
When using
--toolsto request a tool that has a deprecated alias (e.g.,list_workflow_runswhich has been consolidated intoactions_list), the tool should be found if the consolidation feature flag (remote_mcp_consolidated_actions) is off.For example consider this configuration:
Expected:
list_workflow_runsis availableActual: 0 tools available
With the feature flag on, it worked correctly (resolved to
actions_listvia alias). With--toolsets=actionsand the feature flag turned off, it also worked correctly:In short: with
remote_mcp_consolidated_actionsturned off, "old" (aka pre-consolidation) tools should be configurable both via--toolsetsand--tools, but in this case only--toolsetswas 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_runs→actions_list), regardless of which tool variant was actually active. When the feature flag was off, onlylist_workflow_runsexisted, but we were looking foractions_listbecause we had resolved thelist_workflow_runstoactions_listregardless 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
FF is ON, `list_workflow_runs` correctly maps to `actions_list` via the deprecation alias
Generally, tool-specific config works as intended
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
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: 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
./script/lint./script/testDocs