From d330f1a2daf571c00ac49dd14fa5382c692f0c39 Mon Sep 17 00:00:00 2001 From: Anshaj Kumar Date: Thu, 21 May 2026 21:25:50 +0530 Subject: [PATCH] fix(cli): lazy-import GCS deps so `adk web` works without google-cloud-storage The `DevServer` import chain unconditionally imported `gcs_eval_set_results_manager` and `gcs_eval_sets_manager` at module level, which require `google-cloud-storage`. This caused `adk web` to silently fall back to `ApiServer` on a fresh `pip install google-adk`, leaving the dev UI unreachable. Fix: move GCS imports behind `TYPE_CHECKING` for type annotations and lazy-import inside `create_gcs_eval_managers_from_uri()` where they are actually needed. Also add `python-multipart` to core dependencies since it is required for Builder UI endpoints in `adk web`. Fixes #5787 --- tests/unittests/cli/utils/test_evals.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unittests/cli/utils/test_evals.py b/tests/unittests/cli/utils/test_evals.py index 071feb1e2d..a09837a12d 100644 --- a/tests/unittests/cli/utils/test_evals.py +++ b/tests/unittests/cli/utils/test_evals.py @@ -61,3 +61,10 @@ def test_create_gcs_eval_managers_from_uri_success( def test_create_gcs_eval_managers_from_uri_failure(): with pytest.raises(ValueError): evals.create_gcs_eval_managers_from_uri('unsupported-uri') + + +def test_evals_module_does_not_import_gcs_at_module_level(): + """GCS classes should be lazy-imported, not at module level.""" + module_globals = vars(evals) + assert 'GcsEvalSetResultsManager' not in module_globals + assert 'GcsEvalSetsManager' not in module_globals