fix(plan): clean up session directories and plans on deletion#20914
fix(plan): clean up session directories and plans on deletion#20914
Conversation
Updates both automatic session retention and manual session deletion to purge the entire session-specific directory (~/.gemini/tmp/<project>/<sessionId>/). This ensures that implementation plans, tasks, and other session-specific artifacts are cleaned up along with the session file. - Update cleanupExpiredSessions to delete session directories. - Update ChatRecordingService.deleteSession to purge directories and logs. - Add regression tests for directory cleanup. - Update documentation to clarify plan/task cleanup behavior. - Document session retention defaults (30 days) and configuration as a follow up to #20853. - Clarify that manual deletion also removes plans and tasks. Fixes #17793 This update follows up on the session retention implementation in #20853
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the cleanup process for Gemini CLI sessions. It ensures that when sessions are either automatically expired or manually deleted, all related temporary files, including implementation plans, task trackers, tool outputs, and activity logs, are completely removed. This change addresses potential accumulation of stale data and provides clearer documentation on session retention policies. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +701 B (0%) Total Size: 25.8 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request aims to improve session cleanup by deleting entire session-specific directories. It introduces a high-severity path traversal vulnerability and synchronous I/O issues in the core package's ChatRecordingService.deleteSession function, where sessionId is used without proper sanitization, potentially leading to arbitrary file deletion and performance degradation. Additionally, a path traversal vulnerability is present in the CLI package's cleanupExpiredSessions function, though it is considered low-risk due to its context within user-specific temporary directories.
Updates both automatic session retention and manual session deletion to purge the entire session-specific directory (
~/.gemini/tmp/<project>/<sessionId>/). This ensures that implementation plans, tasks, and other session-specific artifacts are cleaned up along with the session file.Fixes #17793