Skip to content

adk web crashes with ValidationError on __adk_agent_builder_assistant #5953

@jmaurelli

Description

@jmaurelli

Describe the bug
When launching the Web UI via adk web, the server encounters a Pydantic ValidationError upon handling a POST /run_sse request. The error states that the app name __adk_agent_builder_assistant is invalid because it must start with a letter. This results in a 500 Internal Server Error, breaking web functionality.

Steps to Reproduce

  • Create a new Python virtual environment (.venv) on Ubuntu.
  • Install google-adk version 2.1.0.
  • Initialize a new agent using the CLI: adk create root.
  • Launch the web server: adk web --host 0.0.0.0 --port 8000 root/.
  • Access the Web UI at the provided local host address.
  • The backend server throws a 500 Internal Server Error when the UI attempts a POST /run_sse request.

Expected behavior
The ADK web server should successfully load and process Web UI requests without validation failures for system or framework-level processes.

Actual behavior
The run_agent_sse function attempts to initialize an App model, which is strictly validated by Pydantic. The validation rejects __adk_agent_builder_assistant because it begins with underscores rather than a letter, crashing the request.

Environment details:

  • OS: Ubuntu 24.04.4 LTS
  • Python version: 3.12 (inside .venv)
  • ADK version: 2.1.0

Related Issues:
This appears related to the strict identifier validation discussed in Issue #3977, where Pydantic validation rules were applied to agent names.

Logs/Traceback:
INFO: 172.27.205.188:64185 - "POST /run_sse HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): ... File "/home/orchadmin/my_agents_adk/.venv/lib/python3.12/site-packages/google/adk/cli/api_server.py", line 1446, in run_agent_sse runner = await self.get_runner_async(req.app_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/orchadmin/my_agents_adk/.venv/lib/python3.12/site-packages/google/adk/cli/api_server.py", line 690, in get_runner_async agentic_app = App( ^^^^ File "/home/orchadmin/my_agents_adk/.venv/lib/python3.12/site-packages/pydantic/main.py", line 263, in __init__ validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pydantic_core._pydantic_core.ValidationError: 1 validation error for App Value error, Invalid app name '__adk_agent_builder_assistant': must start with a letter and can only consist of letters, digits, underscores, and hyphens. [type=value_error, input_value={'name': '__adk_agent_bui...ck=None), 'plugins': []}, input_type=dict]

Metadata

Metadata

Assignees

Labels

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

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions