Skip to content

[Bug]gemini-2.5-flash-lite intermittently returns empty STOP response after function call #2667

Closed as not planned

Description

@k-symmons

Description

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:

  1. Correctly generate a function_call on turn 1
  2. Receive the function result on turn 2
  3. Return Candidate(content=Content(parts=None, role='model'), finish_reason=STOP) — every time, across 10+ consecutive iterations
Prompt tokens: 576
Response tokens: None        # candidates_token_count is None
finish_reason: STOP
content.parts: None
response.text: None

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.

Environment

  • google-genai version: 1.12.1
  • Python: 3.13
  • Failing model: gemini-2.5-flash-lite
  • Working model: gemini-2.5-flash

Related

Activity

  1. added
    type: bug
    priority: p2
    on Jun 30, 2026
  2. Venkaiahbabuneelam commented on Jul 1, 2026

    @Venkaiahbabuneelam

    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

  3. k-symmons commented on Jul 2, 2026

    @k-symmons
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

priority: p2status:awaiting user responsetype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions