-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Description
Problem
Session search (and especially global search across projects) is slow because every search re-parses and
re-processes each JSONL file from scratch.
Per session file searched, the current code:
- Full file I/O — streams entire JSONL
- Full JSON parsing — parses every line into
ParsedMessage - Full chunk building —
buildChunks()including message classification, semantic step extraction, tool
execution tracking, subagent linking - Then finally performs the text match
For a project with 100 sessions, that's 100 full parse+build cycles per search. Global search multiplies this
across all projects.
Root Cause
SessionSearcher.searchSessionFile() calls parseJsonlFile() + buildChunks() on every search. The
DataCache exists but is not used for search.
Search only needs user message text and AI output text — it doesn't need full chunk building.
Proposed Fix
- Lightweight text extraction — skip
buildChunks()entirely for search. Extract only searchable text
(user message strings + assistant text content blocks) directly from parsed messages - Search cache — cache extracted searchable text per session, invalidate via mtime check. Extend existing
DataCacheor add a dedicated search cache - (Stretch) ripgrep for initial filtering — use
rgto search JSONL files as raw text first, then only
parse matching files for result metadata
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels