You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0e1ffe4
Browse filesBrowse the repository at this point in the historyBrowse files
perf: prune per-thread client state and evict idle VCS status cache
Long-lived sessions grew without bound in three places. On the client,
deleting a thread left entries behind in the right-panel, diff-panel,
mini-player, and ui-state stores (the zustand removeThread helpers existed
but had no callers), previewStateAtom used Atom.keepAlive so one registry
node per thread ever visited lived for the process lifetime, and a released
browser surface left a tombstone in byTabId per preview tab ever opened. On
the server, VcsStatusBroadcaster kept its per-cwd status cache for the
broadcaster's lifetime after the last poller subscriber released.
Deletion now prunes every per-thread store (both the live and archived
paths), preview atoms use a 5-minute idle TTL (threads with live sessions
stay resident via activePreviewSessionsAtom; idle threads re-seed from the
next server snapshot), surface release deletes the entry, and the final
poller release drops the cwd's cache entry inside the same critical section
that removes the poller so a concurrent retain cannot lose its fresh entry.
The orchestration read-model half of #4176 is not ported: orchestration V2
loads per-thread state from indexed SQLite inside each command and holds no
process-wide in-memory read model, so the O(N) scans that change removed no
longer exist.
Closes#4178.
Co-Authored-By: Claude Code <[email protected]>
0 commit comments