Skip to content

fix(cli): lazy-import GCS deps so adk web works without google-cloud-storage#5789

Open
mangod12 wants to merge 1 commit into
google:mainfrom
mangod12:fix/dev-server-missing-deps
Open

fix(cli): lazy-import GCS deps so adk web works without google-cloud-storage#5789
mangod12 wants to merge 1 commit into
google:mainfrom
mangod12:fix/dev-server-missing-deps

Conversation

@mangod12
Copy link
Copy Markdown

Summary

  • Lazy-import GCS modules in google.adk.cli.utils.evals so DevServer imports successfully without google-cloud-storage installed
  • Add python-multipart to core dependencies since it's required for Builder UI endpoints in adk web

Root cause

evals.py unconditionally imports GcsEvalSetResultsManager and GcsEvalSetsManager at module level. These modules import google.cloud.storage, which is only declared under [gcp]/[all]/[test] extras. Since dev_server.py imports evals, a fresh pip install google-adk causes DevServer to fail to import, silently falling back to ApiServer — leaving the dev UI at /dev-ui/ unreachable (404).

Changes

  • src/google/adk/cli/utils/evals.py — moved GCS imports behind TYPE_CHECKING for annotations and lazy-import inside create_gcs_eval_managers_from_uri() where they're actually needed
  • pyproject.toml — added python-multipart>=0.0.9 to core dependencies
  • tests/unittests/cli/utils/test_evals.py — updated mock paths and added regression test verifying GCS classes are not in module namespace at runtime

Test plan

  • All 3 tests in test_evals.py pass (existing + new regression test)
  • from google.adk.cli.dev_server import DevServer succeeds
  • Pre-commit hooks pass on all changed files
  • Consistent with existing lazy-import pattern used in fast_api.py (lines 519-531) for DevServer itself
pytest tests/unittests/cli/utils/test_evals.py -v
3 passed in 9.65s

Fixes #5787

🤖 Generated with Claude Code

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 21, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@adk-bot adk-bot added the web [Component] This issue will be transferred to adk-web label May 21, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 21, 2026

Response from ADK Triaging Agent

Hello @mangod12, thank you for creating this PR!

We noticed that the Google Contributor License Agreement (CLA) check has failed for this pull request. According to our Contribution Guidelines, all contributions to this project must be accompanied by a signed CLA before they can be reviewed and accepted.

Please visit https://cla.developers.google.com/ to sign the agreement. Once signed, the check should update automatically.

Thank you!

@mangod12 mangod12 force-pushed the fix/dev-server-missing-deps branch 2 times, most recently from c69c3aa to f7c7b03 Compare May 21, 2026 15:58
…d-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 google#5787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web [Component] This issue will be transferred to adk-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Fresh pip install google-adk per docs leaves adk web without the chat UI (undeclared deps: google-cloud-storage, python-multipart)

2 participants