-
Notifications
You must be signed in to change notification settings - Fork 295
Closed as not planned
Description
Summary
Request native support for an inline sub-agent tool (similar to VS Code Copilot's runSubagent) that allows a workflow agent to:
- Spawn an isolated sub-agent with a specific prompt and limited context
- Wait synchronously for its completion (blocking, not fire-and-forget)
- Receive the sub-agent's output as a return value in the parent agent's context
Motivation
Complex workflows benefit from parallelizing research across large codebases. For example, a specs-reviewer agent needs to search 12+ repositories for relevant patterns — doing this serially is slow and burns tokens on accumulated context.
In VS Code Copilot, runSubagent solves this by spawning stateless child agents that return a single result. Each sub-agent has isolated context, preventing token bloat in the parent.
Current limitations
dispatch-workflow: Fire-and-forget — no return values, no waiting, cannot coalesce resultsworkflow_call: Static YAML — cannot dynamically determine number/assignment of sub-tasks at runtime- MCP Scripts: Run on the runner host but cannot invoke the Copilot CLI because auth tokens are proxy-held and scrubbed from the agent environment
- Confirmed:
runSubagenttool is not available in the gh-aw Copilot CLI environment (tested in runs 22843694716 and 22843793775)
Proposed behavior
// Pseudocode usage inside a workflow agent
const result = runSubagent({
prompt: "Search repos/ehr/ and repos/erp/ for all GraphQL resolvers related to billing. Return file paths and brief descriptions.",
description: "Search billing resolvers",
// Optional: restrict context (directories, tools, etc.)
});
// result is a string with the sub-agent's findings
Key properties:
- Synchronous: Parent blocks until sub-agent completes
- Isolated context: Sub-agent starts fresh, does not see parent's accumulated context
- Returns output: Sub-agent's final message becomes the return value
- Respects workflow config: Inherits network rules, MCP servers, permissions from parent workflow
- Token budget: Sub-agent has its own token/continuation budget
Alternatives considered
- Serial execution: Works but is 3-5x slower and accumulates unnecessary context
- dispatch-workflow fan-out with collector: Two-phase (dispatcher → workers → collector) pattern works but is complex, requires artifact/issue/comment coordination, and adds significant latency
- MCP Script wrapping Copilot CLI: Blocked by the auth proxy architecture that (correctly) isolates API tokens
Environment
- gh-aw CLI v0.56.2
- Engine: copilot / claude-sonnet-4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels