gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

0.8.0 switches to flash much earlier than 0.6.0

Open Neinndall opened this issue 1 year ago • 14 comments

What happened?

Tokens go down super fast from PRO to FLASH in 5%? In the new version 0.8.0, I'm noticing that after 4-5% from 100% (new session) to 95% this API error is appearing. I think it's exaggerated that this error appears when the switch to FLASH shouldn't have appeared. It seems to me that from PRO to FLASH, according to stats, it has spent ~800K. According to /stats, it doesn't seem coherent to me.

Also, the error cuts off the conversation. It allows you to chat and work with GEMINI, but it's strange that the PRO QUOTA has run out so "quickly." I'm currently on version 0.6.1 because I think it works much better regarding tokens.

✕ [API Error: [{
    "error": {
      "code": 429,
      "message": "Resource exhausted. Please try again later. Please refer to
  https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
      "errors": [
        {
          "message": "Resource exhausted. Please try again later. Please refer to
  https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
          "domain": "global",
          "reason": "rateLimitExceeded"
        }
      ],
      "status": "RESOURCE_EXHAUSTED"
    }
  }
  ]]
  Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model
  for the rest of this session.

What did you expect to happen?

not to fast waste the tokens ...

Client information

CLI Version 0.8.0-nightly.20250925.b1da8c21
Model auto
Sandbox no sandbox
OS win32
Auth Method OAuth

Login information

No response

Anything else we need to know?

No response

Neinndall avatar Sep 30 '25 11:09 Neinndall

Could you clarify: What does "in 5%" mean? "4-5% at 95%"? Are these context sizes?

scidomino avatar Sep 30 '25 17:09 scidomino

Could you clarify: What does "in 5%" mean? "4-5% at 95%"? Are these context sizes?

yeah -4-5% was a new session from 100% to 95% and exhausted...

Neinndall avatar Sep 30 '25 19:09 Neinndall

Sorry. I still don't follow. Is the issue is you start a new session, and you are only using 5% of the context, and yet you still get this error? The error has to do with your overall usage, not with the specific context window you have now.

I think this is working as expected. Let me know if I misunderstand and I can reopen.

scidomino avatar Oct 01 '25 17:10 scidomino

Sorry. I still don't follow. Is the issue is you start a new session, and you are only using 5% of the context, and yet you still get this error? The error has to do with your overall usage, not with the specific context window you have now.

I think this is working as expected. Let me know if I misunderstand and I can reopen.

Basically, I start a new session with a clean account (100%). After spending 4-5% of the tokens (at 95%), the mode switches from PRO to FLASH.

This must be wrong, because in version 0.6.1, I start on a new "clean" account with 100% and it doesn't go into FLASH mode until 89% or so and I've used quite a few tokens, meaning it's impossible for me to go SO quickly from PRO mode to FLASH mode with such a small % (tokens) spent.

✕ [API Error: [{ 
"mistake": { 
"code": 429, 
"message": "Resource exhausted. Please try again later. Please refer to 
https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.", 
"errors": [ 
{ 
"message": "Resource exhausted. Please try again later. Please refer to 
https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.", 
"domain": "global", 
"reason": "rateLimitExceeded" 
} 
], 
"status": "RESOURCE_EXHAUSTED" 
} 
} 
]] 
Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model 
for the rest of this session.

Neinndall avatar Oct 01 '25 17:10 Neinndall

Ah! Ok. That makes sense. Reopening.

scidomino avatar Oct 01 '25 18:10 scidomino

I have the same issue and I'm wondering why this is not more wide spread..

For me, it fails while saying it has 98% gemini-2.5-pro context left.

matevzg avatar Oct 08 '25 15:10 matevzg

✕ [API Error: [{ "error": { "code": 429, "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.", "errors": [ { "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.", "domain": "global", "reason": "rateLimitExceeded" } ], "status": "RESOURCE_EXHAUSTED" } } ]] Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model for the rest of this session.

Just got this error - on my VERY first prompt today using 0.8.1. I have a Gemini Code Assist Standard subscription

lennartkoester avatar Oct 09 '25 07:10 lennartkoester

The message is incorrect anyway, since it's not a matter of resource exhaustion, but rate limiting. Dubious at least.

Must be a server side issue, since I can replicate it on 0.6.1.

matevzg avatar Oct 09 '25 07:10 matevzg

I have the same issue after updating to 0.8.0. Quit and restart resolved this issue for now.

✕ [API Error: [{
    "error": {
      "code": 429,
      "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
      "errors": [
        {
          "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
          "domain": "global",
          "reason": "rateLimitExceeded"
        }
      ],
      "status": "RESOURCE_EXHAUSTED"
    }
  }
  ]]
  Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model for the rest of this session.


> try again

✕ [API Error: [{
    "error": {
      "code": 429,
      "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
      "errors": [
        {
          "message": "Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.",
          "domain": "global",
          "reason": "rateLimitExceeded"
        }
      ],
      "status": "RESOURCE_EXHAUSTED"
    }
  }
  ]]
  Possible quota limitations in place or slow response times detected. Switching to the gemini-2.5-flash model for the rest of this session.


> /quit

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                                                                                                                                                                          │
│  Agent powering down. Goodbye!                                                                                                                                                                                                                                                                                                                                           │
│                                                                                                                                                                                                                                                                                                                                                                          │
│  Interaction Summary                                                                                                                                                                                                                                                                                                                                                     │
│  Session ID:                 7b4c3182-5011-4543-b3e8-0a494f3fd6c8                                                                                                                                                                                                                                                                                                        │
│  Tool Calls:                 14 ( ✓ 14 x 0 )                                                                                                                                                                                                                                                                                                                             │
│  Success Rate:               100.0%                                                                                                                                                                                                                                                                                                                                      │
│  Code Changes:               +15 -5777                                                                                                                                                                                                                                                                                                                                   │
│                                                                                                                                                                                                                                                                                                                                                                          │
│  Performance                                                                                                                                                                                                                                                                                                                                                             │
│  Wall Time:                  14m 13s                                                                                                                                                                                                                                                                                                                                     │
│  Agent Active:               3m 17s                                                                                                                                                                                                                                                                                                                                      │
│    » API Time:               2m 37s (79.8%)                                                                                                                                                                                                                                                                                                                              │
│    » Tool Time:              39.8s (20.2%)                                                                                                                                                                                                                                                                                                                               │
│                                                                                                                                                                                                                                                                                                                                                                          │
│                                                                                                                                                                                                                                                                                                                                                                          │
│  Model Usage                  Reqs   Input Tokens  Output Tokens                                                                                                                                                                                                                                                                                                         │
│  ───────────────────────────────────────────────────────────────                                                                                                                                                                                                                                                                                                         │
│  gemini-2.5-pro                 18        756,770          2,810                                                                                                                                                                                                                                                                                                         │
│  gemini-2.5-flash                2         18,579            325                                                                                                                                                                                                                                                                                                         │
│                                                                                                                                                                                                                                                                                                                                                                          │
│  Savings Highlight: 454,571 (58.6%) of input tokens were served from the cache, reducing costs.                                                                                                                                                                                                                                                                          │
│                                                                                                                                                                                                                                                                                                                                                                          │
│  » Tip: For a full token breakdown, run `/stats model`.       

njovy avatar Oct 09 '25 10:10 njovy

We recently overhauled our retry logic in version v0.9.0-preview.0. Could one of the users affected by this see if running that version improves the situation? Thanks!

scidomino avatar Oct 09 '25 20:10 scidomino

We recently overhauled our retry logic in version v0.9.0-preview.0. Could one of the users affected by this see if running that version improves the situation? Thanks!

Hi!

I'm on Release v0.10.0-nightly.20251009.cd354aeb and I've been using it and haven't had any issues with resource exhaustion (change from PRO to FLASH so early) so far so good.

And another detail I'm going to ask you about: I don't know if it's being implemented. I'll see if you can consider the API messages that come out when the model is exhausted, which change the model but silently like this, DOESN'T end the conversation with an API error, because it's tedious, or some message that appears to warn the user.

Neinndall avatar Oct 10 '25 03:10 Neinndall

I'm also getting the same error after less than 10 minutes of usage today (it used to take around three hours for my quota to run out, so I'm also suspecting something weird is going on with the new version).

That said, it doesn't seem to be consistent, after waiting a few minutes I can successfully send a request or two before the error re-appears. Maybe just overloaded servers?

That said, I feel this entire saga underlines that gemini-cli needs a much better way to track how much of your daily pro-model time you have spent as a pro user. I understand that it's not as easy as saying "you have 15 prompts left", what with different context sizes, different types of requests, and whatnot, but the current model of "we'll tell you when you have run out, and this may be anywhere between minutes after you started or half a workday from now" is not really workable for production use.

xLeitix avatar Oct 10 '25 13:10 xLeitix

Getting the same error on macOS 15.7.1 with gemini cli 0.8.2. It started today and has been appearing randomly.

emmanuelflores avatar Oct 10 '25 16:10 emmanuelflores

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Jan 04 '26 00:01 gemini-cli[bot]