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.