`--server --stdio` never releases a session's extension-host processes; they accumulate at 4 per session until the server exits
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
[Filed by Copilot on behalf of @bghgary]
Summary
When copilot.exe runs as a long-lived server (--server --stdio, as the Windows desktop app hosts it), each session it creates spawns four extension-host child processes, and none are terminated when the session ends. They are released only when the whole server process exits.
Over ~3 hours of repeated short-lived sessions this reached 192 extension-host processes holding ~13 GB of working set on an otherwise idle machine.
Expected vs actual
- Expected: a session's extension hosts exit when that session ends.
- Actual: they persist for the lifetime of the server process. The count only ever grows.
Evidence
Extension hosts are copilot.exe processes whose command line ends in preloads\extension_bootstrap.mjs. Their command lines are byte-identical to one another, so they carry no session identity.
Two server processes on the same machine, measured together:
| Server | Sessions | Hosts |
|---|---|---|
| Hosting 3 long-lived interactive sessions | 3 | 12, stable for hours |
| Creating repeated short-lived sessions | 44 created since start | 180 |
The first is exactly 4 per live session and never grew. The second matches 4 per session to within one session, and not one host from a completed session had exited — sessions reporting status completed leaked identically to any other.
A third control: a one-shot invocation (copilot -p "...") leaks zero. Host count before and after is identical, so the defect appears only in server mode.
Each host is ~70 MB of working set and effectively idle (~2 s of CPU accumulated over 3 hours), so this is a pure resource leak rather than runaway work.
Reproduction
- Run the Windows desktop app, which hosts
copilot.exe --server --stdio. - Have it create repeated short-lived sessions — scheduled workflows do this on a timer.
- Count
copilot.exeprocesses whose command line containsextension_bootstrap.
The count rises by 4 per session and never falls. Restarting the app is the only thing that clears them.
Impact
Host count grew at ~48/hour, reaching 192 processes and ~13 GB before intervention. Memory pressure was the visible symptom.
Workaround
Kill surplus hosts on a timer, keeping the newest N per server process — an in-flight session's hosts are always the newest, so they are never candidates. This is a hack; there is no supported way to map a host back to its session.
Environment
- Copilot CLI 1.0.79-9
- GitHub Copilot desktop app 1.1.8
- Windows 11 build 26310
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
--server --stdio エントリポイントと preloads\\extension_bootstrap.mjs を起動するセッションライフサイクルから始め、短時間で終了するセッションを繰り返し作成して、対応する copilot.exe プロセスを数えることでリークを再現します。完了条件は、セッション終了時に各セッションの4つの拡張ホストが終了し、長時間実行されるセッションではホストが保持され、ワンショット呼び出しでも引き続きリークが0であることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- backend, cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100