Session list performance: disk summary cache, display-name cache, and count alignment#111
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #109
Large installs were painful on cold start — every session list request re-parsed every
.jsonl, and the landing page reopened files on every load just to get display names and counts. The in-memory LRU from #82 helps within a run but dies on restart.This adds a SQLite summary cache (
~/.claude-code-chat-browser/session_summary_cache.sqlite) keyed on path + mtime + exclusion-rules fingerprint.get_project_sessionsskips the full parse when we already have a complete row.get_projectsgoes through the same cache for peek data instead of callingquick_session_infoon every file every time.Also cached display names in
session_path.py— keyed on the project dir and max.jsonlmtime, so repeat landing page loads don't reopen files when nothing changed.Project card
session_countnow uses the same titled-session filter as the session list when there are no exclusion rules. If exclusions are on, the card count can still diverge (same trade-off we accepted on cppa).Partial cache rows from peeks get upgraded to full rows on the first session-list visit. mtime change = cache miss.
Files:
utils/session_summary_cache.py(new),api/projects.py,utils/session_path.py, tests intest_session_summary_cache.py+ integration/path tests.To verify: run the test suite; optionally restart the server, hit a project session list twice — second request shouldn't touch
get_cached_sessionfor unchanged files. Touch one.jsonland confirm only that one re-parses.FTS search / search UX is separate — that's the Monday PR.
Summary by CodeRabbit