github / github/copilot-cli

VS Code Copilot CLI panel shows empty transcript after Remote-SSH reconnect, though session data is intact on disk

オープン
#4,529 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:sessions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

Describe the bug

After the local machine is locked (e.g. stepping away briefly) and VS Code's Remote-SSH connection drops and later reconnects, the Copilot CLI chat panel in VS Code shows the current/recent session as empty (no turns), giving the impression that chat history was lost.

This is not actual data loss. I confirmed the underlying data is fully intact:

  • ~/.copilot/session-store.db (SQLite) still contains all turns for the affected sessions in the turns table, with complete user_message and assistant_response text.
  • Running the standalone copilot CLI in a terminal against the same session shows the full history correctly.
  • Only the VS Code panel's view of the session appears empty/reset after the reconnect.

This has happened repeatedly (3 times in one day) immediately following machine lock -> SSH reconnect cycles.

Affected version

GitHub Copilot CLI 1.0.80

Steps to reproduce the behavior
  1. Open a VS Code window connected via Remote-SSH to a remote Linux host.
  2. Start a Copilot CLI chat/agent session in VS Code and have a multi-turn conversation.
  3. Lock the local machine long enough for the Remote-SSH connection to drop (observed even after a short lock).
  4. Unlock the machine and let VS Code reconnect to the remote host.
  5. View the Copilot CLI chat panel for the session that was active before the lock.
  6. See: the panel shows an empty/reset transcript, even though ~/.copilot/session-store.db on the remote host still has all turns for that session (verified directly via sqlite3 ~/.copilot/session-store.db "SELECT * FROM turns WHERE session_id='<id>'"), and the standalone copilot terminal CLI shows the full history for the same session.
Expected behavior

After a Remote-SSH reconnect, the VS Code Copilot CLI panel should reload the session transcript from the on-disk store (~/.copilot/session-store.db), the same way the standalone terminal copilot CLI does, instead of showing an empty/reset conversation.

There appears to be a stale or invalidated in-memory/cache state on the VS Code extension/agent-host side (possibly related to ~/.copilot/vscode.session.metadata.cache.json) that isn't correctly rehydrated from the durable on-disk session store after a connection drop.

Additional context
  • Operating system (remote host): Ubuntu 24.04.4 LTS (Noble Numbat)
  • Connection type: VS Code Remote-SSH
  • Integration: VS Code "agent host" plugin (agent-host-copilotcli)
  • Impact: Users mistakenly believe their conversation history and context are lost after every lock/reconnect cycle, disrupting long-running remote development work, even though no data is actually destroyed.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

lock と Remote-SSH の再接続シーケンスを再現し、その後、VS Code パネルの状態を ~/.copilot/session-store.db および ~/.copilot/vscode.session.metadata.cache.json と比較します。スタンドアロンの copilot CLI と sqlite3 クエリが、履歴が完全に保持されている場合のベースラインになります。再接続後に VS Code Copilot CLI パネルが影響を受けたセッションの turns を再読み込みし、空のトランスクリプトを表示しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell, sqlite, vscode
領域
cli, desktop, developer-experience
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。