Dev UI eval reports "Eval module is not installed" for unrelated `ModuleNotFoundErrors`
Maintainer thường phản hồi trong vòng 3 ngày
@adri0 đang làm issue này rồi.
Từ ngày 25/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- developer-experience
Hướng nghiên cứu
The problem is the broad except ModuleNotFoundError in run_eval in src/google/adk/cli/dev_server.py, which also wraps agent loading and evaluation. Compare it with the import-only guard in cli_tools_click.py, and check the existing add-session handling. Done means the hint appears only when the five eval imports fail, while other errors propagate. Linked pull request #8356 is already open against this, so check it before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🔴 Required Information
Describe the Bug:
When an eval is started from the Dev UI (adk web), any ModuleNotFoundError raised while the eval runs is reported as Eval module is not installed, please install via pip install "google-adk[eval]", even when google-adk[eval] is installed. For example, the agent's own agent.py might import a package that isn't installed. The real cause appears only in the server log, so users are told to reinstall something they already have.
The cause is in src/google/adk/cli/dev_server.py, in run_eval (POST /dev/apps/{app_name}/eval-sets/{eval_set_id}/run). The try: ... except ModuleNotFoundError there is meant to guard the lazy imports of the evaluation modules. However, it also covers loading the agent (self.agent_loader.load_agent(app_name)), building the LocalEvalService, inference and metric evaluation.
Steps to Reproduce:
- Install ADK with the eval extra:
pip install "google-adk[eval]" - Create an agent whose
agent.pyimports a package that is not installed (see Minimal Reproduction Code below), plus an eval setevalset1.evalset.jsonin the agent folder. - Start the dev server:
adk web agents - Run the eval set from the Dev UI, or call the endpoint directly:
curl -X POST localhost:8000/dev/apps/badagent/eval-sets/evalset1/run \ -H 'content-type: application/json' \ -d '{"eval_metrics":[{"metric_name":"response_match_score","threshold":0.8}]}'
Expected Behavior:
The error points at the real problem: the agent failed to load because some_llm_sdk_not_installed is missing. The "install google-adk[eval]" hint should only appear when the eval
modules themselves can't be imported.
Observed Behavior:
HTTP 400 with a misleading message:
{"detail":"Eval module is not installed, please install via `pip install \"google-adk[eval]\"`."}
The real error is only in the server log:
ERROR - dev_server.py:1156 - Fail to load 'badagent' module. No module named 'some_llm_sdk_not_installed'
Environment Details:
- ADK Library Version (pip show google-adk): 2.15.0`
- Desktop OS: macOS 26.7.3
- Python Version (python -V): Python 3.12.8
Model Information:
- Are you using LiteLLM: No
- Which model is being used: gemini-2.5-flash (the bug doesn't depend on the model; it's triggered before any model call)
🟡 Optional Information
Regression:
Unknown, not tested on earlier versions.
Logs:
ERROR - dev_server.py:1156 - Fail to load 'badagent' module. No module named 'so
Traceback (most recent call last):
...
ModuleNotFoundError: Fail to load 'badagent' module. No module named 'some_llm_sdk_not_installed'
Screenshots / Video:
N/A
Additional Context:
- The
adk evalCLI is not affected: incli_tools_click.pythe same handler wraps only the imports, so errors are reported correctly there. The other places that raiseMISSING_EVAL_DEPENDENCIES_MESSAGE(cli_eval.py,agent_evaluator.py, the GEPA optimizers) also wrap only imports. - In practice the bug hits users whose agent imports an optional SDK they haven't installed, which can look like "the eval fails when I have no LLM access".
- Suggested fix: limit the
except ModuleNotFoundErrorinrun_evalto the five eval imports at the top of the function and let later errors propagate. Other dev endpoints that load the agent, such asadd-session, already let these errors through. I have a patch with a regression test and can open a PR.
Minimal Reproduction Code:
# agents/badagent/__init__.py
from . import agent
# agents/badagent/agent.py
import some_llm_sdk_not_installed # any package that is not installed
from google.adk.agents import Agent
root_agent = Agent(
name="badagent", model="gemini-2.5-flash", instruction="Be helpful."
)
// agents/badagent/evalset1.evalset.json
{"eval_set_id": "evalset1", "eval_cases": [{"eval_id": "case1",
"conversation": [{"invocation_id": "i1",
"user_content": {"role": "user", "parts": [{"text": "hi"}]},
"final_response": {"role": "model", "parts": [{"text": "hello"}]}}],
"session_input": {"app_name": "badagent", "user_id": "u"}}]}
How often has this issue occurred?:
- Always (100%)
- Ngôn ngữ chính
- Python
- Star
- 22.3k
- Fork
- 4.4k
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google/adk-python#8360 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
google/adk-python#8359 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Can pin to litellm version be changed?Có thể đã có người làm @llalitkumarrr đã nhận 10 ngày trước. Đang mởmodels
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
google/adk-python#8129 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
OpenAPI tools ignore operation- and path-level server overridesCó thể đã có người làm @sanketpatil06 đã nhận 14 ngày trước. Đang mởtools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
google/adk-python#8064 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Two docstrings in openapi_tool document parameters the signatures do not acceptCó thể đã có người làm @surajksharma07 đã nhận 17 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
google/adk-python#8024 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của google/adk-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vllm-project/vllm#70030 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TigreGotico/tugaphone#408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
gke-labs/kube-agents#7308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
chore
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
lugassawan/swe-workbench#841 ·