Skip to content

Align tool names and add support for legacy reference identification#277047

Merged
pwang347 merged 27 commits intomainfrom
pawang/renameTools
Nov 20, 2025
Merged

Align tool names and add support for legacy reference identification#277047
pwang347 merged 27 commits intomainfrom
pawang/renameTools

Conversation

@pwang347
Copy link
Member

@pwang347 pwang347 commented Nov 13, 2025

Overview

The goal of this PR is to unify the tool names. As part of this change, we want to introduce a system that allows for deprecating old names but retaining backwards compatibility. Added as a contribution which will also allow extension authors similar capabilities.

Out of scope

  • Handling for nested toolsets
  • Manual ordering of tools

Updated picker

image

GIF

tools

See related change: microsoft/vscode-copilot-chat#1995

Fixes #272734

Copilot AI review requested due to automatic review settings November 13, 2025 01:46
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 aligns tool names and adds support for tool reference aliases to improve backward compatibility and tool discovery. The changes rename toolsets for clarity ("runCommands" → "shell", "runTasks" → "vscode") and introduce a mechanism for tools to have alternative names through toolReferenceAliases.

Key Changes:

  • Renamed VSCodeToolReference.runCommands to VSCodeToolReference.shell for better semantic clarity
  • Introduced toolReferenceAliases field across the tool data infrastructure (interfaces, DTOs, and extension points)
  • Added toolset merging logic to allow internal and external extensions to contribute to the same toolset
  • Added backward compatibility aliases for terminal and task tools (e.g., runCommands/runInTerminal, runTasks/runTask)

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/languageModelToolsService.ts Added toolReferenceAliases field to IToolData interface; renamed VSCodeToolReference.runCommands to shell
src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts Implemented alias matching logic with support for simple and qualified names; added trace logging for tool registration; updated GitHub-to-VSCode tool mapping
src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.ts Added toolReferenceAliases to extension point schema; implemented toolset merging logic to allow multiple extensions to contribute to same toolset
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.ts Renamed "runCommands" toolset to "shell"; renamed "runTasks" toolset to "vscode"; added logic to get or create toolsets instead of always creating new ones
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.ts Added backward compatibility alias runTasks/runTask
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.ts Added backward compatibility alias runTasks/getTaskOutput
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.ts Added backward compatibility alias runTasks/createAndRunTask
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Added backward compatibility alias runCommands/runInTerminal
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.ts Added backward compatibility alias runCommands/terminalSelection
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.ts Added backward compatibility alias runCommands/getTerminalOutput
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.ts Added backward compatibility alias runCommands/terminalLastCommand
src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts Added logic to add searchExtensions tool to vscode toolset if it exists
src/vs/workbench/contrib/extensions/common/searchExtensionsTool.ts Added toolReferenceAliases field (though redundant - same as toolReferenceName)
src/vs/workbench/contrib/chat/common/tools/tools.ts Added logic to add runSubagent tool to vscode toolset if it exists
src/vs/workbench/contrib/chat/common/tools/runSubagentTool.ts Added toolReferenceAliases field (though redundant - same as toolReferenceName)
src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts Renamed toolReferenceName from 'todos' to 'todo'; added 'todos' as alias for backward compatibility
src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.ts Added logic to track tools in toolsets to prevent duplicates in picker; added debug console.log statements
src/vs/workbench/contrib/chat/test/browser/languageModelToolsService.test.ts Updated test to use VSCodeToolReference.shell instead of runCommands
src/vs/workbench/api/common/extHost.protocol.ts Added toolReferenceAliases field to IToolDataDto
src/vs/workbench/api/browser/mainThreadLanguageModelTools.ts Added toolReferenceAliases field to tool data mapping
extensions/mermaid-chat-features/package.json Added example aliases 'mermaid' and 'diagram' to renderMermaidDiagram tool

@pwang347 pwang347 changed the title Align tool names and add aliases Align tool names and add support for legacy reference identification Nov 13, 2025
@pwang347 pwang347 requested a review from aeschli November 14, 2025 00:23
@pwang347 pwang347 marked this pull request as ready for review November 14, 2025 00:28
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 14, 2025
@pwang347 pwang347 requested a review from roblourens November 14, 2025 01:42
@aeschli
Copy link
Contributor

aeschli commented Nov 14, 2025

Looks good! Should also have some tests. Check out

test('toToolAndToolSetEnablementMap map Github to VSCode tools', () => {

@aeschli
Copy link
Contributor

aeschli commented Nov 14, 2025

And

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

So with the legacy names, do we respect them but still show a warning?

@microsoft microsoft deleted a comment from vs-code-engineering bot Nov 18, 2025
@pwang347
Copy link
Member Author

@aeschli thoughts on something like this?
image

I think we'll need some more changes for nested toolsets, but for now this should at least handle cases where a toolset is completely removed (no legacy names or current references)

roblourens
roblourens previously approved these changes Nov 18, 2025
Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

I don't know if you were in standup today, we were talking about the chat.tools.eligibleForAutoApproval setting, will the legacy reference names get applied to that?

@pwang347
Copy link
Member Author

I don't know if you were in standup today, we were talking about the chat.tools.eligibleForAutoApproval setting, will the legacy reference names get applied to that?

Thanks @roblourens, I synced with @joshspicer about this and there will be some small work involved for that setting, but should be doable.

@joshspicer
Copy link
Member

I will work on a fix for chat.tools.eligibleForAutoApproval targetting this branch

@pwang347 pwang347 merged commit f6ce5d1 into main Nov 20, 2025
28 checks passed
@pwang347 pwang347 deleted the pawang/renameTools branch November 20, 2025 01:53
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 4, 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.

agent files: align tool names to names from custom agents specification

6 participants