You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Gemini 3.6 Flash returns 400 Bad Request ("Requests ending with a model turn are not supported") #1052
When using the newly released gemini-3.6-flash model via the GCP Vertex AI provider on Zoo Code 3.72.0, all prompts instantly fail with a 400 Bad Request error.
The API rejects the payload because Zoo Code's current architecture injects a partial model turn at the end of the request history to prefill tool usage (Assistant Prefilling). According to Google's updated documentation, prefilling model turns is no longer supported for Gemini 3.6 Flash and all future releases.
To Reproduce
Set the API Provider to GCP Vertex AI.
Set the Model to gemini-3.6-flash.
Submit any prompt to the agent.
The request immediately fails with the following error.
Error Log
{"error":{"message":"{\n\"error\": {\n\"code\": 400,\n\"message\": \"Requests ending with a model turn are not supported.\",\n\"status\": \"INVALID_ARGUMENT\"\n }\n}\n","code":400,"status":"Bad Request"}}
Root Cause & API Changes
Google has fundamentally changed the Vertex AI API for Gemini 3.6 Flash and 3.5 Flash-Lite:
API requests ending with a non-empty model role turn are strictly disallowed and will return an HTTP 400 Error.
Google recommends migrating to use system_instruction or Native Structured Outputs instead of manually prefilling model turns to force JSON formatting or tool usage.
As an additional heads up for the developers, Google has also deprecated the temperature, top_p, and top_k sampling parameters for this model generation, and supplying them will also return a 400 error.
Temporary Workaround
Rolling the model back to gemini-3.5-flash works perfectly, as the older model architecture still supports Assistant Prefilling.
i got this bug yesterday on ZooCode v3.76.0 in VSCode. works fine in gemini-3-flash-preview, but gemini-3.6-flash will not perform any task at all producing the same 400. the task will populate a list of subtasks, so the first API request works consistently, but subsequent API requests that reason on the generated subtask list break deterministically.
Same failure mode here on the prefilled-model-turn change.
How did you end up finding all the call sites — was it just the 400s in prod, or did you audit the code up front? Wondering whether that kind of change is greppable at all or whether you just have to wait for it to break.
Activity
israelflores8789 commentedon Aug 9, 2026
i got this bug yesterday on ZooCode v3.76.0 in VSCode. works fine in gemini-3-flash-preview, but gemini-3.6-flash will not perform any task at all producing the same 400. the task will populate a list of subtasks, so the first API request works consistently, but subsequent API requests that reason on the generated subtask list break deterministically.
khj676995 commentedon Aug 21, 2026
Same failure mode here on the prefilled-model-turn change.
How did you end up finding all the call sites — was it just the 400s in prod, or did you audit the code up front? Wondering whether that kind of change is greppable at all or whether you just have to wait for it to break.