Gemini API rate limit handling causes permanent CLI lockup + User cancelled the request messages (even when I haven't)
Describe the bug
The Gemini API integration is stuck in an infinite rate limit loop, preventing any interaction with it. When attempting to use the CLI tool, the system immediately encounters a rate limit error from the Gemini API (switching from gemini-2.5-pro to gemini-2.5-flash), and subsequent attempts to interact with the interface result in the same rate limit message being displayed repeatedly. The system appears unable to recover from this state, effectively rendering the CLI unusable. Even simple commands or messages trigger the rate limit response, creating a blocking condition where no actual API calls can be processed.
Additional context
- The system automatically attempts to switch from gemini-2.5-pro to gemini-2.5-flash as a fallback, but this also hits rate limits (?)
- The error generates a bug report URL but the user cannot proceed to submit it due to the blocking nature of the issue
- The terminal shows "Request cancelled" followed by "User cancelled the request" messages, indicating the user had to forcefully interrupt the process, even when I haven't submitted these.
- The issue persists across all input attempts, suggesting the rate limit state is not clearing between requests.
Diagnostic Information
- CLI Version: 0.1.1
- Git Commit: 852210e1 (local modifications)
- Operating System: darwin v24.3.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-flash
- Memory Usage: 623.1 MB
I am seeing the same behavior
I corrected it after a shell call, and now it stopped working altogether
same here: https://github.com/google-gemini/gemini-cli/issues/1627
+1
+1
Sorry, y'all. In the first 10 hours after launch, we got a ridiculous amount of interest (far more than we dreamed) which resulted in us exceeding our internal capacity. It sounds like you're among the unlucky devs who got either a server timeout or slow response. We're doing a number of things to make it better including:
- adding more gemini TPU capacity
- intelligently routing requests to different models based on complexity
- providing better fallbacks when there's a slow response
- fixing that weird looping behavior
Sorry, but thanks for riding it out with us. 🙏
version 0.1.4 has a fix for this issue when logging in with Google Account. could you please update to latest and confirm that you are on 0.1.4. That should help resolve this issue for you.
npm install -g @google/gemini-cli@latest gemini --version
Got the '[API Error:' with 0 token usage when used with the API Key, but switching auth to Email sign-in has at least unblocked that issue for now. This is after updating to the latest version! Thanks Gemini team.