feat(sessions): use 1-line generated session summary to describe sessions (#14467)

This commit is contained in:
Jack Wotherspoon
2025-12-05 12:20:15 -05:00
committed by GitHub
parent 8341256d1e
commit 616d6f6667
10 changed files with 1639 additions and 4 deletions
@@ -86,6 +86,7 @@ export interface ConversationRecord {
startTime: string;
lastUpdated: string;
messages: MessageRecord[];
summary?: string;
}
/**
@@ -437,6 +438,36 @@ export class ChatRecordingService {
this.writeConversation(conversation);
}
/**
* Saves a summary for the current session.
*/
saveSummary(summary: string): void {
if (!this.conversationFile) return;
try {
this.updateConversation((conversation) => {
conversation.summary = summary;
});
} catch (error) {
debugLogger.error('Error saving summary to chat history.', error);
// Don't throw - we want graceful degradation
}
}
/**
* Gets the current conversation data (for summary generation).
*/
getConversation(): ConversationRecord | null {
if (!this.conversationFile) return null;
try {
return this.readConversation();
} catch (error) {
debugLogger.error('Error reading conversation for summary.', error);
return null;
}
}
/**
* Deletes a session file by session ID.
*/