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-2.5-flash-lite intermittently returns empty STOP response after function call #2667
priority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responsetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
gemini-2.5-flash-lite intermittently returns an empty STOP response — content.parts=None, response.text=None, candidates_token_count=None — on the turn after function call results are sent back. When this happens consistently across iterations it causes agents to loop until they exhaust their iteration limit. gemini-2.5-flash does not exhibit this behaviour.
Reproduction
In a multi-turn agent loop using generate_content with a system_instruction and several registered tools, the second turn (after returning function results) consistently returns an empty response:
Correctly generate a function_call on turn 1
Receive the function result on turn 2
Return Candidate(content=Content(parts=None, role='model'), finish_reason=STOP) — every time, across 10+ consecutive iterations
The failure was 100% reproducible in the agent context but did not reproduce reliably in minimal isolation tests, suggesting it is sensitive to the full conversation context (system instruction length, tool count, accumulated message history, or model load).
Confirmed workaround
Switching model from gemini-2.5-flash-lite to gemini-2.5-flash resolves the issue completely.
Apologies for the delay — I tried to put together a code snippet to reproduce the response from flash-lite, but I'm no longer able to replicate the issue on my end.
I'll go ahead and close this for now. If it comes up again I'll reopen with a proper reproduction case.
priority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responsetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
Venkaiahbabuneelam commentedon Jul 1, 2026
Hi @k-symmons, Thanks for reaching out us!
To help us understand the issue, could you please share a code snippet along with error logs of what you've tried so far?
Thanks
k-symmons commentedon Jul 2, 2026
Hi @Venkaiahbabuneelam
Apologies for the delay — I tried to put together a code snippet to reproduce the response from flash-lite, but I'm no longer able to replicate the issue on my end.
I'll go ahead and close this for now. If it comes up again I'll reopen with a proper reproduction case.
Sorry for the inconvenience.