feat(cleanup): enable 30-day session retention by default#18854
feat(cleanup): enable 30-day session retention by default#18854
Conversation
|
Hi @skeshive, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello @skeshive, 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 introduces a significant change to the CLI's session management by enabling a default 60-day retention policy for chat sessions and tool outputs. This aims to improve disk usage efficiency. Users will be prompted with a dialog on startup to acknowledge this change and decide on immediate cleanup or a 30-day deferral, ensuring a smooth transition while maintaining user control over their data. Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request enables session retention by default and introduces a warning dialog for users. The implementation has a logic flaw in determining when to show this warning, which could lead to a poor user experience for those who have already configured session retention. I've suggested a fix to the useSessionRetentionCheck hook and its usage in AppContainer to correctly identify manually configured settings. Additionally, the tests for this new hook are outdated and need to be updated to match the implementation.
|
Size Change: +6.82 kB (+0.03%) Total Size: 24.4 MB
ℹ️ View Unchanged
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a default 30-day session retention policy, along with a startup dialog for user acknowledgment. The changes are well-structured, touching upon configuration, UI components, hooks, and documentation, and include good test coverage for the new logic. My review includes one high-severity suggestion to improve the efficiency and atomicity of settings updates in DialogManager.tsx by consolidating multiple state updates into a single operation.
Summary
This PR enables automatic session cleanup by default with a 30-day retention period. It introduces a startup dialog for users to acknowledge this policy change, offering an option to either enable a 30 or 120 day retention period.
Dive Deeper
To manage disk usage effectively, the CLI now enforces a default retention policy for chat sessions and tool outputs.
Configuration Changes:
warningAcknowledgedto track user consent and deferral status.UI/UX:
SessionRetentionWarningDialogusing Ink.useSessionRetentionCheckhook to determine if the warning is necessary (shows if the policy is active but not yet acknowledged or manually customized).Linked Issues
https://github.com/google-gemini/maintainers-gemini-cli/issues/1194
Rollout Schedule:
2/17: Preview build
2/24: Stable build (submit PR to default retention to 30 days/remove warning)
3/3: Stable build week 2 (preview build default retention enabled)
3/3: Preview & stable build default retention enabled