mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Large desktop installs can accumulate huge JSONL transcripts, and the sidebar session list previously loaded each requested transcript into memory on cache misses. The main branch cache from #651 handles repeated hot refreshes, so this change keeps that cache and replaces cache-miss list metadata extraction with a sequential streaming summary scan for paginated files only. It also makes Windows sidecar shutdown prefer taskkill /T so stale child processes are less likely to survive app stop paths. Constraint: Must preserve main's short session-list cache from #651 while reducing cache-miss memory growth. Rejected: Rely only on the #651 cache | cache expiry, first load, and pagination still hit full JSONL reads. Rejected: Add a persistent summary index | larger persistence migration risk than needed for this issue. Confidence: medium Scope-risk: moderate Directive: Do not replace the streaming scanner with full readJsonlFile calls without re-running large-transcript pressure tests. Tested: bun test src/server/__tests__/sessions.test.ts Tested: bun run check:server Tested: bun run check:native Tested: bun run check:desktop Tested: synthetic pressure test with 140 sessions x 1200 JSONL entries showed lower RSS growth than main baseline. Not-tested: Windows live taskkill /T process-tree cleanup.