Repository navigation
sandbox: show last-known sandbox profile while a host is disconnected - #350008
Merged
Dileep Yavanmandha (dileepyavan) merged 2 commits intoNov 23, 2026
Merged
Conversation
Remote Environments showed Default for a disconnected host even though the host keeps its assigned sandbox profile, which looked like the assignment had been reset. Remote Environments now remembers the assignment it last saw on each connected host (per machine, not synced) and shows it, disabled and labelled as last known, while the host is disconnected. Reconnecting shows the host's current assignment; the remembered value is never written back. Deleting a sandbox profile is also blocked when a disconnected remote environment is known to use it. Fixes #349807 Co-authored-by: Copilot <[email protected]>
Dileep Yavanmandha (dileepyavan)
marked this pull request as ready for review
November 23, 2026 22:32
Dileep Yavanmandha (dileepyavan)
enabled auto-merge
November 23, 2026 22:32
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Window-specific host names can cause cache notifications to repeatedly refresh and rewrite assignments, creating an unbounded cross-window storage/repaint loop.
3 open issues
What changed in this PR
This PR addresses #349807 by showing a disconnected remote host’s last-known sandbox profile instead of Default. The remembered assignment is display-only; reconnecting refreshes it from the host.
Changes:
- Persist last-known assignments per machine and show them in a disabled picker with explanatory hover and screen-reader text.
- Block profile deletion when a connected or remembered disconnected environment uses it.
- Update accessibility help and tests for disconnects, reopening, reconnects, and deletion protection.
| File | Description |
|---|---|
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/sandboxProfiles.test.ts |
Tests remembered assignments and deletion protection. |
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.ts |
Updates accessibility help for deletion restrictions. |
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/sandboxProfilesInput.ts |
Includes remembered host assignments in deletion checks. |
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/sandboxProfilesEditor.ts |
Clarifies deletion dialogs for disconnected environments. |
src/vs/workbench/contrib/sessions/providers/remoteAgentHost/test/browser/remotesWidget.test.ts |
Tests disconnected display, reopening, and host-authoritative reconnects. |
src/vs/workbench/contrib/sessions/providers/remoteAgentHost/browser/remotesTable.ts |
Displays and remembers assignments with last-known labels. |
src/vs/sessions/contrib/providers/remoteAgentHost/electron-browser/remotes.contribution.ts |
Updates Remote Environments accessibility help. |
src/vs/platform/agentHost/common/sandboxProfiles.ts |
Adds machine-local assignment storage and change notifications. |
Review effort: Balanced
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Nov 23, 2026
Modify watchSandboxProfileAssignments to refresh only if there is no connection by address. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 23, 2026
SteVen Batten (sbatten)
approved these changes
Nov 23, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
DileepY/sandbox-profile-last-known
branch
November 23, 2026 23:17
Dileep Yavanmandha (dileepyavan)
added a commit
that referenced
this pull request
Nov 24, 2026
…cherry-pick #350008) (#350019) [release/1.148] sandbox: retain disconnected host profile (#350008) Backport #350008 to release/1.148 from its current PR head. (cherry picked from commit a8206ee) (cherry picked from commit 5e1c545) Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #349807
What
Remote Environments showed Default in the Sandbox Profile column for a disconnected host, even though the host keeps its assigned profile and new sessions still use it. That looked like the assignment had been reset.
Remote Environments now remembers the profile it last saw on each connected host. While the host is disconnected, the column shows that profile, disabled, with a hover and screen-reader label that say it's the last known profile and that you need to connect to refresh or change it.
How
APPLICATION_SHARED,MACHINE, not synced). Remote Environments records it while it shows a connected host. Choosing Default clears the remembered value; a host that can't be read keeps it.Behavior with two clients
If another client changes the assignment while A is connected but Remote Environments is closed, A updates the next time it shows the host connected.
Validation