this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix sessionId fallback when missing in session files

alice 03acb97e 17c1b177

+13 -6
+13 -6
src/core/session-reader.ts
··· 59 59 seen.add(entry.uuid); 60 60 61 61 // Extract metadata from first entry 62 - if (sessionId === '') { 62 + if (sessionId === '' && typeof entry.sessionId === 'string' && entry.sessionId !== '') { 63 63 sessionId = entry.sessionId; 64 64 } 65 65 if (gitBranch === '' && entry.gitBranch !== undefined) { 66 66 gitBranch = entry.gitBranch; 67 67 } 68 68 69 - // Track timestamps 70 - if (startTime === '' || entry.timestamp < startTime) { 71 - startTime = entry.timestamp; 69 + // Track timestamps (only if valid) 70 + if (entry.timestamp && typeof entry.timestamp === 'string') { 71 + if (startTime === '' || entry.timestamp < startTime) { 72 + startTime = entry.timestamp; 73 + } 74 + if (endTime === '' || entry.timestamp > endTime) { 75 + endTime = entry.timestamp; 76 + } 72 77 } 73 - if (endTime === '' || entry.timestamp > endTime) { 74 - endTime = entry.timestamp; 78 + 79 + // Skip entries without a valid message (malformed JSONL entries) 80 + if (!entry.message) { 81 + continue; 75 82 } 76 83 77 84 // Extract token usage from assistant messages