Skip to content

runSubagent tool not available to custom agents invoked as subagents (nested subagent invocation broken) #307547

@dpearson2699

Description

@dpearson2699

Bug Description

Custom .agent.md files with tools: ['agent'] and agents: ['Explore'] in their YAML frontmatter do not receive the runSubagent tool when they are invoked as subagents themselves (depth-2 nesting). The chat.subagents.allowInvocationsFromSubagents setting is enabled but has no effect.

Per the Nested subagents documentation, custom agents should be able to invoke other subagents when:

  1. tools: ['agent'] is in the agent's frontmatter
  2. agents: ['Explore'] lists available agents
  3. github.copilot.chat.subagents.allowInvocationsFromSubagents is true

Steps to Reproduce

  1. Create a custom agent .github/agents/qa-investigator.agent.md with:
---
name: qa-investigator
description: "Read-only edge-case investigator"
tools: ['read', 'search', 'agent']
agents: ['Explore']
---
  1. Enable the setting:
"github.copilot.chat.subagents.allowInvocationsFromSubagents": true
  1. Create a parent agent .github/agents/fix-issue.agent.md that invokes qa-investigator as a subagent via runSubagent.

  2. From the parent agent's workflow, invoke the QA agent and instruct it to use the Explore subagent.

Expected Behavior

The QA agent (depth-2) should have runSubagent in its tool inventory and be able to invoke the Explore agent.

Actual Behavior

The QA agent at depth-2 does not have runSubagent available. When asked to list all available tools, it returns 36 tools — none of which is runSubagent.

The only subagent-like tool available at depth-2 is search_subagent.

Tool inventory at depth-2 (truncated to relevant entries):

search_subagent       ✅ Available  
runSubagent           ❌ NOT available
execution_subagent    ❌ NOT available

Confirmation that depth-1 works:

When the same QA agent is invoked directly by the user (depth-1, not as a subagent), the runSubagent tool IS available and the Explore agent can be invoked successfully. The issue is specific to depth-2 (subagent invoking subagent).

Environment

  • VS Code: 1.115.0-insider (arm64)
  • Copilot Chat Extension: 0.43.2026040204
  • OS: macOS 26.3.1
  • Setting: github.copilot.chat.subagents.allowInvocationsFromSubagents: true

Additional Context

The agent tool alias does not appear in the extension's languageModelToolSets (which only contains edit, execute, read, search, vscode, web). It may be resolved at the VS Code platform level, but that resolution appears to not carry through to subagent contexts.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions