Skip to content

fix: preserve live session transparency#5773

Open
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/live-reconnect-preserve-transparent
Open

fix: preserve live session transparency#5773
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/live-reconnect-preserve-transparent

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • stop forcing session_resumption.transparent = True when run_live() reconnects with a saved handle
  • keep the saved resumption handle on reconnect while preserving the caller's transparent/basic resumption choice
  • extend the existing resumption test to assert the reconnect request does not silently enable transparent mode

To verify

  • .\.venv\Scripts\python.exe -m pytest tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_reconnects_on_connection_closed tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_reconnects_on_api_error tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_skips_send_history_on_resumption tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_live_session_resumption_go_away tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_no_reconnect_without_handle tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_reconnect_limit tests\unittests\flows\llm_flows\test_base_llm_flow.py::test_run_live_reconnect_reset_attempt -q
  • .\.venv\Scripts\python.exe -m pyink --check src\google\adk\flows\llm_flows\base_llm_flow.py tests\unittests\flows\llm_flows\test_base_llm_flow.py
  • .\.venv\Scripts\python.exe -m py_compile src\google\adk\flows\llm_flows\base_llm_flow.py tests\unittests\flows\llm_flows\test_base_llm_flow.py
  • git diff --check

Fixes #5771

@adk-bot adk-bot added the live [Component] This issue is related to live, voice and video chat label May 20, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 20, 2026

Response from ADK Triaging Agent

Hello @he-yufeng, thank you for creating this PR!

We appreciate your contribution to fixing the live session transparency issue. To help our reviewers process your PR faster, could you please provide the following details in accordance with our Contribution Guidelines:

  • Summary of Passed Pytest Results: Please run the commands in your "To verify" section and paste the summary of passed test results in your PR description.
  • Logs or Verification Evidence: For bug fixes, please include the console logs or output showing the behavior after the fix is applied.

This information will help reviewers verify and merge your PR more efficiently. Thank you!

@rohityan rohityan assigned rohityan and unassigned rohityan May 20, 2026
@he-yufeng he-yufeng force-pushed the fix/live-reconnect-preserve-transparent branch from 85be979 to d5ee97c Compare May 21, 2026 04:33
@he-yufeng
Copy link
Copy Markdown
Author

Rebased onto current main and re-ran the focused validation.

Local results on the branch:

  • python -m pytest tests/unittests/flows/llm_flows/test_base_llm_flow.py -q --basetemp .tmp/pytest-5773 -> 28 passed, 1 warning
  • python -m py_compile src/google/adk/flows/llm_flows/base_llm_flow.py tests/unittests/flows/llm_flows/test_base_llm_flow.py -> passed
  • python -m pyink src/google/adk/flows/llm_flows/base_llm_flow.py tests/unittests/flows/llm_flows/test_base_llm_flow.py --check -> passed
  • git diff --check -> passed
  • EOF / whitespace / isort / addlicense / new-Python-file-prefix checks on the touched files -> passed

Note: the full local pre-commit runner on Windows cannot execute the repo's bash-based check-new-py-prefix hook through /bin/bash, so I ran that script directly through Git Bash for the touched files. The GitHub Linux runner should exercise the normal pre-commit path after this push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live [Component] This issue is related to live, voice and video chat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: run_live() forces session_resumption.transparent=True on reconnect, breaking Gemini Developer API session resumption

4 participants