You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copilot chat sessions created in agent ("Copilot") mode disappear from the Sessions panel on Remote-SSH #328736
agent-hostIssues for the agent-host implementation (not the protocol)bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded
VS Code version: 1.131.0
Copilot Chat extension version: 0.59.0
Remote: Remote-SSH to a Linux server (headless HPC login node)
OS (remote): Linux
Steps to Reproduce:
Describe the bug
When using VS Code with Remote-SSH, chats I create in the normal "Copilot" (agent) mode disappear from the Copilot Sessions panel shortly after creation — often as soon as the chat is no longer the active one, or after reloading the window. The chat's content is not actually lost (it's still on disk on the server), but it stops being listed, so I can't find or reopen it.
Chats created previously in "Copilot CLI" mode do not disappear — they stay listed and openable. But "Copilot CLI" is no longer accessable for new chats.
Root cause (what I found)
Copilot CLI chats are written to a per-session directory containing an event log file (events.jsonl) under the CLI session-state folder. These show up in the Sessions panel.
"Copilot" agent-mode chats are written to a different store (an agent-host session.db), and they get a row in the session registry database — but no events.jsonl is ever created for them.
The Sessions panel enumerates sessions via the CLI backend's session-listing, which only returns sessions that have a real events.jsonl with actual conversation events. Because agent-mode chats never get that file, they are never returned, so they silently disappear from the panel — even though their full content exists in the registry database and the agent-host store.
I confirmed the correlation is exact: every chat that has an events.jsonl is listed; every chat that lacks one is hidden, regardless of workspace, client name, or other metadata.
I tested session enumeration using both representations:
workspace = C:\Development\notebook
→ no sessions
workspace = vscode-remote://ssh-remote+<host>/c:/Development/notebook
→ affected sessions are returned
Unfiltered enumeration also returns the sessions.
This suggests a path-normalization or workspace-filtering mismatch:
The session is persisted using the remote host’s native Windows path.
The VS Code session provider exposes it using a vscode-remote URI.
At least one Sessions-panel lookup appears to filter using the other representation.
The valid session is consequently excluded from the panel.
This behavior is consistent across several sessions, all with nonempty events.jsonl files.
Agent Host startup evidence
After both a window reload and a complete PC restart, agenthost.log begins with:
[info] Agent Host process started successfully
[error] CodeExpectedError: ENOPRO: No file system provider found for resource
'vscode-userdata:/.../User'
[error] CodeExpectedError: ENOPRO: No file system provider found for resource
'vscode-userdata:/.../User/settings.json'
It then reports:
[Copilot] Listing sessions...
[Copilot] Found 0 sessions
The session files and registry rows remain present on disk at that time.
I cannot prove that the ENOPRO error causes the session-filtering problem, but it occurs on every affected Agent Host startup and may be relevant to initialization order or workspace-provider registration.
Suggested area to investigate
Could the Sessions panel or Copilot session provider normalize both sides of the comparison before filtering?
For Remote-SSH to a Windows host, these likely need to compare as the same workspace:
The current behavior appears to persist one form and enumerate/filter using the other. This would explain why sessions remain intact on disk but disappear from the workspace-scoped Sessions panel.
Any update on this? This is a critical issue for me, Github Copilot Chat is barely working for me on the system I SSH into. Any kind of reload, open/close of vscode causes the entire session history to disappear. New chats often don't give any responses and the session history shows a massive amount of code change even though no code change happened:
If there is anything I can do to help diagnose this issue, please contact me, I'll walk through it with a developer. Thank you!
Yep, even on 1.133 release the issue still exists. Still seeing the workspace trust show up beforehand even when the folder has already been trusted, and most times the chat logs disappear; typically after a full close and reopen of the ssh folder. Also file links in ssh from the chat (like Read readme.txt, where you can click on it) opens a file not found error (the wrong path is used, it uses the device's path instead of the ssh path). I think the hooks view is also impacted by the same issue.
Anyway, for this specific issue, it seems vscode insiders is working more reliably.
Yep, even on 1.133 release the issue still exists. Still seeing the workspace trust show up beforehand even when the folder has already been trusted, and most times the chat logs disappear; typically after a full close and reopen of the ssh folder. Also file links in ssh from the chat (like Read readme.txt, where you can click on it) opens a file not found error (the wrong path is used, it uses the device's path instead of the ssh path). I think the hooks view is also impacted by the same issue.
Anyway, for this specific issue, it seems vscode insiders is working more reliably.
I can confirm having all of those exact issues. It makes me unable to directly see the code changes from agents. I need to do everything through git diffs, which is a problem for untracked files. Also the "Agents" window cannot connect to any ssh folder.
Are you also noticing the massive number of line changes? Seems like they just build up more and more over time and between chats. After reinstall vscode the missing sessions bug went away (the old ones didn't come back mind you). Was the Accept/Reject feature deprecated pattern now or is that also a bug related to this? (I wasn't doing coding related work a lot in July).
Yeah, the agents not being able to connect to any ssh folder has been a long-time issue. I just assumed it wasn't supported. And the issue with the file links in chat is really annoying too. I don't think that is a vscode issue, more of a github copilot chat extension.
I also did a full reinstall of vscode and it seems the missing session bugs hasn't happened yet (knock on wood). I did notice the massive number of line changes, but I think it mainly was caused by not clicking the keep/undo button after the edits were made in the old version of the chat. So once more and more changes built up, it compared to that last snapshot with all the changes made since then, which is a huge amount. After they removed the keep/undo feature, it just became a stale indicator. After reinstall, that issue went away.
Confirming with additional evidence: Also hit this on Remote-SSH to a Linux host, triggered by an SSH connection drop/reconnect. Same symptom — several agent-mode chat sessions (spanning multiple days, dozens of turns each) no longer appear in the Sessions panel.
I confirmed the underlying data is intact: on the remote host, the Copilot Chat extension's own transcript logs (GitHub.copilot-chat/transcripts/.jsonl) still contain the full turn-by-turn conversation (user messages, assistant messages, tool calls) with correct timestamps for every "missing" session. So this matches the reported root cause — it's a panel enumeration/filtering bug, not actual data loss. Would be great to get a fix, since there's currently no supported way for a user to recover/relist these from the UI.
Confirming this on Remote-SSH as well, and I think I can pin down the exact code responsible — it reconciles the two theories in this thread (missing events.jsonl vs. workspace/path mismatch).
Environment
VS Code 1.134.0 (stable), Remote-SSH to Ubuntu 22.04.5 LTS from Windows 11
Copilot Chat extension 0.62.0
Same symptom: chats created in "Copilot" (agent) mode never appear in the Chat Sessions view; "Local"/CLI-mode and terminal copilot sessions do.
The Copilot CLI session provider drops any session whose clientName is vscode-agent-host (which is what "Copilot"/agent-mode chats are tagged with), before any workspace, origin, or events.jsonl consideration.
In extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts (1.134.0):
I checked the tags and this exclusion (same constant, same two checks) is present unchanged in 1.131.0, 1.132.0, 1.133.0 and 1.134.0 — i.e. every version reported in this thread. In 1.131.0 it's here:
It matches the OP exactly: agent-mode (vscode-agent-host) chats are never listed.
It explains Reduce395's counterexample. That affected session had client_name: vscode-agent-hostand a ~3 MB events.jsonl with 13 turns, yet was still hidden. A missing events.jsonl therefore isn't the necessary condition — the clientName filter is. Every affected session in this thread carries client_name: vscode-agent-host, which is precisely the value this code filters on.
It explains why toggling "show external sessions" doesn't help: github.copilot.chat.cli.showExternalSessions is only consulted inside shouldShowSession() (the origin check), which runs after the clientName drop. So that setting can never bring agent-host sessions back.
The workspace/path-normalization mismatch Reduce395 describes (native path vs. vscode-remote:// URI in shouldShowSession()) may well be a second, separate bug affecting foreground/vscode-origin sessions — but it isn't what hides agent-mode chats, because those are removed by the clientName filter before shouldShowSession() ever runs.
Corroborating local evidence (not the cause, just consistent with it)
Of the vscode-agent-host sessions on my machine, 0 of 9 appear in the Copilot CLI per-cwd index (~/.copilot/sidebar-sessions-state/<sha256(cwd)>.json), whereas github/cli and vscode client types do appear (subject to workspace filtering).
Agent-mode sessions are served by a CLI launched in headless stdio mode (--headless --stdio --no-auto-login); their transcripts are still written to ~/.copilot/session-state/<id>/events.jsonl, so as others noted, this is a listing/visibility bug, not data loss.
Suggested fix / question
Is the clientName === 'vscode-agent-host' (and agentHostOwnedSessionIds) exclusion intended? The comment says it's to avoid double-listing "sessions the agent host already lists" — but on Remote-SSH the Agents window can't attach to the SSH workspace, so those sessions end up listed nowhere the user can reach. If the intent is de-duplication, the exclusion should probably be conditional on the Agent Host actually being able to surface the session in the current window; otherwise these sessions need to remain visible in the Chat Sessions view.
agent-hostIssues for the agent-host implementation (not the protocol)bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded
Activity
Reduce395 commentedon Aug 7, 2026
I can reproduce this on a newer build, and I asked an agent to search around and come up with findings suggest an additional problem:
Environment
1.132.00.60.0Important counterexample
I have multiple sessions that disappear or become unavailable from the expected workspace even though each session has:
events.jsonlworkspace.yamlsession-store.dbFor one affected session:
events.jsonlis approximately 3 MB.workspace.yamlcontains:sessionstable insession-store.dbalso contains:Therefore, a missing
events.jsonlis not a necessary condition for the session to disappear.Possible workspace-identity mismatch
The persisted session metadata uses a normal Windows path:
However, the session provider exposes the same session with a synthesized Remote-SSH URI:
I tested session enumeration using both representations:
Unfiltered enumeration also returns the sessions.
This suggests a path-normalization or workspace-filtering mismatch:
vscode-remoteURI.This behavior is consistent across several sessions, all with nonempty
events.jsonlfiles.Agent Host startup evidence
After both a window reload and a complete PC restart,
agenthost.logbegins with:It then reports:
The session files and registry rows remain present on disk at that time.
I cannot prove that the
ENOPROerror causes the session-filtering problem, but it occurs on every affected Agent Host startup and may be relevant to initialization order or workspace-provider registration.Suggested area to investigate
Could the Sessions panel or Copilot session provider normalize both sides of the comparison before filtering?
For Remote-SSH to a Windows host, these likely need to compare as the same workspace:
The current behavior appears to persist one form and enumerate/filter using the other. This would explain why sessions remain intact on disk but disappear from the workspace-scoped Sessions panel.
RobotPsychologist commentedon Aug 12, 2026
Any update on this? This is a critical issue for me, Github Copilot Chat is barely working for me on the system I SSH into. Any kind of reload, open/close of vscode causes the entire session history to disappear. New chats often don't give any responses and the session history shows a massive amount of code change even though no code change happened:
If there is anything I can do to help diagnose this issue, please contact me, I'll walk through it with a developer. Thank you!
Reduce395 commentedon Aug 13, 2026
Yep, even on 1.133 release the issue still exists. Still seeing the workspace trust show up beforehand even when the folder has already been trusted, and most times the chat logs disappear; typically after a full close and reopen of the ssh folder. Also file links in ssh from the chat (like Read readme.txt, where you can click on it) opens a file not found error (the wrong path is used, it uses the device's path instead of the ssh path). I think the hooks view is also impacted by the same issue.
Anyway, for this specific issue, it seems vscode insiders is working more reliably.
RobotPsychologist commentedon Aug 13, 2026
I can confirm having all of those exact issues. It makes me unable to directly see the code changes from agents. I need to do everything through git diffs, which is a problem for untracked files. Also the "Agents" window cannot connect to any ssh folder.
Are you also noticing the massive number of line changes? Seems like they just build up more and more over time and between chats. After reinstall vscode the missing sessions bug went away (the old ones didn't come back mind you). Was the Accept/Reject feature deprecated pattern now or is that also a bug related to this? (I wasn't doing coding related work a lot in July).
Reduce395 commentedon Aug 13, 2026
Yeah, the agents not being able to connect to any ssh folder has been a long-time issue. I just assumed it wasn't supported. And the issue with the file links in chat is really annoying too. I don't think that is a vscode issue, more of a github copilot chat extension.
I also did a full reinstall of vscode and it seems the missing session bugs hasn't happened yet (knock on wood). I did notice the massive number of line changes, but I think it mainly was caused by not clicking the keep/undo button after the edits were made in the old version of the chat. So once more and more changes built up, it compared to that last snapshot with all the changes made since then, which is a huge amount. After they removed the keep/undo feature, it just became a stale indicator. After reinstall, that issue went away.
rcortez-intel commentedon Aug 22, 2026
Confirming with additional evidence: Also hit this on Remote-SSH to a Linux host, triggered by an SSH connection drop/reconnect. Same symptom — several agent-mode chat sessions (spanning multiple days, dozens of turns each) no longer appear in the Sessions panel.
I confirmed the underlying data is intact: on the remote host, the Copilot Chat extension's own transcript logs (GitHub.copilot-chat/transcripts/.jsonl) still contain the full turn-by-turn conversation (user messages, assistant messages, tool calls) with correct timestamps for every "missing" session. So this matches the reported root cause — it's a panel enumeration/filtering bug, not actual data loss. Would be great to get a fix, since there's currently no supported way for a user to recover/relist these from the UI.
jacob5567 commentedon Aug 26, 2026
Confirming this on Remote-SSH as well, and I think I can pin down the exact code responsible — it reconciles the two theories in this thread (missing
events.jsonlvs. workspace/path mismatch).Environment
copilotsessions do.Root cause: the Chat Sessions provider explicitly excludes Agent Host sessions
The Copilot CLI session provider drops any session whose
clientNameisvscode-agent-host(which is what "Copilot"/agent-mode chats are tagged with), before any workspace, origin, orevents.jsonlconsideration.In
extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts(1.134.0):In the listing path:
There's an equivalent early-return on the single-session construction path:
Permalinks (1.134.0):
copilotcliSessionService.ts#L57copilotcliSessionService.ts#L444-L457copilotcliSessionService.ts#L336-L338I checked the tags and this exclusion (same constant, same two checks) is present unchanged in 1.131.0, 1.132.0, 1.133.0 and 1.134.0 — i.e. every version reported in this thread. In 1.131.0 it's here:
copilotcliSessionService.ts#L61copilotcliSessionService.ts#L537copilotcliSessionService.ts#L418with the
shouldShowSession()call right after the listing exclusion atcopilotcliSessionService.ts#L542.Why this explains the whole thread
vscode-agent-host) chats are never listed.client_name: vscode-agent-hostand a ~3 MBevents.jsonlwith 13 turns, yet was still hidden. A missingevents.jsonltherefore isn't the necessary condition — theclientNamefilter is. Every affected session in this thread carriesclient_name: vscode-agent-host, which is precisely the value this code filters on.github.copilot.chat.cli.showExternalSessionsis only consulted insideshouldShowSession()(the origin check), which runs after theclientNamedrop. So that setting can never bring agent-host sessions back.The workspace/path-normalization mismatch Reduce395 describes (native path vs.
vscode-remote://URI inshouldShowSession()) may well be a second, separate bug affecting foreground/vscode-origin sessions — but it isn't what hides agent-mode chats, because those are removed by theclientNamefilter beforeshouldShowSession()ever runs.Corroborating local evidence (not the cause, just consistent with it)
vscode-agent-hostsessions on my machine, 0 of 9 appear in the Copilot CLI per-cwd index (~/.copilot/sidebar-sessions-state/<sha256(cwd)>.json), whereasgithub/cliandvscodeclient types do appear (subject to workspace filtering).--headless --stdio --no-auto-login); their transcripts are still written to~/.copilot/session-state/<id>/events.jsonl, so as others noted, this is a listing/visibility bug, not data loss.Suggested fix / question
Is the
clientName === 'vscode-agent-host'(andagentHostOwnedSessionIds) exclusion intended? The comment says it's to avoid double-listing "sessions the agent host already lists" — but on Remote-SSH the Agents window can't attach to the SSH workspace, so those sessions end up listed nowhere the user can reach. If the intent is de-duplication, the exclusion should probably be conditional on the Agent Host actually being able to surface the session in the current window; otherwise these sessions need to remain visible in the Chat Sessions view.roblourens commentedon Sep 1, 2026
I think I see the problem here. Sorry for the slow reaction, but should be fixed in 1.137
roblourens commentedon Sep 1, 2026
Fixed by #333251
RobotPsychologist commentedon Sep 3, 2026
Thank you roblourens I just updated to 1.136.1, ssh'ing into a Linux system and all of my old conversations seem to have reappeared:
Version: 1.136.1
Commit: a44adf7
Date: 2026-09-03T05:06:41Z
Electron: 42.10.0
ElectronBuildId: 15109253
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
@github/copilot: 1.0.81-0
@github/copilot-sdk: 1.0.11
OS: Linux x64 6.8.0-138-generic
RobotPsychologist commentedon Sep 12, 2026
After upgrading to 1.137.0 from 1.136.1 it appears that the issue has been reintroduced. Anyone else having this problem again?