mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-22 08:09:42 +01:00
d5747b31c4
Local sessions were not removed from the UI when deleted, and reappeared after reload. Three issues were at play: 1. removeHistoryEntry deleted the persisted file but left the live ChatModel alive and unmarked, so getLiveSessionItems kept returning it and willDisposeModel re-saved it on shutdown. Fixed by adding an isDeleted flag on ChatModel, checked by shouldBeInHistory and shouldStoreSession. 2. LocalAgentsSessionsController fired a removed event on onDidDisposeSession but never removed the session from _items, so subsequent refresh cycles via resolveProvider re-added it. Fixed by deleting from _items in the dispose handler. 3. _refreshSessionCache only detected removal of AgentSessionAdapter instances, but committed local sessions could remain as LocalNewSession in the cache. Changed the filter to skip only _currentNewSession.