Gemini 3.5 Flash getting stuck with "Invalid argument" error (0s runtime) on Google AI Studio

Hi everyone,

I’m experiencing a persistent issue while using Gemini 3.5 Flash on the Google AI Studio mobile interface.

Out of nowhere, the model stopped responding and started throwing an “Invalid argument.” error, showing a runtime of “Ran for 0s”.

Even when I tried to follow up or ask the model to finish its previous task, the exact same error repeated itself, effectively freezing the entire chat history.

Here are some details about my current setup when the error happened:

Model: Gemini 3.5 Flash

Context: The prompt was related to a mapping feature implementation utilizing Maptiler and OpenRouteService (ORS).

Platform: Google AI Studio (Web interface on iOS/Safari).

Has anyone else encountered this issue where a specific conversation gets corrupted with an “Invalid argument” loop? Is there any way to recover or clear the broken context without losing the prompt configuration?

Any help or insight from the engineering team would be highly appreciated. I am attaching a screenshot of the error below.

Thank you!

Hello @Aila_Company_Solutio ,

If you are still facing this issue, could you please try the following troubleshooting steps?

  • Clear your browser cache and cookies.

  • Try opening AI Studio in an Incognito / Private window.

  • Check if this happens with all models, or if it is only happening with this specific one.

Hi @Aila_Company_Solutio,

This “Invalid argument” loop combined with “Ran for 0s” usually happens when the chat history context becomes corrupted. This is often triggered when a previous response contains large nested data structures (like raw GeoJSON, map vectors, or complex routing scripts from Maptiler/ORS) that exceed the internal API payload restrictions or break token validation on subsequent calls.

Since your main priority is to save your prompt configurations without losing the setup, here are the workarounds you can use right now to bypass the frozen history:

  1. Use the “Copy to a new prompt” feature (Best Alternative)
    Instead of starting completely from scratch, look at the top-right corner of your Google AI Studio workspace (on a desktop browser view if mobile is restricted) and click the three-dots menu or action bar. Choose “Copy to a new prompt” or duplicate the project. This will carry over all your system instructions, temperature configurations, and active model settings into a brand new, clean chat session while stripping out the corrupted conversation history.

  2. Prune/Delete the Corrupted Message turn
    If you switch your mobile browser to “Desktop Site” mode, you can hover over or tap the specific message turn right before the error loop started. Look for the small “Delete” (trash bin icon) or cross button next to that specific prompt block. Deleting the single prompt block that caused the malformed payload can sometimes clean the context pipeline and immediately unfreeze the entire chat history.

  3. Export to Code / Save Prompt Layout
    Before clearing anything, click the “Get Code” button in the upper interface. This allows you to securely backup your configurations, API settings, and raw system instructions into a clean Python, JavaScript, or cURL script so you have a hard copy of your prompt setup.

This appears to be an edge-case parser bug with large mapping outputs, so sharing this thread will definitely help the Google Engineering team track the payload exception!