microsoft / microsoft/vscode

Opening editor Chat destroys standalone Agent session and creates phantom copilotcli session

Open
#331,006 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

## Description

A valid Copilot CLI session created in VS Code's standalone Agent window is
destroyed when the editor window's Chat panel is opened. The editor Chat panel
then requests unrelated copilotcli session IDs that do not exist on the
backend and displays:

Session not found on backend: copilotcli:/

The standalone Agent window remains attached to the session that the editor
Chat panel destroyed and hangs indefinitely.

## Environment

- VS Code: 1.133.0 stable, User Installer, x64
- GitHub Copilot Chat: built-in version 0.61.0
- OS: Windows
- Copilot account authenticated successfully
- Dart and Flutter extensions disabled during reproduction

## Reproduction

1. Fully close and reopen VS Code.
2. Open a workspace.
3. Open the standalone Agent window.
4. Create a new Agent session.
5. Send: `Reply with: session persistence works`.
6. Confirm that it responds and appears in the Agent session list.
7. Open the editor window's Chat panel.
8. Switch back to the Agent window.
9. The Agent session now hangs.
10. Return to the editor Chat panel.
11. It reports `Session not found on backend: copilotcli:/`.

## Backend evidence

The Copilot CLI process log shows the valid session being created:

Created session: 7cb9fc77-f719-4e9b-ad66-d74a3c7c1475

Immediately after opening/switching to editor Chat, it records:

Closing session 7cb9fc77-f719-4e9b-ad66-d74a3c7c1475
Destroyed session: 7cb9fc77-f719-4e9b-ad66-d74a3c7c1475

It then attempts to close phantom sessions that have no corresponding session
files:

Closing session 184add9f-3743-4fff-836d-e8b2c115097b
Failed to delete session ...: Session file not found

Closing session d61e39c8-b89c-4140-aa60-71f74a274941
Failed to delete session ...: Session file not found

The destroyed valid session had been correctly persisted in both
`.copilot/session-state` and `session-store.db` before the editor Chat panel
was opened.

## Troubleshooting already performed

- Fully rebooted Windows.
- Reinstalled VS Code stable in place using the official User Installer.
- Disabled Dart and Flutter extensions.
- Moved all Copilot session state and databases aside so VS Code recreated them
from scratch.
- Confirmed authentication, token acquisition, CLI server startup, and model
metadata retrieval.
- Confirmed the clean session store works until the editor Chat panel is
opened.

The issue remains reproducible after all of the above.

## Expected

Opening editor Chat must not close or destroy the active standalone Agent
session. Both views should refer to valid backend sessions or remain isolated.

## Actual

Editor Chat destroys the valid Agent backend session, creates/references
phantom session IDs, and leaves the Agent UI permanently hanging.

VS Code version: Code 1.133.0 (a5b500951314efd502d07465bd138dfbd714a960, 2026-08-11T22:14:08Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2503 [NVIDIA GeForce RTX 3060], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1062 *ACTIVE*
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|63.90GB (53.02GB free)|
|Process Argv|--crash-reporter-id 79a21b30-65f0-4e69-b3e2-34f5949fdf77|
|Screen Reader|no|
|VM|0%|
Extensions (4)

Name|Identifier|Author|Version
---|---|---|---
GitHub Actions|github.vscode-github-actions|github|0.32.3
Container Tools|ms-azuretools.vscode-containers|ms-azuretools|2.4.5
Dev Containers|ms-vscode-remote.remote-containers|ms-vscode-remote|0.466.0
PowerShell|ms-vscode.powershell|ms-vscode|2025.4.0

A/B Experiments

```
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
82j33506:31327384
envsactivate1:31551504
gh487529:31544284
cloudbuttont:31379625
3efgi100_wstrepl:31403338
839jf696:31457053
ec5jj548:31422691
prod-compl-treat:31564083
cp_cls_t_966_ss:31526232
4je02754:31466945
8hhj4413:31478653
cp_cls_t_1081:31454832
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
capico_axe_098a3278:31555651
ei9d7968:31496641
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
sessions_5:31532894
chatquotatrajectorynudge-control:31548766
ihg5j128:31534457
f412h606:31551416
7g2b5551:31542111
5fe6f778:31566737
allow-none:31555437
6i51c363:31551401
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31566037
a1hcc538:31559322
0c1h4866:31566224
vrbsty_tr:31561058
session-mark-done:31558131
5b8j3302:31564601

```

Contributor guide

Open the contributing guide

Research direction

Start with the Copilot CLI process log and the persisted `.copilot/session-state` and `session-store.db` records, comparing the standalone Agent session with the IDs requested by editor Chat. Reproduce the sequence of opening standalone Agent, creating a session, then opening editor Chat. Done means both views retain valid backend sessions without destroying the active session or creating phantom IDs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.