microsoft / microsoft/vscode

Agents window: sessions hang silently mid-turn, no error (subagent deselection stall / unanswered permission prompts)

Open
#327,029 1 comment 1 reaction 1 assignee Claimed by @osortega View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

- Copilot Chat Extension Version: (bundled with VS Code 1.128.0)
- VS Code Version: 1.128.0 (fc3def6774c76082adf699d366f31a557ce5573f)
- OS Version: Linux, Ubuntu 24.04, kernel 6.17
- Feature (e.g. agent/edit/ask mode): Agents window (Preview), Copilot CLI sessions (version 1.0.73)
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): not model-specific, reproduced across different selected models
- Logs: see two event-log signatures below, pulled from `~/.copilot/session-state//events.jsonl`

## Description

Sessions in the Agents window frequently hang mid-turn with no error surfaced to the user, especially when subagents are involved. Across multiple workspaces I found two distinct, directly evidenced failure signatures in the Copilot CLI session event logs. Neither produces any error, warning, or timeout. The session just stops producing events until the user notices and manually intervenes.

### Signature 1: silent stall after `subagent.deselected`, zero events logged

In one session (workspace A), this exact pattern occurred three separate times:

```
{"type":"subagent.deselected","data":{},"timestamp":"2026-07-22T16:17:44.007Z", ...}
```

followed by 2500 seconds (41+ min) of complete silence. No `tool.execution_start`, no `assistant.message`, nothing, until the user noticed and sent "Are you stuck?", which triggered:

```
{"type":"abort","data":{"reason":"user_initiated"},"timestamp":"2026-07-22T16:59:23.610Z", ...}
```

The same pattern repeated twice more in that session (19-min and multi-thousand-second silent gaps), recovering only via manual abort and resend each time.

### Signature 2: permission prompt requested but never surfaced or answered

In another session (workspace B), the event log shows a `permission.requested` (write permission for a file outside the current workspace root, in a different repo) that was approved once for an initial delete and recreate attempt, then immediately retried the same operation, firing a second `permission.requested` for the identical file that was never answered. The backing CLI process was confirmed alive (52+ min uptime) but sat idle indefinitely waiting on this decision, with nothing visible for the user to act on.

A third session (workspace C) showed a similar unresolved-permission gap that did eventually resolve, but only after 10 hours (`permission.requested` at 01:52:30 to `permission.completed` at 12:01:19), meaning it was live but effectively invisible and unnoticed the whole time.

## Impact

Both signatures are indistinguishable to the user: the agent appears to hang or think forever, and subagent-driven sessions in particular seem to disappear, unrecoverable without manual abort and retry. Nothing errors or warns, so this is very hard to self-diagnose. It required directly inspecting the Copilot CLI's local session event logs to find the pattern.

Steps to Reproduce:

1. Open the Agents window and run a Copilot CLI session that uses subagent orchestration (e.g. dispatching parallel agents) or writes to a path outside the active workspace root.
2. Let it run unattended for an extended period.
3. Observe that the session can silently stall after a `subagent.deselected` event, or block indefinitely on an unanswered/unsurfaced `permission.requested` event, with no error or timeout, only recoverable via manual abort.

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.