Repository navigation
Bug: run_live() forces session_resumption.transparent=True on reconnect, breaking Gemini Developer API session resumption #5771
Description
Summary
google-adk live reconnect logic appears to unconditionally force session_resumption.transparent = True when reconnecting with a saved session resumption handle.
This breaks Gemini Developer API live sessions, because Gemini Developer API supports session resumption, but does not support transparent session resumption.
As a result, a valid RunConfig(session_resumption=types.SessionResumptionConfig()) setup for Gemini Developer API fails on reconnect with:
ValueError: Transparent session resumption is only supported for Vertex AI backend. Please use Vertex AI backend.
Expected behavior
If the app enables basic session resumption with:
RunConfig(
session_resumption=types.SessionResumptionConfig()
)then ADK should reconnect using the saved handle without forcing transparent mode for Gemini Developer API backends.
Expected behavior:
- Gemini Developer API live session starts normally
- resumption handles are received
- reconnect uses the handle
- reconnect preserves
transparent=None/ unset - session resumes successfully across the ~10 minute connection limit
Actual behavior
On reconnect, ADK mutates the reconnect config and sets:
llm_request.live_connect_config.session_resumption.transparent = TrueThat causes reconnect to fail for Gemini Developer API with:
ValueError: Transparent session resumption is only supported for Vertex AI backend. Please use Vertex AI backend.
Relevant implementation detail
This appears to come from the live reconnect path in base_llm_flow.py, which sets transparent=True once a resumption handle exists.
Related implementation:
- live session resumption implementation commit:
71fbc9275b3d74700ec410cb4155ba0cb18580b7
From that implementation, reconnect logic includes:
if invocation_context.live_session_resumption_handle:
...
llm_request.live_connect_config.session_resumption.handle = (
invocation_context.live_session_resumption_handle
)
llm_request.live_connect_config.session_resumption.transparent = TrueLater, Gemini.connect() rejects this for Gemini API backends.
Why this seems incorrect
Gemini Developer API and Gemini Enterprise/Vertex do not have identical support here:
- Gemini Developer API: supports session resumption
- Gemini Developer API: does not support transparent session resumption
- Enterprise/Vertex: supports transparent session resumption
ADK seems to assume that reconnect should always use transparent mode, which is too aggressive for Gemini Developer API.
Minimal reproduction
Environment:
google-adk: 1.34.0- Python: 3.14
- Live model on Gemini Developer API
- Offline models on Gemini Enterprise/Vertex (not directly relevant to bug)
Live agent:
from google.adk.agents import Agent
from google.adk.models import Gemini
agent = Agent(
name="live_agent",
model=Gemini(model="gemini-3.1-flash-live-preview"),
instruction="You are a helpful live assistant.",
)Run config:
from google.adk.agents import RunConfig
from google.genai import types
run_config = RunConfig(
input_audio_transcription=types.AudioTranscriptionConfig(),
output_audio_transcription=types.AudioTranscriptionConfig(),
session_resumption=types.SessionResumptionConfig(),
)Then run through Runner.run_live(...) and wait for a reconnect path or trigger a reconnect after a resumption handle has been issued.
Error
ValueError: Transparent session resumption is only supported for Vertex AI backend. Please use Vertex AI backend.
Suggested fix
One of these would resolve it cleanly:
- Preserve the original
SessionResumptionConfig.transparentvalue on reconnect instead of overwriting it. - Only force
transparent=Truewhen backend is Enterprise/Vertex. - Add a public reconnect policy/config option so applications can opt out of forced transparent resumption.
Workaround
We worked around this application-side by wrapping Gemini.connect() and clearing session_resumption.transparent for Gemini Developer API reconnects while preserving the resumption handle.
That suggests the underlying session-resumption flow is otherwise valid; the incompatible part is specifically the forced transparent mode.
Activity
llalitkumarrr commentedon May 22, 2026
Hello @smetanokr ,
Just to clarify, were you able to resolve your issue with the workaround you shared? Also, could you please take a look at the associated PR and let us know if it helps?
smetanokr commentedon May 22, 2026
yes , i am able to workaround it by creating custom LiveGemini class:
and then using it as model attribute for Agent
ill try to test PR and let you know.
smetanokr commentedon May 22, 2026
@llalitkumarrr , i can confirm that with "fix: preserve live session transparency #5773" applied at top of main branch i was able to have 17minutes long session with gemini-3.1-flash-live-preview using google developer api without any error in log
llalitkumarrr commentedon May 25, 2026
Hello @smetanokr ,
Thank you for your inputs, the PR is currently under review. We appreciate your patience while we review it. Thank you for understanding.
GWeale commentedon Aug 6, 2026
fixed in v2.2.0 by 5ad1942, the live reconnect path now only sets session_resumption.transparent on the vertex backend and only when you left it unset, so developer api sessions reconnect fine.