Enable Delete command on Agent Host sessions#320889
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class “Delete” support for agent-host-backed chat sessions (previously only “Archive” was available), wiring the UI action through IChatSessionsService down to the agent host backend so sessions are disposed and their persisted data is removed.
Changes:
- Introduces
deleteChatSessionItemas an optional capability onIChatSessionItemControllerand a newdeleteChatSessionItem(...)API onIChatSessionsService, with concrete implementations in the workbench service and test mock. - Enables the existing “Delete…” context menu action for agent-host session items and delegates deletion via
IChatSessionsService. - Implements agent-host session deletion by disposing the backend session and updating cached list items; ensures backend cleanup also removes SDK/on-disk and VS Code per-session data; adds targeted unit tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts | Adds a mock deleteChatSessionItem implementation for tests. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Adds coverage asserting agent-host deletion disposes backend session and updates cached items/events. |
| src/vs/workbench/contrib/chat/common/chatSessionsService.ts | Extends controller/service contracts to support deleting session items. |
| src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts | Implements IChatSessionsService.deleteChatSessionItem dispatching to the registered controller. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts | Enables “Delete…” for agent-host items and routes deletion through IChatSessionsService. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.ts | Implements deletion by disposing backend session and removing the item from controller cache. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds tests ensuring disposeSession triggers SDK delete behavior and handles provisional/error paths. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Ensures disposeSession deletes from the Copilot SDK on-disk store before teardown (non-provisional sessions). |
| src/vs/platform/agentHost/node/agentService.ts | Deletes VS Code per-session data directory on dispose to mirror provider-side cleanup. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 1
DonJayamanne
approved these changes
Jun 11, 2026
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 #320522