Skip to content

[release/1.148] sandbox: show last-known profile while disconnected (cherry-pick #350008) - #350019

Merged
Dileep Yavanmandha (dileepyavan) merged 1 commit into
release/1.148from
DileepY/cherry-pick-350008-1.148
Nov 24, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 1 commit into
release/1.148from
DileepY/cherry-pick-350008-1.148

Conversation

@dileepyavan

Copy link
Copy Markdown
Member

Backports #350008 to release/1.148. Refs #349807.

Remembers each remote host's last-known sandbox profile on this machine, shows it disabled while disconnected, and prevents deleting profiles known to be assigned to disconnected hosts. Reconnection reads the host's current assignment without writing the remembered value back.

Source PR is still open. This backport consolidates its two current commits, through 5e1c545be5250d99e5c35df3598ccd11b8f4b896, without code changes or conflicts. Independently based on release/1.148 at dec73890cb0bc7fd437520dbc7e74c55df259cd3.

Validation

  • git diff --cached --check: passed before commit.
  • git patch-id --stable on the source aggregate and backport: identical.
  • npm run -s precommit: passed; hygiene and oxlint checked all 8 changed files. Commit signing remained enabled.
  • npm run compile-client: blocked by missing @microsoft/copilot-sdk.
  • pnpm install --frozen-lockfile: failed because the pinned @microsoft/[email protected] tarball returned HTTP 404. Locked development/build tooling was restored separately so commit hooks could run.
  • Unit tests and live UI verification: not run because compilation/runtime dependency restoration is blocked.

How to test

After dependencies and compilation are available, run:

.\scripts\test.bat --run src\vs\workbench\contrib\sessions\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\workbench\contrib\terminalContrib\chatAgentTools\test\browser\sandboxProfiles.test.ts

Assign a profile in Remote Environments, disconnect the host, and verify the disabled picker retains the assignment after reopening. Verify deletion is blocked until the host reconnects and is unassigned.

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]>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 23:36

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.

🟡 Changes recommended

Concurrent windows can overwrite sandbox profile assignments from stale local caches, causing lost hosts to show Default while disconnected and leaving their profiles unprotected from deletion.

1 open issue
What changed in this PR

Backports #350008 to release/1.148, addressing #349807 by retaining remote hosts’ last-known sandbox profiles while disconnected without writing cached assignments back on reconnect.

Changes:

  • Persist per-machine assignments and display them in disabled profile pickers while hosts are disconnected.
  • Block profile deletion when a remembered remote assignment uses it.
  • Update accessibility help, dialog text, and regression tests.
File Description
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​test/​browser/​sandboxProfiles.test.ts Tests deletion protection and preservation of unavailable host state.
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​browser/​terminal.chatAgentTools.contribution.ts Updates accessibility help for disconnected assignments.
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​browser/​sandboxProfilesInput.ts Includes remembered assignments in deletion checks.
src/​vs/​workbench/​contrib/​terminalContrib/​chatAgentTools/​browser/​sandboxProfilesEditor.ts Updates deletion dialog explanations.
src/​vs/​workbench/​contrib/​sessions/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts Tests disconnected display, reopening, and reconnection behavior.
src/​vs/​workbench/​contrib/​sessions/​providers/​remoteAgentHost/​browser/​remotesTable.ts Displays remembered assignments with disabled controls and explanatory 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 assignment persistence, lookup, and change notifications.

Review effort: Balanced

@dileepyavan
Dileep Yavanmandha (dileepyavan) merged commit aaf8169 into release/1.148 Nov 24, 2026
52 checks passed
@dileepyavan
Dileep Yavanmandha (dileepyavan) deleted the DileepY/cherry-pick-350008-1.148 branch November 24, 2026 02:00
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.

4 participants