Skip to content

agents-cli eval generate fails with ADK 2.x — two SDK incompatibilities #27

@Ivan2125

Description

@Ivan2125

What happened?

After upgrading from agents-cli 0.1.3 → 0.3.0 (via agents-cli scaffold upgrade), running agents-cli eval generate against a project that uses VertexAiSearchTool fails with two distinct errors, both caused by incompatibilities between the Vertex AI GenAI Eval SDK (vertexai._genai) introduced in 0.3.0 and ADK 2.x.

Steps to Reproduce

  1. Start from an agents-cli 0.3.0 project using google-adk>=2.0.0 and a VertexAiSearchTool in any agent.
  2. Run:
    agents-cli eval generate --dataset tests/eval/datasets/basic-dataset.json

What did you expect to happen?

Expected Behavior

All eval cases run successfully and a traces artifact is written.


Actual Behavior — two errors, 0/N cases succeed

Error 1 — NameError: name 'Optional' is not defined

AgentConfig._get_tool_declarations_from_agent() calls typing.get_type_hints() on every tool. For VertexAiSearchTool (a native ADK tool that exposes _get_declaration() directly) this fails because its underlying class uses from __future__ import annotations with unresolved forward references.

File "...vertexai/_genai/types/evals.py", line 100, in _get_tool_declarations_from_agent
    genai_types.FunctionDeclaration.from_callable_with_api_option(
File "...google/genai/types.py", line 4422, in from_callable_with_api_option
    annotation_under_future = typing.get_type_hints(callable)
NameError: name 'Optional' is not defined

Root cause: The Eval SDK tries to introspect native ADK tools (which have their own _get_declaration()) as plain Python callables. It should check for _get_declaration and skip get_type_hints in that case.


Error 2 — Invalid app name 'local agent run'

After patching Error 1, every case still fails because _evals_common.py hardcodes app_name = "local agent run" (with spaces) and passes it to ADK's Runner. ADK 2.x introduced strict name validation (^[a-zA-Z][a-zA-Z0-9_-]*$) that rejects spaces.

Value error, Invalid app name 'local agent run': must start with a letter
and can only consist of letters, digits, underscores, and hyphens.

Relevant lines in vertexai/_genai/_evals_common.py:

# line 2337
app_name = session_inputs.app_name or "local agent run"
# line 2340
app_name = "local agent run"

Root cause: The default app name in the Eval SDK pre-dates ADK 2.x's name constraints. Changing "local agent run""local_agent_run" would fix it.

Client information

Client Information

Run agents-cli info to output debugging information about your client.

CLI version: 0.3.0
OS info: Windows-11-10.0.26200-SP0
google-adk: 2.1.0
vertexai: 1.153.1

Command Output / Logs

No response

Anything else we need to know?

  • Project was upgraded with agents-cli scaffold upgrade (0.1.3 → 0.3.0). Upgrade itself ran cleanly.
  • Both errors affect every eval case — 0/N succeed.
  • Workaround for Error 1: inject a static _get_declaration on the VertexAiSearchTool instance to skip introspection.
  • Workaround for Error 2: monkey-patch validate_app_name in app/_setup.py to sanitize spaces.
  • Both workarounds are fragile; upstream fixes in either the Eval SDK or ADK are the clean solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions