Product: Gemini Developer API (API key, paid tier), Live API over WebSocket, v1beta
Model: gemini-3.8-live
Client: Python, pipecat-ai 1.9.0 on google-genai
Session config: response_modalities AUDIO; context_window_compression with sliding_window and trigger_tokens=7000; session_resumption enabled; history_config.initial_history_in_client_content=true; input and output audio transcription; 7 function declarations; model-owned turn taking.
What happens
We run a voice app with long continuous audio sessions. Every session that has reached one hour is closed by the server at exactly 58:00 after the WebSocket connected, with:
1011 (internal error) Deadline expired before operation could complete.
| Date (UTC) | Connected | Closed with 1011 “Deadline expired” | Elapsed |
|---|---|---|---|
| 2026-09-29 | 12:21:01.905 | 13:19:01.912 | 58:00.007 |
| 2026-09-30 | 00:30:03.387 | 01:28:03.398 | 58:00.011 |
| 2026-10-01 | 14:09:34.965 | 15:07:34.963 | 57:59.998 |
In each case the same single connection stayed open for the whole period; there were no earlier closes or reconnects. Our client sets no timeout or deadline (only the x-goog-api-client header). Context window compression is on, so we expected the session to be unlimited, as documented.
What happens after the close
We reconnect with the latest session resumption handle:
- 2026-09-29: the resumed session worked.
- 2026-09-30: the resume was rejected within 0.35 s with
1007 (invalid frame payload data) Request contains an invalid argument.; the next handle got1011 Internal error encountered.; a fresh session (history re-sent via client content) then worked. - 2026-10-01: the resume was accepted, but the first response took 22 s and the connection was closed 75 s later with the same 1007. Each following handle got
1011 Internal error encountered.Every fresh session we then opened (history re-sent via client content) took 16 to 22 s to start its first response and was closed with 1007 within 20 to 45 s, six times in a row.
We could not reproduce the 1007 with synthetic history (tool-call turns, up to about 75k tokens, compression on and off, live audio), so we cannot tell which argument is rejected.
Minimal reproduction
A standalone reproduction is running now: a single google-genai connection to gemini-3.8-live (compression with trigger_tokens=7000, session resumption on, no tools), sending 16 kHz PCM silence plus a short spoken clip every 60 s, logging any go_away and the close. I will post the result and the script as a reply when it finishes.
Questions
- Is 58 minutes a hard lifetime for gemini-3.8-live Live sessions, even with context window compression and session resumption? If so, can it be documented (and is a go_away sent before it)?
- Should a session resumption handle be valid after this close? Resuming gives either 1007 immediately or a session that dies with 1007 shortly after.
- On 2026-10-01, which argument triggered “Request contains an invalid argument” on fresh sessions seeded with prior history? Could the 1007 close reason name the offending field?