Skip to content

[Bug]: Builder Assistant initialization fails due to "__" name prefix validation in ADK 2.0.0 #5877

@AnkitBhatnagar-Compass

Description

@AnkitBhatnagar-Compass

🔴 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Describe the Bug:
In ADK version 2.0.0, the internal Builder Assistant fails to initialize properly because its default name starts with double underscores (e.g., builder_assistant). This violates the updated Pydantic validation rules introduced in 2.0.0, which strictly enforce that an agent's name attribute must be a valid identifier starting with a letter [a-zA-Z]. Because the framework rejects its own internal component's name, it causes a crash or failure when trying to use the builder features.

Steps to Reproduce:

  1. Install google-adk version 2.0.0.
  2. Run adk web in your project folder to launch the Visual Builder (or trigger the workflow that initializes the Builder Assistant).
  3. Open http://localhost:8000 in your browser.
  4. Observe the validation error (ValidationError / ValueError) thrown by the framework due to the double underscore naming constraint.

Expected Behavior:
The Builder Assistant should initialize successfully. Internal helper agents should either be exempt from strict user-facing identifier validation rules, or they should be renamed to comply with the "must start with a letter" rule (e.g., renaming builder_assistant to BuilderAssistant).

Observed Behavior:
The application throws a ValidationError or ValueError indicating that the agent name is invalid because it does not start with a letter, blocking the initialization of the Visual Builder.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.0.0
  • Desktop OS: [e.g., macOS, Linux, Windows]
  • Python Version (python -V): Python 3.11+

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.0-flash

🟡 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Did this work in a previous version of ADK? If so, which one?
Yes, this did not trigger a validation crash in pre-2.0.0 alpha versions before the aggressive Pydantic identifier validation was introduced.

Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a text file.

ValidationError: 1 validation error for Agent
name
string does not match regex "^[a-zA-Z][a-zA-Z0-9_-]$" (type=value_error.str.regex; pattern=^[a-zA-Z][a-zA-Z0-9_-]$)

Screenshots / Video:
NA

Additional Context:
Until a patch is released, users can temporarily bypass this issue by manually editing the source code in their local environment (site-packages/google/adk/visual_builder/builder_agent.py) to rename the assistant to a compliant identifier (e.g., BuilderAssistant).

Minimal Reproduction Code:
Please provide a code snippet or a link to a Gist/repo that isolates the issue.
import google.adk.agents.base_agent as base

The error occurs internally when executing:

adk web

How often has this issue occurred?:
Always (100%)

Metadata

Metadata

Assignees

Labels

request clarification[Status] The maintainer need clarification or more information from the authorv2Affects only 2.0 versionweb[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