microsoft / microsoft/vscode

Agent Sessions: session terminates instead of waiting when a sub-agent is launched

Open
#326,835 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug (GitHub Copilot Chat / Agent Sessions)

## Description

When using the **Agents** (Agent Sessions) view in VS Code, every time the main agent delegates work to a sub-agent (background agent via the `task` tool), the session ends immediately instead of waiting for the sub-agent to complete and resuming with its result.

**Expected:** the parent session stays alive (or is resumed automatically) when the sub-agent completes, so the agent can consume the sub-agent's output and continue the task.

**Actual:** the session stops as soon as the sub-agent is launched. The sub-agent result is never consumed and the task is left unfinished.

## Steps to reproduce

1. Open the Agent Sessions view in VS Code.
2. Start an agent session on a task complex enough for the agent to delegate (e.g. a large codebase exploration where it spawns an `explore`/background sub-agent).
3. Observe: as soon as the sub-agent is launched, the parent session terminates instead of waiting for the sub-agent completion notification.

This happens **every time** a sub-agent is launched, making delegation unusable.

## Environment

- VS Code: 1.129.1 (commit 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8)
- OS: macOS (Darwin, arm64)
- Runtime: Copilot CLI runtime used by the Agent Sessions view
- Session state folder: `~/.copilot/session-state/`

Happy to provide session logs / debug logs (`GitHub.copilot-chat/debug-logs`) if useful.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in VS Code 1.129.1 by launching an Agent Session that delegates through the task tool. Inspect ~/.copilot/session-state/ and GitHub.copilot-chat/debug-logs, then trace how the Agent Sessions view handles sub-agent launch and completion notifications. Done means the parent session remains active, consumes the sub-agent result, and continues the task.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
ai, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.