mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 18:11:02 -07:00
feat(cli): cleanup activity logs alongside session files (#16399)
This commit is contained in:
@@ -86,6 +86,18 @@ export async function cleanupExpiredSessions(
|
||||
const sessionPath = path.join(chatsDir, sessionToDelete.fileName);
|
||||
await fs.unlink(sessionPath);
|
||||
|
||||
// ALSO cleanup Activity logs in the project logs directory
|
||||
const sessionId = sessionToDelete.sessionInfo?.id;
|
||||
if (sessionId) {
|
||||
const logsDir = path.join(config.storage.getProjectTempDir(), 'logs');
|
||||
const logPath = path.join(logsDir, `session-${sessionId}.jsonl`);
|
||||
try {
|
||||
await fs.unlink(logPath);
|
||||
} catch {
|
||||
/* ignore if log doesn't exist */
|
||||
}
|
||||
}
|
||||
|
||||
if (config.getDebugMode()) {
|
||||
if (sessionToDelete.sessionInfo === null) {
|
||||
debugLogger.debug(
|
||||
|
||||
Reference in New Issue
Block a user