Skip to content

Fix session names falling back to UUIDs on large transcripts - #23

Open
dgruhin-hrizn wants to merge 1 commit into
L1AD:mainfrom
dgruhin-hrizn:fix-session-name-read-window
Open

Fix session names falling back to UUIDs on large transcripts#23
dgruhin-hrizn wants to merge 1 commit into
L1AD:mainfrom
dgruhin-hrizn:fix-session-name-read-window

Conversation

@dgruhin-hrizn

Copy link
Copy Markdown

Problem

readSessionInfoFromJsonl reads only the first 64KB of a session's JSONL to find the slug / cwd / customTitle. In projects with a large CLAUDE.md (or many @-imported rule files), that content is embedded in the first user message, pushing the slug field 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

  • Read a 1MB window instead of 64KB.
  • Add a regex fallback for slug and cwd on the raw content: a single giant line (or one truncated at the window edge) fails the line-by-line JSON.parse, so the parse loop alone can still miss fields that are present in the window. customTitle keeps the parse-only path since /rename writes 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.json title merge. The remaining two genuinely have no slug in their transcripts.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant