Skip to content

Enable Delete command on Agent Host sessions#320889

Merged
dmitrivMS merged 2 commits into
mainfrom
dev/dmitriv/agent-host-delete-sessions
Jun 11, 2026
Merged

Enable Delete command on Agent Host sessions#320889
dmitrivMS merged 2 commits into
mainfrom
dev/dmitriv/agent-host-delete-sessions

Conversation

@dmitrivMS

Copy link
Copy Markdown
Contributor

Fixes #320522

@dmitrivMS dmitrivMS added the agent-host Issues for the agent-host implementation (not the protocol) label Jun 11, 2026
@dmitrivMS dmitrivMS self-assigned this Jun 11, 2026
@dmitrivMS dmitrivMS enabled auto-merge (squash) June 11, 2026 05:07

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

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 deleteChatSessionItem as an optional capability on IChatSessionItemController and a new deleteChatSessionItem(...) API on IChatSessionsService, 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

Comment thread src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts Outdated
@dmitrivMS dmitrivMS requested a review from roblourens June 11, 2026 06:52
@dmitrivMS dmitrivMS moved this to In Progress in Agent Host Protocol Jun 11, 2026
@dmitrivMS dmitrivMS merged commit 8b8e365 into main Jun 11, 2026
39 of 40 checks passed
@dmitrivMS dmitrivMS deleted the dev/dmitriv/agent-host-delete-sessions branch June 11, 2026 16:34
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Agent Host Protocol Jun 11, 2026
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-host Issues for the agent-host implementation (not the protocol)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Delete action missing on agent host sessions

3 participants