Vertex AI Interactions API: the terminal `interaction.completed` event has no durable event id, breaking stream resume dedup

**Component:** Vertex AI — Gemini Interactions API (`aiplatform.googleapis.com/v1beta1/…/interactions`)

**Type:** Defect (upstream API behaviour)

**Live-verified:** 2026-10-21, direct to Vertex (no intermediary), project `gcp-sdet-test`, location `global`, model `gemini-3.8-flash`

## Summary

The final event of an Interactions event stream (`interaction.completed`) is delivered with a **synthesized placeholder id** (`0_unset_`) that is never persisted. Consequences:

1. **Unstable id across deliveries:** resuming from a durably stored id re-delivers `interaction.completed` with a *different* `event_id` than the client originally received (a fresh `0_unset_` on every delivery), so clients cannot recognize it as the same logical event by id.

2. **Non-exclusive resume:** resuming with `last_event_id` set to an `unset` id re-delivers the boundary event itself — under the *requested* id but with a *different payload* than originally delivered. Deterministic (4/4 runs).

Both violate standard SSE `Last-Event-ID` semantics (the client should receive only events *after* the last one it processed, with ids stable per logical event) and make id-based deduplication unreliable exactly where it matters most: reconnecting at the end of a stream.

## Event id format

Stream events carry an `event_id` JSON field of the form `v1_<base64url(seq_type_timestampMicros)>`, for example:

| event_id | decoded | event |

|—|—|—|

| `v1_MV90ZXh0XzE3OTI1NTQwMTk5OTg2MTc=` | `1_text_1792554019998617` | `step.delta` (durable) |

| `v1_MF91bnNldF8xNzkyNTU0MDIwMTg3NTk2` | `0_unset_1792554020187596` | `interaction.completed` (placeholder) |

The `interaction.completed` event is consistently the last id-carrying event of a stream and always carries an `unset` placeholder id.

## Steps to reproduce

1. `POST …/interactions` with `stream: true` and a short prompt (e.g. “Count from 1 to 5.”).

2. Parse the SSE `data:` payloads and note the `event_id` of the final `interaction.completed` event (`0_unset_`).

3. `GET /{id}?stream=true&last_event_id=` — observe the re-delivered `interaction.completed` carries `0_unset_`, `T1 ≠ T0` (symptom 1).

4. `GET /{id}?stream=true&last_event_id=0_unset_` — observe the stream contains `interaction.completed` with `event_id = 0_unset_` again, but a different payload than the original delivery (symptom 2).

5. Repeat step 4: the result is identical every time (deterministic).

## Observed vs expected (4 runs, same project/model, interaction confirmed `completed` before each resume)

| Resume point | Expected (SSE semantics) | Observed |

|—|—|—|

| Stored id (`1_text_`) | events strictly after ``; re-delivered events keep their ids | :white_check_mark: Exclusive (4/4) — but the re-delivered `interaction.completed` carries a **new** id `0_unset_<T0+~500µs>` each time (:cross_mark: symptom 1) |

| `unset` id (`0_unset_`) | events strictly after `` | :cross_mark: The boundary event **is re-delivered** (4/4, deterministic), carrying the **requested id** with a **different payload** (:cross_mark: symptom 2) |

## Payload difference (symptom 2 detail)

Same `event_id` (`0_unset_`) delivered twice with different bodies — the replayed event is reconstructed, not replayed from a log:

```json

// original delivery

{“interaction”:{“id”:“…”,“status”:“completed”,“usage”:{…},“role”:“model”,“created”:“…”,“updated”:“…”,“service_tier”:“standard”,“object”:“interaction”,…},“event_id”:“v1_MF91bnNldF8x…NzU5Ng”,“event_type”:“interaction.completed”}

// re-delivery on resume (same event_id, no “role” field, different key order)

{“interaction”:{“id”:“…”,“status”:“completed”,“usage”:{…},“service_tier”:“standard”,“object”:“interaction”,“model”:“…”},“event_id”:“v1_MF91bnNldF8x…NzU5Ng”,“event_type”:“interaction.completed”}

```

## Impact

- A client that reconnects right after receiving the final `interaction.completed` event — the exact scenario resume exists for — receives that event **again**, with the same id but different content.

- Deduplication by `event_id` is impossible for the terminal event: the same logical event surfaces under different ids across deliveries (symptom 1), and the same id surfaces with different payloads (symptom 2).

- No error is returned at any point; the inconsistency is fully silent.

## Suggested direction

Assign a durable id to the terminal `interaction.completed` event (and any other events currently delivered as `0_unset_`), so that `last_event_id` resume is exclusive and id-stable for every event on the stream.

## Reproduction notes

Verified with bare HTTPS requests (JWT-bearer service-account auth, `Authorization: Bearer `) against `https://aiplatform.googleapis.com/v1beta1/projects//locations/global/interactions\`; no SDK, no proxy layer, response bytes inspected directly. Each resume was issued only after `GET /{id}` confirmed the interaction was `completed`, ruling out resumption of a still-active stream. All probe interactions were deleted after the run.

Hello @Liangwen_Chen ,
For issues related to the Vertex API, please contact your sales representative if you have one. Otherwise, you can find more relevant assistance on the Google Cloud Forum.