Google_search grounding drops the beginning of the response text (Gemini 3.5/3.6 Flash) - JSON output starts mid-sentence

When calling v1beta/models/gemini-3.6-flash:generateContent with tools: [{“google_search”: {}}] and a prompt
requesting a JSON array, the response text is frequently missing its beginning: candidates[0].content.parts contains a
single text part (thought: false) whose text starts mid-sentence, partway through the first array element — e.g. it
begins with “. Massive reactions from stars like Kevin Durant are fueling…”. The opening bracket and most of the
first object are absent, so the JSON is unparseable.

Key observations:

  • finishReason is STOP (not MAX_TOKENS), groundingMetadata is present, maxOutputTokens: 8192 far from exhausted.
  • Reproduced on gemini-3.6-flash (4/5 runs) and gemini-3.5-flash (1/3 runs, plus 1/3 runs silently skipping
    grounding). Same prompt on gemini-2.5-flash: 0/5 failures.
  • Happens both with fence-free plain output and with responseMimeType: application/json + responseJsonSchema
    (structured output does not prevent it).
  • Frequency correlates with citation-heavy news topics (NBA news, finance news ~75-100% repro); a low-news science
    niche mostly passed.
  • The truncation boundary always lands at what looks like a grounding-citation segment boundary — as if the first
    grounded text segment(s) were dropped from parts during response assembly.

Repro: prompt is a generic “research trending topics, return a JSON array of 5 objects” template with google_search
enabled (full prompt + 2 complete raw request/response JSON pairs attached). Temperature both set (0.9) and omitted —
no effect.

Hi

Can you try performing Google Search retrieval in the first call to gather grounded context, then pass that context to a second call formatted as structured JSON without search tools ?

More details on configuring search grounding and structured outputs, can we be found here : ai.google.dev/gemini-api/docs/grounding.

Hey Mustan, ty for the reply.
Your suggestion of splitting it into 2 calls works.
While obviously it has the overhead of extra cost/latency due to it.

I just wonder as gemini-2.5-flash was able to do both on a single prompt with no issues, is that limitation by design or pending to be fixed on gemini 3.5/6-flash

Thanks, Ben