Repository navigation
sessions: Delete user-shared environments from Remotes - #344083
Merged
Christof Marti (chrmarti) merged 2 commits intoOct 25, 2026
Merged
Conversation
Add an inline Delete action without confirmation for user-local registrations. Guard account ownership, invalidate stale inventory, and withdraw local connections after deletion. Fixes #343985. Co-authored-by: Copilot <[email protected]>
Contributor
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A stale discovery response in another window can restore a successfully deleted environment to shared inventory.
1 open issue
What changed in this PR
Adds deletion of user-shared environment registrations to the Agents Window’s Remotes editor, addressing #343985 without deleting machines or their files.
Changes:
- Adds Delete after Rename for user-local environments, including offline rows, with pending-action guards and focus restoration.
- Adds account-bound API deletion and inventory cleanup, including cache invalidation and connection withdrawal.
- Updates accessibility help, documentation, themed fixtures, and regression tests.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlEnvironmentService.test.ts | Tests inventory deletion, persistence, cancellation, and account changes. |
| src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxApiService.test.ts | Tests deletion responses, cache invalidation, and account-bound requests. |
| src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.ts | Implements guarded deletion and persisted inventory removal. |
| src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.ts | Adds the environment-deletion request action. |
| src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.ts | Sends authenticated DELETE requests and invalidates discovery. |
| src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesWidget.test.ts | Tests Delete availability, duplicate prevention, errors, and focus. |
| src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesWidget.fixture.ts | Adds themed environment-action fixtures. |
| src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesModel.test.ts | Tests deletion routing and environment eligibility. |
| src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md | Documents registration deletion semantics. |
| src/vs/sessions/contrib/providers/remoteAgentHost/electron-browser/remotes.contribution.ts | Updates accessibility help for Delete. |
| src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesWidget.ts | Handles deletion, pending state, errors, and focus restoration. |
| src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesTable.ts | Adds the conditional trash-icon action. |
| src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesModel.ts | Routes environment removal to the inventory service. |
| src/vs/platform/agentHost/common/missionControlEnvironment.ts | Exposes the inventory deletion contract. |
| src/vs/platform/agentHost/common/cloudSandboxAgentHost.ts | Exposes the account-bound API deletion contract. |
Review effort: Balanced
Ask before deleting an environment registration and revalidate the target after confirmation. Cover cancellation and stale account, inventory, and availability changes. Co-authored-by: Copilot <[email protected]>
Christof Marti (chrmarti)
marked this pull request as ready for review
October 25, 2026 13:28
Christof Marti (chrmarti)
enabled auto-merge
October 25, 2026 13:28
Ladislau Szomoru (lszomoru)
approved these changes
Oct 25, 2026
Christof Marti (chrmarti)
deleted the
chrmarti/remotes-environment-delete
branch
October 25, 2026 14:30
2 tasks done
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 #343985.
Changes
user-localregistrations. Managed sandboxes and unknown environment kinds are excluded.DELETE /agents/environments/{id}using the selected account's credential. Successful deletion (or an already absent record) invalidates discovery caches, persists inventory removal, cancels pending connections, and withdraws the local connection/provider. Errors retain the row and are reported to the user.Deleting a user-local environment removes its registration, not the machine or its local files. It is not a session-history erasure operation. The owning application can register a new environment afterward.
This branch starts from
origin/mainat86db3b69224; it is not stacked on an open PR.Validation
Passed:
npm run eslint -- <changed TypeScript files>andnode build\hygiene.ts <changed TypeScript files>).git diff --check: passed.Tests cover 204/404 responses, HTTP failures, account-bound credentials, late completion after an account switch, stale discovery, persistence, pending connection cancellation, unsupported kinds, offline deletion, duplicate actions, and focus restoration.
No real environment was deleted during validation. Live backend deployment/proxy behavior and live host re-registration were not exercised.
Manual test