Expose and persist image generation IDs (#57552)

## What changed

Expose the backend-provided `generationId` on image-generation items and preserve it through legacy completion events, thread history reconstruction, and rollout migration. Default missing IDs to `None` for older history.

Update the generated JSON schemas, TypeScript types, and Python models to include the nullable field.

## Testing

Extend coverage for ID serialization round trips, completed-item notifications, persisted and resumed history, and legacy rollout migration.

GitOrigin-RevId: a7f06faa7ac6833417b257a535d2901c03b79135
This commit is contained in:
jimxie-oai
2026-10-27 19:43:27 +00:00
committed by copyberry
parent aa854dabf5
commit 0d6838318f
36 changed files with 216 additions and 13 deletions
@@ -5558,6 +5558,13 @@ class FileIdThreadItem(BaseModel):
),
] = None
failure: ImageGenerationFailure | None = None
generation_id: Annotated[
str | None,
Field(
alias="generationId",
description="Image generation identifier for the generated image, when provided by the image backend.",
),
] = None
id: str
input_images: Annotated[
list[ImageGenerationInputImage] | None,
@@ -5593,6 +5600,13 @@ class ResultThreadItem(BaseModel):
),
] = None
failure: ImageGenerationFailure | None = None
generation_id: Annotated[
str | None,
Field(
alias="generationId",
description="Image generation identifier for the generated image, when provided by the image backend.",
),
] = None
id: str
input_images: Annotated[
list[ImageGenerationInputImage] | None,