I’m running into a strange issue in Firebase Studio using Gemini (Genkit / GoogleGenerativeAI).
Even when I send a very simple input like “hi”, I get this error:
[GoogleGenerativeAI Error]:
Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-3-flash-preview:streamGenerateContent?alt=sse:
[400 Bad Request] The input token count exceeds the maximum number of tokens allowed 1048576
What I’ve noticed:
-
Happens even with very small prompts (e.g. “hi”)
-
No explicit large context is being passed in my code
-
Using Firebase Studio / Gemini inside workspace
-
Seems like hidden context is being included automatically
What I’ve tried:
-
Restarting the workspace
-
Starting a new chat session
-
Checking my code for large prompts (nothing obvious)
Question:
Is there a known issue where Firebase Studio or Genkit automatically injects large workspace context that can exceed token limits? And how can I reset or limit that context?
Any help would be appreciated.
