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

View File

@@ -15,6 +15,7 @@ import {
} from '@google/gemini-cli-core';
import * as fs from 'node:fs/promises';
import path from 'node:path';
import { stripUnsafeCharacters } from '../ui/utils/textUtils.js';
/**
* Constant for the resume "latest" identifier.
@@ -60,6 +61,8 @@ export interface SessionInfo {
isCurrentSession: boolean;
/** Display index in the list */
index: number;
/** AI-generated summary of the session (if available) */
summary?: string;
/** Full concatenated content (only loaded when needed for search) */
fullContent?: string;
/** Processed messages with normalized roles (only loaded when needed) */
@@ -259,10 +262,13 @@ export const getAllSessionFiles = async (
startTime: content.startTime,
lastUpdated: content.lastUpdated,
messageCount: content.messages.length,
displayName: firstUserMessage,
displayName: content.summary
? stripUnsafeCharacters(content.summary)
: firstUserMessage,
firstUserMessage,
isCurrentSession,
index: 0, // Will be set after sorting valid sessions
summary: content.summary,
fullContent,
messages,
};