Gemini API Bug Report: Empty Responses with STOP Status
Date: 2025-12-23
Models Tested: gemini-3-flash-preview, gemini-3-pro-preview, gemini-2.5-pro
Dataset: (100 videos, 5 runs per model)
Summary
gemini-3-pro-preview occasionally returns finishReason: STOP (indicating success) but produces only thinking/reasoning output without the actual JSON response. The model’s internal state believes it generated the output, but the actual candidate output is missing.
Affected Model
- gemini-3-pro-preview: 5 failures out of 500 requests (1% failure rate)
Evidence
Failed Videos (gemini-3-pro-preview, Run 5)
| Video ID |
finishReason |
candidatesTokenCount |
thoughtsTokenCount |
totalTokenCount |
| 7IPW7 |
STOP |
null |
5,099 |
14,028 |
| XOOPP |
STOP |
null |
3,889 |
11,836 |
| Y79PC |
STOP |
null |
2,834 |
11,835 |
| WISO0 |
STOP |
null |
6,401 |
16,021 |
| BIQGN |
STOP |
null |
4,149 |
13,256 |
Response Structure
All failed responses have the same pattern:
{
"candidates": [{
"content": {
"parts": [
{"text": "**Thinking header**\n\n<reasoning about JSON>..."},
{"text": "**Another thinking header**\n\n<more reasoning>..."}
],
"role": "model"
},
"finishReason": "STOP"
}],
"usageMetadata": {
"promptTokenCount": 9000,
"candidatesTokenCount": null, // <-- BUG: No output tokens
"thoughtsTokenCount": 5000,
"totalTokenCount": 14000
}
}
Example Thinking Output (Y79PC)
The model’s thinking text claims success but no JSON is produced:
Part 0:
“I’ve crafted detailed descriptions for each video, focusing on visual elements like the woman’s actions, clothing, and the room’s decor. Refining the descriptions now; ensuring comprehensive detail… The final JSON structure, complete with precise timestamps, is now prepared for its final review.”
Part 1:
“I’ve checked the JSON format, ensuring all fields are correctly formatted and adhering to the specifications. Descriptions are detailed, the start and end times match the intended moments, and it is complete, passing all the final checks. The final JSON is ready.”
Despite claiming “The final JSON is ready”, no JSON was actually emitted.
Request Configuration
- Thinking enabled:
{"includeThoughts": true}
- Response MIME type:
application/json
- Response schema: Yes, structured JSON schema provided (type: OBJECT with nested ARRAY of OBJECTs, 7 required fields per item including STRING and INTEGER types)
- Temperature: 1.0
- Max output tokens: 65536
Note: JSON schema was verified to be correctly included in all batch requests.
Conclusion
The bug appears to be a model-level issue where:
- The thinking process completes normally
- The model believes it has generated the final output
- But the actual JSON response is never emitted to the output
finishReason incorrectly reports STOP instead of indicating a failure
candidatesTokenCount is null, confirming no actual output was generated
This issue was observed only in gemini-3-pro-preview, not in gemini-2.5-pro or gemini-3-flash-previewfor this dataset.
This is what a successful example looks like:
Successful Response
| Field | Value |
|----------------------|-------------------------------------------|
| finishReason | STOP |
| candidatesTokenCount | 478 (has value!) |
| thoughtsTokenCount | 3,844 |
| Part 0 | Thinking text (333 chars) |
| Part 1 | Actual JSON starting with { (1,695 chars) |