Skip to content

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

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

fix(cli): lazy-import GCS deps so adk web works without google-cloud-storage#5788
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 pull request!

We noticed that the Contributor License Agreement (CLA) check is currently failing. Per our Contribution Guidelines, all contributions must be accompanied by a signed Google CLA.

Could you please visit https://cla.developers.google.com/ to verify/sign the agreement so that our team can review and accept your contribution?

Thank you for your help in keeping our project compliant!

@mangod12 mangod12 force-pushed the fix/dev-server-missing-deps branch from 08387d2 to ceaa865 Compare May 21, 2026 15:24
@mangod12
Copy link
Copy Markdown
Author

I have already signed the Google CLA (verified passing on PR #5736 with the same email). Please re-check.

@mangod12 mangod12 closed this May 21, 2026
@mangod12 mangod12 reopened this May 21, 2026
…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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mangod12 mangod12 force-pushed the fix/dev-server-missing-deps branch from ceaa865 to 0f4454e Compare May 21, 2026 15:30
@mangod12
Copy link
Copy Markdown
Author

@googlebot I signed it!

@mangod12 mangod12 closed this May 21, 2026
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