Skip to content

Support qualified tool names in user tool sets#320265

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/support-qualified-names
Open

Support qualified tool names in user tool sets#320265
Copilot wants to merge 3 commits into
mainfrom
copilot/support-qualified-names

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 6, 2026

Description

User tool sets (*.toolsets.jsonc) resolved tools entries only by unqualified reference name. Tools referenced in prompts/chat-modes by qualified names — vscode/memory, github/*, execute/runInTerminal — never matched, so MCP (github, azure) and built-in tool-set members were silently dropped.

{
  "CurrentTools": {
    "tools": ["vscode/memory", "execute/runInTerminal", "read/readFile", "github/*"],
    "description": "Slim tools",
    "icon": "tools"
  }
}

Resolution now flows through full reference names, which is how tools are referenced everywhere else.

Changes

  • Member resolution (toolSetsContribution.ts): resolve each tools entry via getToolByFullReferenceName first — handles qualified names and their unqualified aliases — then fall back to the legacy getToolByName/getToolSetByName lookups for backward compatibility.
  • Schema completions: build the JSON schema enum from qualified full reference names (getFullReferenceName) so autocomplete in the toolsets file matches prompt referencing.
  • Interface: widen getFullReferenceName to accept IToolData | IToolSet (implementation already supported it); update the mock accordingly.
  • Test: cover qualified-name round-tripping for tools and tool sets in languageModelToolsService.test.ts.
image

Copilot AI requested review from Copilot and removed request for Copilot June 6, 2026 22:45
Copilot AI linked an issue Jun 6, 2026 that may be closed by this pull request
Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 6, 2026 22:51
Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 6, 2026 23:01
Copilot AI changed the title [WIP] Add support for qualified names in tool sets Support qualified tool names in user tool sets Jun 6, 2026
Copilot AI requested a review from jamesmontemagno June 6, 2026 23:02
@jamesmontemagno jamesmontemagno marked this pull request as ready for review June 6, 2026 23:45
Copilot AI review requested due to automatic review settings June 6, 2026 23:45
Copy link
Copy Markdown
Member

@jamesmontemagno jamesmontemagno left a comment

Choose a reason for hiding this comment

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

Tested and working for me here

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 user tool sets (*.toolsets.jsonc) dropping tools/tool sets referenced via qualified “full reference names” by switching resolution and schema completions to use ILanguageModelToolsService.getToolByFullReferenceName(...) / getFullReferenceName(...), aligning tool set configuration with prompt/tool referencing semantics.

Changes:

  • Update tool set member resolution to prefer full-reference-name lookup (qualified + aliases), with legacy unqualified fallback.
  • Update the toolsets JSON schema enum values to emit full reference names for tools and tool sets.
  • Widen getFullReferenceName(...) to accept IToolData | IToolSet, and add a round-trip test for qualified names.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/tools/mockLanguageModelToolsService.ts Updates mock interface signature for getFullReferenceName to accept tools and tool sets.
src/vs/workbench/contrib/chat/test/browser/tools/languageModelToolsService.test.ts Adds test coverage for qualified full-reference-name round-tripping for tools and tool sets.
src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts Widens the ILanguageModelToolsService.getFullReferenceName interface signature to include IToolSet.
src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.ts Uses full reference names in schema completions and resolves tool set members via full reference name first, with legacy fallback.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

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.

[tools sets] support qualified names

3 participants