Commit 08209ee
feat: ADK 1.19/2.0 cross-version regression suite + lazy-import compat fixes (#559)
* update new feature and enhancement for log
* 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>
* chore: add Apache-2.0 header to adk_compat.py and apply ruff format
- Add the missing license header to veadk/utils/adk_compat.py so the
license-header-check CI passes.
- Reformat the new compat test files and eval_set_recorder.py with
ruff-format (v0.11.12) so the pre-commit CI passes.
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: fangyaozheng@bytedance.com <fangyaozheng@bytedance.com>1 parent 4bfdcf5 commit 08209ee
14 files changed
Lines changed: 1051 additions & 52 deletions
File tree
- tests
- veadk
- evaluation
- integrations/ve_identity
- memory/short_term_memory_backends
- models
- tracing/telemetry/attributes/extractors
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
0 commit comments