Repository navigation
GitHub Copilot Chat in WSL experiences 40-80 second startup delays due to CopilotCLIChatSessionContentProvider.listSessions #3652
Description
Describe the bug
Environment
- VS Code: 1.122.1
- GitHub Copilot Chat: 0.50.1
- WSL: Ubuntu
- OS Host: Windows 11
- Copilot account: Educational quota
- Remote Development: WSL
Description
GitHub Copilot Chat takes approximately 40-80 seconds to become available when running inside WSL.
The delay is reproducible across VS Code restarts and occurs even after:
- Clearing Copilot state
- Clearing workspace storage
- Reinstalling Copilot Chat
- Disabling local indexing
- Reducing workspace index size
- Disabling memory features
- Disabling MCP features
- Optimizing Git settings
- Verifying filesystem permissions
The extension itself activates quickly, but startup appears blocked by CopilotCLIChatSessionContentProvider.listSessions.
Observed Logs
ConversationFeature: Waiting for copilot token
[CopilotCLIChatSessionContentProvider] listSessions took 40514ms
Logged in as <account>
Got Copilot token
Copilot Chat: 0.50.1
Failed to create database. Falling back to in-memory db: Error: unable to open database file
Subsequent calls are fast:
[CopilotCLIChatSessionContentProvider] listSessions took 14ms
[CopilotCLIChatSessionContentProvider] listSessions took 38ms
[CopilotCLIChatSessionContentProvider] listSessions took 5ms
The large delay occurs only once during startup.
What Has Been Verified
Extension activation is not the problem
VS Code reports:
GitHub Copilot Chat
Activation: 2348ms
Network is not the problem
time curl -I https://api.github.comResult:
real 0m0.174s
Session database is tiny
session-store.db 4 KB
session-store.db-shm 32 KB
session-store.db-wal 149 KB
Session state is tiny
du -sh ~/.copilot/session-stateResult:
4.0K
Workspace indexing does not affect the issue
Tested:
"github.copilot.chat.localIndex.enabled": false
"github.copilot.chat.workspace.maxLocalIndexSize": 100No measurable improvement.
Git is not the problem
Git operations complete in milliseconds and repository scanning is fast.
Additional Observation
Copilot reports:
Failed to create database. Falling back to in-memory db.
However, Copilot successfully creates:
~/.vscode-server/data/User/globalStorage/github.copilot-chat/session-store.db
~/.vscode-server/data/User/globalStorage/github.copilot-chat/session-store.db-wal
~/.vscode-server/data/User/globalStorage/github.copilot-chat/session-store.db-shm
which suggests the failing database may be a different internal store.
Expected
Copilot Chat should become available within a few seconds, similar to Codex and other AI extensions running in the same WSL environment.
Actual
Copilot Chat consistently requires 40-80 seconds before becoming usable due to an extended listSessions operation during startup.
Reproducibility
100% reproducible across restarts.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
Activity
OmerFI commentedon Jun 6, 2026
Same root cause here, but much worse — and it doesn't just delay Copilot Chat: it freezes the entire extension host, taking every other extension down with it (including Python/Pylance).
Environment: Windows 11 + WSL2 (Ubuntu), VS Code 1.123.0, Copilot Chat 0.51.0 (built-in), Remote-WSL, educational quota (same as OP).
Measurements — first
listSessionsper extension-host start, from 3 days ofGitHub Copilot Chatlogs:Subsequent calls: 1–59 ms. So it's always the first (cold) call per extension host.
Evidence the whole extension host event loop is blocked during that window:
onLanguage:pythonactivation events (Pylance, debugpy, Jupyter) are only processed after the freeze ends — Python files are unusable until then. In my caseExtensionService#_doActivateExtension ms-python.vscode-pylancewas logged 158 s after window start.Request 'refresh' timed out after 30000ms) fires after 157 s instead of 30 s — i.e. evensetTimeouttimers are delayed, which rules out a mere slow async operation.[ExtensionHostConnection] The client has reconnectedevery ~20 s during the freeze (exthost can't answer keepalives).[CopilotCLI] OpenTelemetry enabled: exporter=file+listSessions took NNN msare logged, andactivationBlocker from 'languageModelAccess'reports the same duration as the freeze.This is likely also the real cause behind microsoft/vscode-python-environments#1546 and microsoft/vscode-python-environments#1554 — identical signature there (
Environment discovery took 130–150s,Setup appears hung during stage: managerRegistration, PET configure timeout). On my machine the Python side itself accounts for ~0.5 s (verified by running the bundledpet findstandalone); everything else was this freeze.Settings I initially tried (later found unreliable — see edit note above):
Triage detail:
CopilotCLIChatSessionContentProvider.listSessionsgoes through_loadSdk(), which loads the bundleddist/cli.js(~14 MB) and runs its first-time startup init. Loading that bundle standalone (node -e "require('.../dist/cli.js')") spends ~10 s wall with only ~1.4 s CPU before exiting — i.e. it blocks on I/O (not CPU) during init, which would explain why the freeze duration varies (61–430 s) independently of session data size (~/.copilotis 16 KB here, 0 sessions). The host-side concern is that this heavy bundled SDK is cold-loaded eagerly on the extension-host thread at startup.OmerFI commentedon Jun 6, 2026
Follow-up: the code that triggers this (
CopilotCLIChatSessionContentProvider/_loadSdk()) lives in the VS Code built-in Copilot Chat extension rather than the CLI itself, so the VS Code repo is probably where this gets fixed. It's tracked there as microsoft/vscode#319698 (same report) and microsoft/vscode#319710 (extension host blocked 60–135 s) — both assigned. I posted the detailed analysis + a verified settings-only workaround here: microsoft/vscode#319710 (comment)OmerFI commentedon Jun 8, 2026
Correction: the three-setting workaround I posted earlier is not reliable — the freeze recurred on later cold starts with the settings active (the initial fast result was a warm hit). Refined root cause + why there's no clean completions-preserving workaround in 1.123: microsoft/vscode#319710 (comment)
patniko commentedon Oct 26, 2026
Thanks for the detailed report and analysis. This startup delay comes from VS Code's built-in Copilot Chat extension (its Copilot CLI session provider loading at startup) rather than from Copilot CLI itself, so it's tracked in the VS Code repository: microsoft/vscode#319710 has been closed as fixed in the VS Code 1.125 milestone, and microsoft/vscode#319698 was closed as a duplicate. Please update to the latest VS Code, and if the delay persists, open an issue at https://github.com/microsoft/vscode/issues. Closing as answered — feel free to reopen if this doesn't cover your case.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.