mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 14:04:41 -07:00
feat(sessions): Add automatic session cleanup and retention policy (#7662)
This commit is contained in:
@@ -16,6 +16,8 @@ import type {
|
||||
GenerateContentResponseUsageMetadata,
|
||||
} from '@google/genai';
|
||||
|
||||
export const SESSION_FILE_PREFIX = 'session-';
|
||||
|
||||
/**
|
||||
* Token usage summary for a message or conversation.
|
||||
*/
|
||||
@@ -149,7 +151,7 @@ export class ChatRecordingService {
|
||||
.toISOString()
|
||||
.slice(0, 16)
|
||||
.replace(/:/g, '-');
|
||||
const filename = `session-${timestamp}-${this.sessionId.slice(
|
||||
const filename = `${SESSION_FILE_PREFIX}${timestamp}-${this.sessionId.slice(
|
||||
0,
|
||||
8,
|
||||
)}.json`;
|
||||
@@ -195,7 +197,7 @@ export class ChatRecordingService {
|
||||
* Records a message in the conversation.
|
||||
*/
|
||||
recordMessage(message: {
|
||||
model: string;
|
||||
model: string | undefined;
|
||||
type: ConversationRecordExtra['type'];
|
||||
content: PartListUnion;
|
||||
}): void {
|
||||
|
||||
Reference in New Issue
Block a user