microsoft / microsoft/vscode

[Copilot Agent] Explicitly selected read toolset is omitted from tools passed to a third-party language model provider

Open
#329,320 0 comments 0 reactions 1 assignee Claimed by @pwang347 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

- Copilot Chat Extension Version: 0.60.0 (built-in)
- VS Code Version: 1.132.0
- OS Version: Windows 11 10.0.26200 (build 26200)
- Feature: Agent mode
- Selected model: DeepSeek V4 Flash, provided by a third-party LanguageModelChatProvider extension (vizards.deepseek-v4-for-copilot 0.6.2)
- Logs: Sanitized request-dump summary below. I did not attach the full dump because it contains local conversation content.

## Steps to reproduce

1. Configure a third-party language model provider and select its model in VS Code Agent mode.
2. Open a new Agent chat session.
3. In the tool picker, enable the `read` toolset and `readFile`. In persisted VS Code state, both `read=true` and `copilot_readFile=true`.
4. Reference the `#read` toolset in the prompt and ask the agent to read the first line of `README.md`.
5. Inspect the `options.tools` received by the extension's `provideLanguageModelChatResponse` implementation.

## Expected

The explicitly referenced toolset should be expanded before the request reaches the language model provider. `options.tools` should contain `readFile` (internally `copilot_readFile` / `read_file`), or contain an `activate_*` virtual tool that can expose it.

## Actual

The first observable provider input contains only these three tools:

```text
insert_edit_into_file
replace_string_in_file
session_store_sql
```

There is no `readFile`, `read_file`, `copilot_readFile`, or any `activate_*` tool.

The final API wire request contains exactly the same three tools. The provider extension dumps `options.tools` before its own tool-processing code runs, so the read tool is already absent at the VS Code/Copilot Host -> LanguageModelChatProvider boundary.

## Additional observations

- VS Code persisted tool state contains 105 enabled individual tools; the `read` toolset and `copilot_readFile` are enabled.
- The chat-session data parses `#read` as a toolset containing `copilot_readFile`.
- The behavior is consistent for the initial Agent turn. In another session, the initial turn received only the same three tools, while a later user turn received about 19 read/search tools including `read_file`.
- This also reproduced before installing a separate skills/hooks plugin, so that plugin does not appear causal.
- The third-party provider extension only converts the received tool schemas; it does not filter ordinary tools.

This looks like an interaction between per-turn/virtual tool selection and explicit toolset expansion for extension-provided language models.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.