Skip to content

fix(live): forward thinking config#5905

Open
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/live-thinking-config-forwarding
Open

fix(live): forward thinking config#5905
he-yufeng wants to merge 1 commit into
google:mainfrom
he-yufeng:fix/live-thinking-config-forwarding

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • forward GenerateContentConfig.thinking_config into LiveConnectConfig before opening Gemini live sessions
  • keep existing live_connect_config.thinking_config untouched when the request config has no thinking config
  • add a regression test for Gemini.connect()

Fixes #5805.

To verify

  • $env:PYTHONPATH=(Resolve-Path src).Path; python -m pytest tests\unittests\models\test_google_llm.py -q
  • $env:PYTHONPATH=(Resolve-Path src).Path; python -m py_compile src\google\adk\models\google_llm.py tests\unittests\models\test_google_llm.py
  • python -m pyink --check src\google\adk\models\google_llm.py tests\unittests\models\test_google_llm.py
  • git diff --check

Note: pylint on the full google_llm.py module still reports pre-existing warnings unrelated to this change, so I did not treat that as a blocker.

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

adk-bot commented May 30, 2026

Response from ADK Triaging Agent

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

This PR looks great and has a clear explanation and associated issue. To help the reviewers merge your PR more efficiently, could you please provide the following information as per our contribution guidelines:

  • Summary of passed pytest results: Please run the tests locally and paste a summary of the successful test runs (e.g., pytest tests/unittests/models/test_google_llm.py).
  • Logs or screenshot demonstrating the fix: Since this is a bug fix for live session connection configs, providing logs showing the successful session establishment with the forwarded thinking_config would be very helpful.

Thank you for your contribution!

@he-yufeng he-yufeng force-pushed the fix/live-thinking-config-forwarding branch from c295c81 to 77138dd Compare June 4, 2026 04:50
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased this onto current main and reran the focused model tests locally.

Pytest summary:

PYTHONUTF8=1 PYTHONPATH=src uv run pytest tests\unittests\models\test_google_llm.py -q --basetemp .tmp\pytest-5905-20260604c -p no:cacheprovider
# 62 passed, 7 warnings in 3.12s

I also ran the file-level checks:

uv run ruff check src\google\adk\models\google_llm.py tests\unittests\models\test_google_llm.py
uv run pyink --check src\google\adk\models\google_llm.py tests\unittests\models\test_google_llm.py
python -m py_compile src\google\adk\models\google_llm.py tests\unittests\models\test_google_llm.py
git diff --check

For the live-session evidence, I used a mocked live client so no real API key or network call was needed. The captured call into aio.live.connect showed the request-level thinking config being copied into the live config:

live.connect called: True
forwarded thinking_config: include_thoughts=None thinking_budget=128 thinking_level=None
same object: True

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.

thinking_config silently ignored in Runner.run_live() for streaming models

2 participants