SIGN IN SIGN UP

tools: initial implementation of virtual tools (#310)

This behavior is enabled behind a setting `"github.copilot.chat.virtualTools.enabled": true,`

When enabled, if the tool count is over a threshold value, we'll group
tools into 'virtual tools'. The virtual tools act as directories that
only activate and show the tools they contain when the model calls them.
Grouping is done for an entire extension or MCP server if it presents
a small number of MCP tools, or for a categorization of tools when there
are a large number. Built-in tools are never grouped.

Expanded tool groups are automatically re-collapsed, based on LRU, if
the too limit is exceeded, or optimistically to a lower threshold during
summarization when there's going to be a cache miss anyway.

Todo:
- Better validation of LM categorization (ensure no missing tools)
- General Telemetry
- And logic to ensure that the tool limit can never be hit (heirarchal grouping)
- Explore embeddings as better pre-selection of expanded virtual tools
- Explore subagents as an alternative to expansion
- Success telemetry based on mirrored requests
C
Connor Peet committed
2732a9f48f7025e44fb218e5adf3710c494baf32
Parent: 3e756ff
Committed by GitHub <noreply@github.com> on 7/19/2025, 1:56:21 AM