Bug Report
Summary
Right-clicking a Claude session in the Agents window shows a "Delete..." context menu item, and the confirmation dialog appears — but after confirming, the session is not deleted and no error is surfaced to the user. The session remains in the list as if nothing happened.
Steps to Reproduce
- Open VS Code Insiders with the Agents window
- Start a conversation using a Claude model (claude-code session)
- Right-click the session in the sidebar
- Click "Delete..."
- Confirm the dialog
Expected: Session is deleted and removed from the list.
Actual: Session remains — nothing changes, no error shown.
Root Cause (traced)
_deleteAgentSessions() in CopilotChatSessionsProvider routes all non-CLI sessions — including Claude — to chatService.removeHistoryEntry(agentSession.resource):
// copilotChatSessionsProvider.ts ~line 1521
private async _deleteAgentSessions(agentSessions: IAgentSession[]): Promise<void> {
const cliSessionItems: { resource: URI }[] = [];
for (const agentSession of agentSessions) {
if (agentSession.providerType === CopilotCLISessionType.id) {
cliSessionItems.push({ resource: agentSession.resource });
} else {
await this.chatService.removeHistoryEntry(agentSession.resource); // ← bug
}
}
...
}
removeHistoryEntry calls LocalChatSessionUri.parseLocalSessionId(resource), which only handles vscode-local-chat-session:// URIs (standard Copilot Cloud sessions). Claude sessions use the claude-code:// URI scheme, so this throws:
Error: Invalid local chat session resource: claude-code://...
The error is swallowed somewhere in the call stack, causing the silent no-op.
Fix Pattern (already used for rename)
renameChat() (line ~1446) already correctly special-cases AgentSessionProviders.Claude by delegating to an extension command:
if (agentSession?.providerType === AgentSessionProviders.Claude) {
await this.commandService.executeCommand('github.copilot.claude.sessions.rename', { resource: chatUri }, title);
return;
}
The same pattern is needed for deletion — but 'github.copilot.claude.sessions.delete' does not exist in the extension yet.
Fix Required (two parts)
-
copilotChatSessionsProvider.ts — _deleteAgentSessions(): Add a Claude special-case to route to a new 'github.copilot.claude.sessions.delete' extension command (analogous to the CLI agents.github.copilot.cli.deleteSessions delegation).
-
claudeChatSessionContentProvider.ts (Copilot extension): Register 'github.copilot.claude.sessions.delete', following the same pattern as the existing 'github.copilot.claude.sessions.rename' command.
Affected Scope
- Both "Delete session" (full session) and "Delete chat" (single chat in a multi-chat session) go through
_deleteAgentSessions() — both are broken.
- Not affected: Copilot CLI sessions (use a dedicated command), Copilot Cloud sessions (use
vscode-local-chat-session:// which works correctly).
Environment
- VS Code Insiders (Agents window)
- macOS
- GitHub Copilot Chat extension
Bug Report
Summary
Right-clicking a Claude session in the Agents window shows a "Delete..." context menu item, and the confirmation dialog appears — but after confirming, the session is not deleted and no error is surfaced to the user. The session remains in the list as if nothing happened.
Steps to Reproduce
Expected: Session is deleted and removed from the list.
Actual: Session remains — nothing changes, no error shown.
Root Cause (traced)
_deleteAgentSessions()inCopilotChatSessionsProviderroutes all non-CLI sessions — including Claude — tochatService.removeHistoryEntry(agentSession.resource):removeHistoryEntrycallsLocalChatSessionUri.parseLocalSessionId(resource), which only handlesvscode-local-chat-session://URIs (standard Copilot Cloud sessions). Claude sessions use theclaude-code://URI scheme, so this throws:The error is swallowed somewhere in the call stack, causing the silent no-op.
Fix Pattern (already used for rename)
renameChat()(line ~1446) already correctly special-casesAgentSessionProviders.Claudeby delegating to an extension command:The same pattern is needed for deletion — but
'github.copilot.claude.sessions.delete'does not exist in the extension yet.Fix Required (two parts)
copilotChatSessionsProvider.ts—_deleteAgentSessions(): Add a Claude special-case to route to a new'github.copilot.claude.sessions.delete'extension command (analogous to the CLIagents.github.copilot.cli.deleteSessionsdelegation).claudeChatSessionContentProvider.ts(Copilot extension): Register'github.copilot.claude.sessions.delete', following the same pattern as the existing'github.copilot.claude.sessions.rename'command.Affected Scope
_deleteAgentSessions()— both are broken.vscode-local-chat-session://which works correctly).Environment