Skip to content

Commit b90c6a2

Browse files
tianttclaude
andcommitted
feat: add ADK 1.19/2.0 cross-version regression suite and lazy-import compat fixes
Adds a 44-test regression suite targeting every veadk↔ADK seam where 1.19 and 2.0 differ, and fixes two compat bugs the suite caught when run against ADK 2.0. New tests (tests/test_adk_compat_regression.py) ----------------------------------------------- - A. Direct coverage of every public helper in veadk.utils.adk_compat that test_adk_compat.py didn't already exercise (get_adk_version, is_adk_gte, should_use_async_db_drivers, llm_request_has_field, plus the getter path for get_event_function_responses). - B. Edge cases for the event extractors: parts=None / empty / mixed, no content, broken getters falling back to part traversal. - C. Integration against real ADK Event / Content / Part objects so we notice if ADK silently changes its public surface. - D. Agent.run override gated by is_adk_gte("2.0.0") (skipped on v2 by design; verifies NotImplementedError still surfaces on v1). - E. ArkLlm version-branching: ImportError when LlmRequest lacks previous_interaction_id; get_previous_interaction_id on real LlmRequest. - F. tool_attributes_extractors fallback variants (model_dump path, empty sentinel, attribute object, missing attrs). - G. Runner.intercept_new_message integration with a synthetic LLM: session_service is InMemorySessionService for local STM, create_session contract, end-to-end yield, None-event filtering, part.text=None tolerance. - H. ADK public-surface assumptions (version module, LlmRequest.model_fields, Event.get_function_calls/responses). Compat fixes caught by running the suite under ADK 2.0 ------------------------------------------------------ - veadk/agent.py: gate the legacy Agent.run NotImplementedError override on `not is_adk_gte("2.0.0")`. ADK 2.0 promotes BaseAgent.run to a @Final async generator that the Workflow/NodeRunner engine invokes internally; overriding it breaks workflow execution. - veadk/utils/patches.py: walk `mod.__dict__` instead of `dir(mod)` + `getattr` when patching tracers across google.adk.* modules. ADK 2.0's `google.adk.tools` package defines `__getattr__` for lazy submodule loading; the old dir+getattr pattern triggered every lazy module, including optional ones like discovery_engine_search_tool that need google-cloud-* deps veadk doesn't ship. - veadk/evaluation/eval_set_recorder.py: defer the `from google.adk.cli.utils import evals` import to the call site. ADK 2.0 has that module top-import gcs_eval_set_results_manager unconditionally, which requires google-cloud-storage — needlessly tainting any veadk caller who only imports veadk.Runner. Regression results ------------------ Both versions show identical counts; each skips exactly the one test that doesn't apply to its API surface (the suite is symmetric across versions): * ADK 1.19.0: 195 passed + 1 skipped (skip: test_get_previous_interaction_id_with_real_llm_request — v1 LlmRequest lacks previous_interaction_id) * ADK 2.0.0: 195 passed + 1 skipped (skip: test_agent_run_raises_notimplemented_on_legacy_adk — override is removed on v2 by design) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 55b4d59 commit b90c6a2

4 files changed

Lines changed: 703 additions & 11 deletions

File tree

0 commit comments

Comments
 (0)