Repository navigation
fix(google-adk): support GenAI 2.x and modular tracing - #270
Closed
jabrailkhalil wants to merge 3 commits into
Closed
jabrailkhalil wants to merge 3 commits into
jabrailkhalil wants to merge 3 commits into
Conversation
3 tasks done
Contributor
Author
|
I checked #445 on current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #269. Supports GenAI 2.x alongside 1.x and the modular tracing layout in Google ADK 2.12. Normal installation with ADK 2.7.1 currently fails dependency resolution; with ADK 2.12, supplying dependencies still leaves
instrument()failing on the removedbase_llm_flow.trace_call_llmbinding.Why?
Agent Learning Kit's hosted image already works around the dependency conflict with
--no-deps. The adapter should install and trace a supported ADK through ordinary dependency resolution.google-genai>=1,<3; Poetry 2.0.1 refreshed only the lock content hash, preserving existing locked versions.start_span()handling to passthrough/selective tracers so SDK cleanup cannot end an outer wrapper's recording span; tool spans still use the configured provider.How was it tested?
Linux CI and complete artifacts check out
208329d3dec4d8c51d5255332e43e479967b6fffdirectly and cover:Four new integration cases use real
LlmAgent,InMemoryRunner, function tools and OTel spans with a scripted local model. They cover single/parallel tool calls, model errors, tool-result delivery, token usage, span counts/correlation and exact uninstrumentation. Two additional cases check passthrough span ownership. The existing 20 Google ADK tests run alongside them.The legacy mock-only tests now restore their singleton overrides with
monkeypatch; CI runs them before the real integration cases to check test isolation.Both GenAI 2.x jobs reproduce the original dependency-resolution failure; the 1.x job is a passing control.
Restoring the original adapter while keeping the new tests produces failures; each before/after report is included.
pip check, wheel build, Ruff correctness checks, Black and Mypy 1.18.2 pass in all three jobs.Local Windows / Python 3.12 / ADK 2.12.0 / GenAI 2.31.0 also passes all 26 tests.
poetry check --lockpasses with existing metadata deprecation warnings.A local composition of this patch with fix(google-adk): preserve async stream lifecycle and tracing context #268 passes all 52 Google ADK tests on ADK 2.12.0 / GenAI 2.31.0, with the legacy tests running first.
Unit and offline integration tests added.
README and changelog updated.
Branch off
main; conventional commits; no API keys, TODOs or commented-out code.Notes for reviewers
Related #268 handles stream lifecycle. This PR changes dependency and tracing setup compatibility. The adapter still hooks ADK's internal tracing bindings; future SDK reorganizations may need another compatibility update. Live Gemini/provider calls were not tested. No release/version bump is included.
Implementation and regression tests written with an OpenAI assistant under my supervision.