Files
vscode/src
Alex Dima d5747b31c4 fix: delete local sessions immediately and prevent re-persistence
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.
2026-05-18 01:06:58 +02:00
..