Skip to content

agentHost: avoid persisting ephemeral connections - #329634

Draft
Aaron Munger (amunger) wants to merge 2 commits into
mainfrom
fix/agent-host-ephemeral-settings-write
Draft

agentHost: avoid persisting ephemeral connections#329634
Aaron Munger (amunger) wants to merge 2 commits into
mainfrom
fix/agent-host-ephemeral-settings-write

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • persist managed WebSocket hosts in chat.remoteAgentHosts
  • persist managed SSH hosts only in application storage
  • keep WSL, tunnel, and cloud sandbox connection registration runtime-only because their owning services handle discovery/cache state or use short-lived credentials
  • use an exhaustive per-connection-type switch that documents each persistence boundary
  • add regression coverage for WebSocket settings writes, SSH storage without settings writes, and ephemeral registration without central persistence

Why

Registering a dev tunnel rewrote settings.json even though tunnel entries are filtered from persisted configuration. On Windows, an existing file lock could make the atomic settings-file rename fail and incorrectly surface an otherwise successful tunnel connection as failed.

Separating the persistence paths also avoids the same redundant settings rewrite for SSH connections, whose durable metadata belongs in application storage rather than user settings.

Validation

  • npm run typecheck-client
  • scripts\test.bat --run src\vs\platform\agentHost\test\electron-browser\remoteAgentHostService.test.ts (32 passing)
  • npm run valid-layers-check
  • changed-file hygiene

Managed tunnel, WSL, and cloud sandbox connections are runtime-only. Avoid rewriting user settings when registering them so a settings file lock cannot fail an otherwise successful connection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 7, 2026 16:44

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.

Pull request overview

Prevents ephemeral managed agent-host connections from rewriting user settings while preserving durable WebSocket and SSH persistence.

Changes:

  • Limits persistence to WebSocket and SSH connections.
  • Adds regression coverage for tunnel, WSL, and cloud sandbox connections.
Show a summary per file
File Description
remoteAgentHostServiceImpl.ts Gates managed-connection persistence by durable connection type.
remoteAgentHostService.test.ts Verifies ephemeral registration causes no configuration writes.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Persist WebSocket hosts in user settings and SSH hosts only in application storage. Keep WSL, tunnel, and cloud sandbox registration runtime-only, with an exhaustive switch documenting each ownership boundary.

Co-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.

2 participants