Skip to content

feat: add idleShutdownMinutes setting to auto-quit CLI after inactivity#25212

Open
micahasmith wants to merge 1 commit intogoogle-gemini:mainfrom
micahasmith:main
Open

feat: add idleShutdownMinutes setting to auto-quit CLI after inactivity#25212
micahasmith wants to merge 1 commit intogoogle-gemini:mainfrom
micahasmith:main

Conversation

@micahasmith
Copy link
Copy Markdown

@micahasmith micahasmith commented Apr 12, 2026

Summary

closes #25211

Details

I use gemini-cli all day long. I've noticed that if i step away from the cli (hours) the memory usage blows up to the point that when i return i can neither /compress nor make any prompt/requests due to the context now being too large for the API.

Related Issues

closes #25211

How to Validate

  • work in a chat for a few days/weeks
  • step away from your computer for 24hrs with the cli open

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@micahasmith micahasmith requested review from a team as code owners April 12, 2026 10:57
@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 12, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 an idle shutdown feature for the CLI to help manage memory usage over long periods of inactivity. By allowing users to define a timeout period, the application can now automatically terminate when not in use, preventing context bloat and excessive resource consumption.

Highlights

  • New Configuration Setting: Added a new setting 'general.idleShutdownMinutes' to allow users to configure an automatic shutdown of the CLI after a period of inactivity.
  • Implementation: Implemented the idle shutdown logic in 'AppContainer.tsx' using a 'useEffect' hook that monitors the streaming state and triggers a '/quit' command after the specified duration.
  • Testing: Added comprehensive unit tests in 'AppContainer.test.tsx' to verify that the idle timer correctly triggers the shutdown, respects the configuration, and resets when the application state changes.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an idle shutdown feature to the CLI, allowing the application to automatically close after a specified period of inactivity. The changes include adding a new configuration setting, general.idleShutdownMinutes, updating the settings schema and documentation, and implementing the timeout logic within the AppContainer component. Additionally, comprehensive unit tests were added to verify that the shutdown is triggered correctly and that the idle timer resets when the streaming state changes. I have no feedback to provide.

@gemini-cli gemini-cli bot added the area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leaving CLI Open Creates Memory + Context Window Bugs

1 participant