mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
feat(sessions): use 1-line generated session summary to describe sessions (#14467)
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user