Skip to content

Custom agent tool definitions not honored when Copilot CLI runs as a third-party agent in VS Code #304574

@v-rperez030

Description

@v-rperez030

When the Copilot CLI runs as a third-party agent inside VS Code, custom agents invoked as sub-agents do not receive the tools declared in their .agent.md definition files. The agents are restricted to a limited read-only set (file viewing only), regardless of what the tools property specifies.

The same agents work correctly when the CLI runs natively in the terminal, where they receive full access to their declared tools including GitHub MCP tools and terminal execution.

Steps to reproduce

  1. Define a custom agent in ~/.copilot/agents/ with specific tools declared in the YAML frontmatter (e.g., github/search_issues, read).
  2. Start the Copilot CLI as a third-party agent inside VS Code.
  3. Ask the CLI to delegate a task to the custom agent.
  4. Observe that the sub-agent reports having only file-viewing tools (grep, glob, view) and cannot access its declared tools.
  5. Run the same agent from the CLI natively in the terminal. The agent receives all declared tools and works as expected.

Additional testing

  • Removing the tools property entirely (which per the custom agents configuration docs enables all available tools) produces the same restricted behavior.
  • Setting Copilot Chat to "Bypass Approvals" permission level does not change the outcome. The sub-agent still only receives read-only file tools.

These results suggest the restriction is not related to tool naming, agent configuration, or permission settings, but to how VS Code mediates tool access for third-party agents.

Expected behavior

Custom agents invoked as sub-agents should receive the tools declared in their agent definition, regardless of whether the CLI is running natively or inside VS Code.

Actual behavior

The VS Code host restricts sub-agents to a limited read-only tool set, silently ignoring the tools property from the agent definition. No error or warning is surfaced.

Environment

  • VS Code Insiders 1.113.0-insider
  • OS: Linux x64 (WSL2)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions