Reduce session index churn on chat start

This commit is contained in:
dobby-d-elf
2026-05-25 16:25:23 -06:00
parent 48a2e79224
commit ca9e821b5e
5 changed files with 40 additions and 19 deletions

View File

@@ -239,6 +239,14 @@ def _write_session_index(updates=None):
_write_session_index(updates=None)
def prune_session_from_index(session_id: str) -> None:
"""Remove one session row from the persisted sidebar index if present."""
sid = str(session_id or "")
if not sid or not SESSION_INDEX_FILE.exists():
return
_write_session_index(updates=[])
def _active_stream_ids():
with STREAMS_LOCK:
active_ids = set(STREAMS.keys())