mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -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);
|
const sessionPath = path.join(chatsDir, sessionToDelete.fileName);
|
||||||
await fs.unlink(sessionPath);
|
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 (config.getDebugMode()) {
|
||||||
if (sessionToDelete.sessionInfo === null) {
|
if (sessionToDelete.sessionInfo === null) {
|
||||||
debugLogger.debug(
|
debugLogger.debug(
|
||||||
|
|||||||
Reference in New Issue
Block a user