Commit 0e9a2f017acc
Changed files (1)
dots
pi
agent
extensions
ai-storage
dots/pi/agent/extensions/ai-storage/summarizer.ts
@@ -51,6 +51,7 @@ function notify(title: string, body: string) {
function summarizeWithPi(transcript: Transcript): string | null {
const conversationText = transcript.messages
.slice(0, 50) // Limit to first 50 messages to avoid token limits
+ .filter((m) => m.content) // Skip messages with undefined content
.map((m) => `${m.role.toUpperCase()}: ${m.content.slice(0, 2000)}`) // Truncate long messages
.join("\n\n---\n\n");