Skip to content

adk web crashes with ValidationError on __adk_agent_builder_assistant #5953

Closed

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]

Activity

  1. added
    web[Component] This issue will be transferred to adk-web
    on Jun 3, 2026
  2. added theissue type on Jun 3, 2026
  3. sanketpatil06 commented on Jun 3, 2026

    @sanketpatil06

    Hi @jmaurelli, thanks for reporting this and providing the details.
    We tried to reproduce the issue on our end using the steps you provided, but we were unable to do so, and it worked fine without throwing any error. Could you please provide more details and minimal reproduction code so that we can understand the issue and help you out? Thanks.

  4. boyangsvl commented on Jun 3, 2026

    @boyangsvl
    Collaborator

    Hi! This issue has already been resolved in the main branch. The validation crash was caused by Pydantic's name validation on the App model rejecting the internal system agent name (__adk_agent_builder_assistant) due to starting with underscores.

    This was resolved by bypassing the App validation for internal system agents prefixed with __ using App.model_construct(...). This fix was merged under Pull Request #5918 (commit f6e26cc).

    Closing the issue as completed.

  5. jmaurelli commented on Jun 5, 2026

    @jmaurelli
    Author

    Hi @jmaurelli, thanks for reporting this and providing the details. We tried to reproduce the issue on our end using the steps you provided, but we were unable to do so, and it worked fine without throwing any error. Could you please provide more details and minimal reproduction code so that we can understand the issue and help you out? Thanks.

    Everyone is fast! I was going to reproduce, but maintainers are faster. Thanks for your effort.

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

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions