mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-03 12:42:43 +00:00
ab01e56db0
GET /api/ai/sessions fully re-parsed every session transcript on every call, roughly three times over (handoff refresh List, per-session action loads, final List). On a long-lived install the endpoint took tens of seconds, pegged the CPU, and the dev watchdog kill-looped the backend. - SessionStore.List() now serves summaries from a per-file cache validated by (modTime, size); only changed files are re-read, with a raw-skip decode that never deep-parses message payloads. - The cache persists as .sessions_index.json next to the session files, so the first list after a restart is index-speed too (18ms on a 662MB legacy directory vs 23s before). - writeSession/Delete keep cache and index coherent; external edits self-heal via the (modTime, size) check. - ListSessions refreshes handoff action status only for the 20 newest sessions that carry actions, matching what the recent-sessions UI can surface; the send path already refreshes the active session on load. - ai-runtime contract updated: listing-cost clause and bounded-refresh clause replace the unbounded refresh promise.