Skip to content

Commit 0c40602

Browse files
committed
fix(google): restore session resumption opt-in on first connect
Always send sessionResumption: {} to opt in on first connect. The previous fix omitted it entirely when no handle existed, creating a deadlock where the server never enabled resumption tracking.
1 parent e937ec9 commit 0c40602

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.changeset/fix-gemini-31-live-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Two paths were broken with Gemini 3.1:
1010

1111
2. **`generateReply()`** — was using `sendClientContent` to trigger generation; Gemini 3.1 rejects this with "Request contains an invalid argument." Now uses `sendRealtimeInput({ text })` instead, which works across all Live API models.
1212

13-
Also fixes spurious empty `tools` and `sessionResumption` fields being sent in the session setup config when they have no values, which could cause rejections on strict model versions.
13+
Also fixes spurious empty `tools` field being sent when there are no declarations. Restores session resumption opt-in: always sends `sessionResumption: {}` on first connect (so the server enables tracking and sends `sessionResumptionUpdate` events), and includes the handle on subsequent connects.

plugins/google/src/beta/realtime/realtime_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ export class RealtimeSession extends llm.RealtimeSession {
12541254
outputAudioTranscription: opts.outputAudioTranscription,
12551255
sessionResumption: this.sessionResumptionHandle
12561256
? { handle: this.sessionResumptionHandle }
1257-
: undefined,
1257+
: {}, // empty object opts in to resumption on first connect
12581258
};
12591259

12601260
// Add generation fields at TOP LEVEL (NO generationConfig!)

0 commit comments

Comments
 (0)