Skip to content

[Bug]: ApiServer.__init__ has undefined type annotations EvalSetsManager and EvalSetResultsManager #7793

Closed

Description

@aryanpatil-07

🔴 Required Information

Describe the Bug:
ApiServer.__init__ in src/google/adk/cli/api_server.py declares parameter type annotations eval_sets_manager: EvalSetsManager and eval_set_results_manager: EvalSetResultsManager, but neither class is imported in api_server.py (not even under if typing.TYPE_CHECKING:).

Because from __future__ import annotations is used, module import succeeds, but any static type checker (mypy) fails with [name-defined] errors:

src/google/adk/cli/api_server.py:1002: error: Name "EvalSetsManager" is not defined  [name-defined]
src/google/adk/cli/api_server.py:1003: error: Name "EvalSetResultsManager" is not defined  [name-defined]

Steps to Reproduce:

  1. Run static analysis on api_server.py:
bash
uv run mypy src/google/adk/cli/api_server.py
  1. Observe name-defined errors for EvalSetsManager and EvalSetResultsManager.

Expected Behavior: All type annotations used in ApiServer.init should be defined and resolve during static analysis.

Observed Behavior: Static analysis fails with undefined name errors for EvalSetsManager and EvalSetResultsManager.

Environment Details:

ADK Library Version: latest main
Python Version: 3.11+
OS: Windows / Linux / macOS
Model Information:

Are you using LiteLLM: No
Which model is being used: N/A

🟡 Optional Information

Regression: No

Additional Context:
Importing EvalSetResultsManager and EvalSetsManager under if typing.TYPE_CHECKING: resolves the missing type annotations for static analysis while maintaining lazy import behavior for runtime CLI performance (matching src/google/adk/cli/cli_tools_click.py).

Activity

  1. llalitkumarrr commented on Nov 4, 2026

    @llalitkumarrr
    Collaborator

    Hello @aryanpatil-07,

    Thank you for raising this issue and for your contribution. Your PR is currently under review and we will reach out if we need more details. In the meantime, we appreciate your patience.

  2. added
    eval[Component] This issue is related to evaluation
    on Nov 4, 2026
  3. self-assigned this
    on Nov 9, 2026
  4. GWeale commented on Nov 9, 2026

    @GWeale
    Collaborator

    fixed on main in bd43897, api_server.py now imports EvalSetsManager and EvalSetResultsManager for type checking, so mypy stops flagging them. not in a release yet. thanks @aryanpatil-07, please open a new issue if it comes back.

  5. github-actions commented on Nov 9, 2026

    @github-actions

    Are you satisfied with the resolution of your issue?
    Yes
    No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

eval[Component] This issue is related to evaluation

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions