Bind GPT Image 2.5 partial and final events to the current image-job revision

An image job can finish after the user has changed the brief. For a GPT Image 2.5 integration, accepting that late result as current would attach a valid image to the wrong request. Bind each request and every accepted event to an application-owned job revision before starting it.

The upstream image-generation guide, captured on 9 September 2026, documents partial_images values from 0 to 3. Zero requests only the final image; positive values may produce fewer partials than requested if generation finishes sooner. Its Image API example uses gpt-image-2.5-sunburst, stream: true, and partial_images: 2, then handles image_generation.partial_image with partial_image_index and b64_json. A count of partials is therefore unsuitable as the completion signal.

Put the CometAPI adapter behind an explicit check

CometAPI’s GPT Image 2.5 page documents gpt-image-2.5-sunburst at https://api.cometapi.com/v1/images/generations. That binds the model and route to check. Its sample does not establish that this route forwards the upstream streaming fields, event names or cancellation behavior.

For this CometAPI integration, I would keep partial-event handling disabled until the adapter has verified the selected route’s acceptance of stream and partial_images, its partial payloads, and its terminal success/error signals. If only ordinary generation is verified, retain the same revision check when its final response arrives. Do not assume that changing the base URL turns the upstream streaming example into a verified gateway contract.

The following is a proposed application policy, not a record of executed CometAPI tests. “Partial” and “final” describe normalized application events; the adapter must map them from the route’s verified response format.

Request or event Rule for the current job revision If the revision has been superseded
partial_images: 0 Expect no partials on a successful upstream stream; wait for terminal success or failure Suppress the late result from the current brief
partial_images: 1 Accept an available partial provisionally; do not require one before terminal success Ignore its partial and terminal events for current state
partial_images: 2 Accept available partials; terminal success remains valid with fewer than two Apply the same stale-revision check
partial_images: 3 Accept available partials; do not wait for a third after terminal success Apply the same stale-revision check
Final arrives after fewer partials than requested Complete only this current revision; stop waiting for missing partials Keep it out of the replacement revision
User interrupts locally Mark the revision inactive immediately, before starting replacement work Suppress subsequent events even if the remote request continues

Store the job ID and revision in local request context; do not invent an API parameter or expect the provider to echo them. Before mutating application state, compare the event’s locally bound revision with the current revision. Make the comparison and update one serialized operation so an interruption cannot slip between them. After a revision is terminal, ignore any later partial that would reopen it.

For example, a voice application could turn an updated spoken brief into a new text prompt and revision. The image stage remains separate: this design does not require or imply audio input support from GPT Image 2.5. A final image belonging to the old brief stays old even if it arrives after the replacement request starts.

Local suppression establishes only what the application accepts. It does not prove that CometAPI or the upstream provider cancelled generation, stopped billing, or released resources. Record any remote cancellation outcome separately if that capability is later verified. The proposed acceptance check is straightforward: an obsolete partial or final must never change the current revision, while a current final must not wait for an unfulfilled partial count.

I would separate stale events received from stale events applied in the acceptance check. The first can be an expected consequence of superseding a job without confirmed remote cancellation; the second is a correctness failure. A single “discarded image” counter would obscure that distinction.

For the GPT Image 2.5 adapter, the upstream streaming guide makes one monitoring choice particularly important: partial_images can be zero, and generation can finish with fewer partials than requested. Do not alert on a partial-count shortfall or use partial arrival as the required heartbeat. The cited gpt-image-2.5-sunburst example is upstream evidence, not proof that the CometAPI generation route forwards that stream.

My proposed runbook, after route-specific event mapping is verified:

  • Record a local job/revision identifier, requested partial count, elapsed time, normalized event kind, and disposition: applied, suppressed as stale, or suppressed after terminal state. Keep prompts and image payloads out of these diagnostic records.
  • Exercise a controlled interleaving: supersede revision A with B, then deliver A’s final while B is active. A suppressed final should increment the stale-received signal without altering B. Also deliver a current final with fewer partials than requested; it should complete without a missing-preview alarm.
  • Treat any obsolete revision changing current state as a stop condition for enabling this adapter path. Escalate with the sanitized event sequence and inspect the revision comparison/state-update boundary. A high suppression rate alone calls for investigation of supersession frequency and completion timing, not an inference that cancellation is broken.

These are proposed instrumentation and fault-injection checks, not measured results. They distinguish a working revision guard from a quiet dashboard that simply never noticed an incorrect state update.