Chat panel hangs indefinitely when the Copilot backend process dies without automatic restart
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code: 1.137.0 (commit 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c), arm64
- macOS: 26.6.2 (build 25G83), Apple Silicon
- Workspace: multi-root-ish single folder containing ~124 git repos, ~252,000 files total
- Chat provider: GitHub Copilot Chat (native VS Code Chat feature, Copilot backend @github/copilot-darwin-arm64, headless stdio mode)
## Summary
The Chat panel gets stuck on an "analyzing"/spinner state indefinitely, with no error shown, no further activity, and no automatic recovery — happens on both short/simple prompts and long/complex ones, at unpredictable intervals.
## What I found investigating this
**1. The headless Copilot backend process frequently dies without a clean shutdown, and without being automatically restarted.**
Each backend instance logs to ~/.copilot/logs/process--.log. Looking at the 15 most recent backend log files:
- 13 of 15 end on "[INFO] Preparing runtime for graceful shutdown" → "[INFO] CLI server prepared for shutdown; transport remains open for RPC response", and never reach the normal terminal line "[INFO] CLI server stopped successfully".
- Across the full set of retained logs, only 1 process completed a clean full shutdown cycle — and that was a shutdown I triggered manually (kill ) while investigating, not a natural exit.
- Backend process lifetimes vary wildly (seconds to 20+ hours), so this doesn't look like a fixed idle timeout.
**2. No automatic recovery after the backend dies.**
After manually killing the active backend process (confirmed clean shutdown in its log — "Destroying 0 active sessions" then "CLI server stopped successfully"), no new backend process was spawned automatically. A new message sent into the still-open Chat conversation got no response at all — no error, no timeout, indefinitely — until I ran Developer: Restart Extension Host, which correctly spun up a fresh backend and unblocked the conversation immediately.
This suggests the Chat/Copilot integration doesn't detect that its backend connection (stdio transport) has died, and has no automatic reconnect/respawn logic — it silently hangs instead.
**3. A setting that appears to mask the symptom.**
I had github.copilot.advanced.debug.chatConversationTimeoutMs set to 0 (undocumented setting, origin unknown — pre-existing before this investigation). This looks like it disables any client-side conversation timeout, which would explain why a dead backend produces an infinite spinner instead of a clean, user-visible failure. I removed it as a workaround.
## What I could NOT confirm
- Why the backend dies so often (25+ non-clean shutdowns observed in local log history) — could be VS Code intentionally recycling it on some lifecycle event (sleep/wake, window state changes) as much as an actual crash. Local logs alone don't distinguish these.
- No confirmed correlation with the large workspace size (124 repos), though an expensive initial customization-resolution step was observed in the Agent Debug Logs panel (16 agents resolved in ~12.8s on first load; repeated "Resolve customizations" entries — 94 skills, 14 agents, 107 slash commands, 6 hooks — resolving every few minutes).
## Steps to reproduce
No fully deterministic repro found. Screen lock/sleep was an initial hypothesis but not confirmed as the trigger — the hang has also been observed shortly after a fresh, active session with no lock/sleep event in between.
## Current workaround
Cmd+Shift+P → Developer: Restart Extension Host reliably unblocks the situation by starting a fresh backend, without losing the VS Code window state.
## Expected behavior
The Chat feature should detect a dead/unresponsive backend connection and either transparently restart it or surface a clear, actionable error — instead of hanging indefinitely with no feedback.
Happy to provide full log files if useful for server-side investigation.
Contributor guide
Assessment
This issue has not been assessed yet.