Fix session names falling back to UUIDs on large transcripts - #23
Open
dgruhin-hrizn wants to merge 1 commit into
Open
Fix session names falling back to UUIDs on large transcripts#23dgruhin-hrizn wants to merge 1 commit into
dgruhin-hrizn wants to merge 1 commit into
Conversation
readSessionInfoFromJsonl only read the first 64KB of a session JSONL, but the first user message can embed large CLAUDE.md rule imports, pushing the slug/cwd fields past that window (observed at byte ~138K). Every session in such a project silently fell back to the raw UUID. - Read a 1MB window instead of 64KB - Regex-scan the raw content as a fallback for slug/cwd, since a single giant line truncated at the window edge fails JSON.parse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Problem
readSessionInfoFromJsonlreads only the first 64KB of a session's JSONL to find theslug/cwd/customTitle. In projects with a largeCLAUDE.md(or many@-imported rule files), that content is embedded in the first user message, pushing theslugfield past the 64KB window — observed at byte ~138K in a real project. The lookup silently fails and every session board in that project is labeled with the raw UUID instead of a readable name.Fix
slugandcwdon the raw content: a single giant line (or one truncated at the window edge) fails the line-by-lineJSON.parse, so the parse loop alone can still miss fields that are present in the window.customTitlekeeps the parse-only path since/renamewrites it as a small standalone line.Result
In the affected project, 5 of 7 session boards went from raw UUIDs to their slugs/custom titles; resolving the slug also unlocked the
sessions-index.jsontitle merge. The remaining two genuinely have no slug in their transcripts.