fix(live): history_config rejection on Vertex/Enterprise Live sessions
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Problem:
On the Vertex AI / Gemini Enterprise Agent Platform backend, ADK auto-injects history_config into the Live setup message when seeding conversation history. That backend has no history_config field and rejects it with ValueError: history_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode
Solution:
Gate the history_config auto-injection to the Gemini Developer API backend only (isinstance(llm, Gemini) and llm._api_backend == GoogleLLMVariant.GEMINI_API). On Vertex, history is already seeded via the sanctioned send_history (send_client_content) path.
Testing Plan
Unit Tests:
- [X] I have added or updated unit tests for my change.
- [X] All unit tests pass locally.
$ pytest tests/unittests/flows/llm_flows/test_base_llm_flow.py -k history_config 2 passed, 35 deselected, 4 warnings in 0.78s
Manual End-to-End (E2E) Tests:
Verified intended functionality in ADK web.
Checklist
- [X] I have read the CONTRIBUTING.md document.
- [X] I have performed a self-review of my own code.
- [X] I have commented my code, particularly in hard-to-understand areas.
- [X] I have added tests that prove my fix is effective or that my feature works.
- [X] New and existing unit tests pass locally with my changes.
- [X] I have manually tested my changes end-to-end.
- [X] Any dependent changes have been merged and published in downstream modules.
Additional context
N/A
I have completed the read-only triage and architectural analysis of Pull Request #6035.
The Google CLA signature is verified successfully, and all background tests run clean. I have generated a premium, detailed analysis of the changes, their justification, and alignment with ADK's design patterns.
Please find the complete review here: 👉 analysis_results.md
Key Highlights & Recommendation:
- The Bug: ADK was auto-injecting
history_configduring Live setup initialization on Vertex AI / Gemini Enterprise Agent Platform. However, this backend doesn’t recognize that configuration field and rejected the setup message completely with aValueError. - The Fix: Successfully limits
history_configgeneration strictly to the Gemini Developer API backend (base_llm_flow.py). History configuration on Vertex continues to seamlessly flow through the standardsend_historyrouting. - Testing quality: High quality behavioral tests have been added to verify that history initialization remains skipped on the Vertex backend while operating flawlessly on the Gemini Developer API backend.
- Recommendation: Approve (excellent, robust, and style guidelines-compliant fix).
Hi @allen-stephen, Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share.
Hi @GWeale , can you please review this.
thanks for opening this PR! We are aware of the issue, and live API team is getting this addressed soon by adding support for history_config in Vertex AI. It should be available in the next day or so
Thank you @allen-stephen for your contribution! 🎉
Your changes have been successfully imported and merged via Copybara in commit 8f85260.
Closing this PR as the changes are now in the main branch.