fix: fallback title from preview when session has no explicit title

SQLite path was returning null title for sessions without an explicit
title, while the CLI path derives it from the first user message.
Now uses the preview (first user message content) as title fallback,
matching the original CLI behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-18 08:53:45 +08:00
parent 7e84c56c20
commit fd7071b75d
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -120,6 +120,6 @@ describe('session DB summaries', () => {
expect(allMock).toHaveBeenCalledWith('telegram', 2)
expect(rows[0].last_active).toBe(1710000100)
expect(rows[0].source).toBe('telegram')
expect(rows[0].title).toBeNull()
expect(rows[0].title).toBe('preview text')
})
})