Skip to content

agentHost: preserve remote sessions across reload - #333251

Merged
roblourens merged 2 commits into
mainfrom
roblou/agents/fix-copilot-session-reload-issue
Sep 1, 2026
Merged

agentHost: preserve remote sessions across reload#333251
roblourens merged 2 commits into
mainfrom
roblou/agents/fix-copilot-session-reload-issue

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • preserve already client-addressed working directory URIs returned by listSessions
  • keep remote workspace filtering consistent between live session notifications and reload restoration
  • add regression coverage for the live-notification to cold-listing transition

Root cause

Remote SSH sessions are announced with vscode-remote: working directories. The cold listSessions path wrapped those URIs again as vscode-agent-host:, so workspace filtering excluded the session after window reload even though it still existed in the Agent Host.

Validation

  • npm run compile
  • npm run typecheck-client
  • targeted ESLint
  • related AgentHostProtocolClient listSessions tests
  • confirmed the regression test fails with the old mapping and passes with this change

(Written by Copilot)

Keep non-file working directory URIs returned by listSessions in client space so remote workspace filtering treats live and restored sessions consistently.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 28, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Balanced
Findings: None

What changed in this PR

Preserves remote session visibility after reload by avoiding double-wrapping client-addressed URIs.

Changes:

  • Maps only host-local file: URIs into client space.
  • Adds regression coverage for live notifications and restored listings.
File Description
agentHostProtocolClient.ts Preserves non-file session and project URIs.
agentHostProtocolClient.test.ts Tests remote URI preservation across listing restoration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@roblourens
roblourens marked this pull request as ready for review August 31, 2026 04:00
@roblourens
roblourens merged commit 867755f into main Sep 1, 2026
52 checks passed
@roblourens
roblourens deleted the roblou/agents/fix-copilot-session-reload-issue branch September 1, 2026 16:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 1, 2026
Bhavya U (bhavyaus) pushed a commit that referenced this pull request Sep 1, 2026
agentHost: preserve client-addressed session directories

Keep non-file working directory URIs returned by listSessions in client space so remote workspace filtering treats live and restored sessions consistently.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants