diff --git a/read-session-file.js b/read-session-file.js index 26c2e8b..1123289 100644 --- a/read-session-file.js +++ b/read-session-file.js @@ -13,12 +13,16 @@ function readSessionFile(filePath, folder, projectPath) { let textContent = ''; let slug = null; let customTitle = null; + let aiTitle = null; for (const line of lines) { const entry = JSON.parse(line); if (entry.slug && !slug) slug = entry.slug; if (entry.type === 'custom-title' && entry.customTitle) { customTitle = entry.customTitle; } + if (entry.type === 'ai-title' && entry.aiTitle) { + aiTitle = entry.aiTitle; + } if (entry.type === 'user' || entry.type === 'assistant' || (entry.type === 'message' && (entry.role === 'user' || entry.role === 'assistant'))) { messageCount++; @@ -45,7 +49,7 @@ function readSessionFile(filePath, folder, projectPath) { summary, firstPrompt: summary, created: stat.birthtime.toISOString(), modified: stat.mtime.toISOString(), - messageCount, textContent, slug, customTitle, + messageCount, textContent, slug, customTitle: customTitle || aiTitle, }; } catch { return null;