Thank you! did solve my issue. Shouldn’t we be able to tell Gemini at the project to clear these messages itself?
Hi, can you tell ho wwhere what to add?
I deleted more than half of the lines from my 1 week project, and it worked great. One thing I want to mention that worked for me: in studio the error I was getting was this, and if I just copied and pasted the error, or said “don’t omit the xml” “redo, you didn’t change the code” nothing would work. The best way to get the result I could find, after following all the steps @tom mentioned, is to EXPLICITLY ask the agent to “not just try to generate the xml again, revisiting the commit, but to analyze the suggested changes and refactor in another way generating exactly the SAME results” this made it get out of the loop and continue working
Thanks for the help!
Thanks , it helped.
After restarting twice… but now it is compiling again.
@google please fix this in a normal way…
can you create a file, that we can run and clean all that errors, I try one,but dont know how to execute. from the terminal . so it can clean the file
it worked, it worked, it worked…
This works amazingly. Thank you so much.
With a help of Gemini, I got it and the prototyper is working fine again! thaaaanks, guys!
Son ideas mías o el truco ya dejo de funcionar con la nueva actualización? espero que también haya aumentado el limite de tokens y la velocidad
@Elvis_Rincon, thank you for your comment.
You forgot to enter code
.
The correct format is code /home/user/.idx/ai/capra-context-state.json
, not /home/user/.idx/ai/capra-context-state.json
.
I hope this helps
seems capra-thread.json now has changed
and seems Google is fixing something? i think they are resetting the thread now, as i have experienced multiple time today that the prototype display nothing and then it display the thread again , have anyone else experienced this ?
My apologies if you are running into this issue. In the short term, we landed one mitigation for this issue yesterday, and we have one more in flight that should start rolling out next week. We’ll also continue to monitor this, and won’t be happy until this issue is fully resolved, at least in the vast majority of cases.
If you still need to apply this workaround, please file an issue with relevant details so we can follow up. Also, please ensure at least one user and model turn remain in the history(see "Cannot read properties of undefined (reading 'role')" — triggered on every prompt, even with empty context. Seems like a middleware or handler bug with no fallback on missing role - #9 by Joshua_Litt, but TLDR this will be fixed on prod this week).
hi seems today it displayed
[GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro-preview-03-25:streamGenerateContent?alt=sse: [400 Bad Request] Request contains an invalid argument.
which is linked to
i tried again the above and clean these two file
prototyper-thread.json - delete everything in the file
prototyper-context-state.json - edited the proposal agent and edit agent section so user and model text is all “…”
but now this GoogleGenerativeAI Error is still happening no matter how i clean it, not sure if the new solution that google planning now will fix this,
i too facing the same issue i have tried what you have said when i run the statement the only the capar-context-state is added to the back up for the for the other file it says cp: cannot stat ‘/home/user/.idx/ai/capra-thread.json’: No such file or directory
Joshua,
Can you provide an update on this?
I’m currently running into the token limit error.
I’ve applied many of the manual context fixes on the forums here to no avail.
However, by moving files and folders out of studio/src/ai/* I’m able to reduce my context and use the prototyper again. But then my app fails because it relies on these files and flows, and when it can’t find them it triggers react errors.
So I’m caught in a Catch 22:
I can leave the files there and my app works, but I can’t use the prototyper.
Or, I can remove them and use the prototyper, but it tries to remove imports to those files since they are missing now.
I’ve backed up, replaced and edited my prototype context files, this token limit seems to stem from Gemini being passed my src/ai/* folder, or other src/* folders and files.
But how am I supposed to develop my project if it can’t read these?
How can I move forward with my project? I’ve tried to create scripts to calculate my token count locally but they didn’t seem to match the token count reported by Gemini. I’m not far over the limit, and I only reached the limit while actively developing with the prototyper.
As an aside, here’s a feature request: It would be very useful to have a UI progress bar showing your token count as you develop, and having the ability for Firebase Studio to dynamically respond to reaching a critical threshold, say 90% Utilization of the token count.
I’ve lost three full days of development on my app as of today, which is detrimental because I am very close to publishing and launching my app.
Firebase Studio has been absolutely incredible for turning my idea into reality, but now I’m experiencing the technical debt and reliance of a system which can no longer support me.
I understand there are limitations, but it shouldn’t be up to the community to discover novel workarounds for basic functionality of the primary feature of this app.
I could bifurcate my project into different development branches and write a script to shuttle files in and out of the src/ folder, but I can’t trust the prototyper to not remove key functionality like broken imports when it realizes there are missing files.
I’ve also experimented with .aiexclude, .gcloudignore, .ignore, .studioignore, .gitignore in both the .idx and studio folders to prevent them from sending specific folders and files to the prototyper to no avail. I’ve tried /clear in the prototyper as well, and as I mentioned at the top of my post I have replaced the context files as well.
Is there any documentation which clearly defines which files and folders are sent to the prototyper?
Error: [GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro-preview-03-25:streamGenerateContent?alt=sse: [400 Bad Request] The input token count (1059554) exceeds the maximum number of tokens allowed (1048575).
I have the same error:
Sorry, I hit a snag. Please try again shortly or modify your prompt.
[GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro-preview-03-25:streamGenerateContent?alt=sse: [400 Bad Request] The input token count (1965399) exceeds the maximum number of tokens allowed (1048575).
Any assistance would be great… lost hours and days of development time.
Also, I don’t seem to have the ‘ai’ folder in my ‘/home/user/.idx’ directory. Any idea why is this is the case?
Thanks
Just to add to this, I’m also seeing this issue and the fix described here doesn’t seem to resolve the issue as of June 18 2025. A few notes that I’m seeing:
-
The /home/user/.idx/ai/ files are now called 'prototyper-context-state.json and ‘prototyper-thread.json’, the ‘capra’ versions seem to have changed recently.
-
Clearing entries from both the ‘context’ and ‘thread’ files (both separately and together) don’t seem to impact the token count issue (see attached). This includes doing a restart of the VM and an environment rebuild from the .nix file. I can verify deletes in the ‘thread’ are clearing it in the prototyper view, but the token count isn’t impacted.
-
I have an open ticket with Firebase Studio support, I’ll post updates/resolution steps if I get any insight
hey, i found the solution, fireabase made an update, now you should do "timestamp=$(date +%Y%m%d%H%M%S);
mkdir -p “/home/user/studio/context_backup/” &&
cp “/home/user/.idx/ai/prototyper-context-state.json” “/home/user/studio/context_backup/prototyper-context-state-${timestamp}.json” &&
cp “/home/user/.idx/ai/prototyper-thread.json” “/home/user/studio/context_backup/prototyper-thread-${timestamp}.json”
" instead of ‘capra’ its ‘prototyper’, trust me