Skip to content

Batch API arrays in JSON requests of JSONL batch request file are overwritten to empty arrays in JSONL results #513

@nikolaydubina

Description

@nikolaydubina

we observe that requests submitted to Batch API through JSON files get their array fields set by user overwritten to empty arrays

request JSONL file we trigger batch job with:

Image
{
    "id": "ac28c5e3-4343-4979-a95c-85d1007279c3",
    "product_id": "bamv6jcclawoo",
    "image_candidates": [
        "c744f8d2-a0b8-4cbb-9a62-2582d0bd40e8",
        "d6436c35-ddc1-4662-b45f-c7672de2140e"
    ],
    "request": {
        "model": "gemini-2.5-flash",
        "contents": [
.....

in output JSON file we get

{                                                                                                                                                                                                                         
  "image_candidates": [],                                                                                                                                                                                                 
  "product_id": "bamv6jcclawoo",                                                                                                                                                                                          
  "id": "ac28c5e3-4343-4979-a95c-85d1007279c3",                                                                                                                                                                           
  "status": "",                                                                                                                                                                                                           
  "processed_time": "2025-09-12T10:20:34.175+00:00",                                                                                                                                                                      
  "request": {                                                                                                                                                                                                            
    "contents": [             

user data for plain fields is getting preseved, but arrays are reset to empty. what makes it worse, there are no errors or warnings. there is no errors before we validate and submit job. there are no error or warning logs in GCP Console. it is silent data corruption.

please fix error, or block requests that have this. or have some warnings. it is very easy to loose data. and hard to debug this.

Metadata

Metadata

Labels

api:gemini-apiIssues related to Gemini APIpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions