Skip to content

Regression of #3977 / #4054: adk create accepts hyphens in agent names, agent then fails to load #8002

Closed

Description

@kacper1zajkowski

🔴 Required Information

Describe the Bug:
adk create accepts an agent name containing a hyphen (e.g. adk-local) and creates the agent folder, but the agent cannot be loaded afterwards. In adk web the app is listed by /list-apps, but every message fails (POST /run_sse returns 404) and the request never reaches the model. Renaming the folder to use an underscore (adk_local) fixes it.

Steps to Reproduce:

  1. pip install google-adk litellm
  2. adk create my-agent
  3. Replace my-agent/agent.py with the minimal code below
  4. adk web --host 0.0.0.0 --port 8000 --log_level DEBUG
  5. Open the Web UI, select my-agent, send any message
  6. Observe POST /run_sse -> 404 Not Found in the server log

Expected Behavior:
adk create should reject names that cannot be loaded as an agent package (same rule as the agent loader), e.g. with a clear error suggesting my_agent.

Observed Behavior:
The folder is created without any warning. The app is listed in the Web UI, but every message fails with POST /run_sse 404, so the agent is unusable until the folder is renamed.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.13.0
  • Desktop OS: Linux (Debian)
  • Python Version (python -V): 3.13.5

Model Information:

  • Are you using LiteLLM: Yes
  • Which model is being used: qwen3:8b via Ollama (ollama_chat/qwen3:8b). The issue is not model-specific.

🟡 Optional Information

Regression:
Yes, this looks like a regression of #3977 and #4054, which were closed as completed in January 2026. Still reproducible in 2.13.0.

Logs:

INFO:     <client-ip> - "POST /run_sse HTTP/1.1" 404 Not Found
INFO:     <client-ip> - "GET /dev/apps/adk-local/debug/trace/session/<session-id> HTTP/1.1" 200 OK

Screenshots / Video:
N/A

Additional Context:
Root cause (from reading the source of google-adk 2.13.0):

  • cli/cli_create.py validates the folder name with validate_app_name() from apps/app.py, whose regex allows hyphens: ^[a-zA-Z][a-zA-Z0-9_-]*$.
  • cli/utils/_nested_agent_loader.py requires every part of the agent name to pass str.isidentifier(), so my-agent is rejected at load time.

Suggested fix: keep validate_app_name() as is (hyphens are fine for App.name), but in cli_create.py additionally require app_name.isidentifier() for the folder name, since the folder is imported as a Python package.

Minimal Reproduction Code:

# my-agent/agent.py
from google.adk.agents import Agent
from google.adk.models.lite_llm import LiteLlm

root_agent = Agent(
    name="my_agent",
    model=LiteLlm(model="ollama_chat/qwen3:8b"),
    instruction="Answer briefly.",
)

How often has this issue occurred?:

  • Always (100%)

Activity

  1. aritejhg commented on Nov 6, 2026

    @aritejhg

    Thanks for the clear reproduction. I traced the mismatch you described: adk create accepts hyphens, while the loader requires Python identifiers. I would keep the general app-name validator unchanged and check that folder names are importable before creating the project, with a regression test for the rejection message. Would it be okay if I took this on? I will wait for your or a maintainer's go-ahead before opening a PR.

  2. surajksharma07 commented on Nov 6, 2026

    @surajksharma07
    Collaborator

    Thanks for the detailed report @kacper1zajkowski, your root cause is spot on. Reproduced this on 2.13.0: the v2 app-name validator started allowing hyphens so the old #3977 check in adk create stopped catching them.

    This is already fixed on main in #7496 (adk create now also requires a valid Python identifier) but it isn’t in a release yet. Until then, create the agent with an underscore (adk create my_agent) or rename the existing folder to my_agent.

    Could you try that and confirm it works for you? If you get a chance it’d also be great to test adk create my-agent from main and check you get the clear error instead of the 404.

    @aritejhg thanks for offering to help! Since the fix has already landed there’s no need for a new PR, but please verify on main first if you spot anything still missing.

  3. self-assigned this
    on Nov 9, 2026
  4. GWeale commented on Nov 9, 2026

    @GWeale
    Collaborator

    fixed in v2.14.0 by #7496 (3655990), adk create now rejects names that aren't valid python identifiers, like my-agent, instead of making a folder that won't load. you were on 2.13.0, so upgrading should do it. thanks @kacper1zajkowski, please open a new issue if you still hit it on 2.14.0.

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions