"adk deploy agent_engine" fails if the agent folder name contains dashes. #2902
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Enginegood first issue[Community] This issue is good for newcomers to participate[Community] This issue is good for newcomers to participate
Description
To reproduce, run:
adk deploy agent_engine <options> agent-folder-name.
The generated code will fail on the following line:
...
from agent-folder-name.agent import root_agent
..
with "Deploy failed: Failed to set up agent engine <vertexai.agent_engines._agent_engines.ModuleAgent object at 0x1310dbad0>: invalid syntax (agent_engine_app.py, line 13)".
It's pretty hard to debug, at the very least would be good to add a validation step and print a descriptive reason for the failure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Enginegood first issue[Community] This issue is good for newcomers to participate[Community] This issue is good for newcomers to participate
Activity
surajksharma07 commentedon Oct 10, 2025
Hi @silichenko,
Rename your agent folder to use underscores instead of dashes (e.g.,
agent_folder_nameinstead ofagent-folder-name), and it should work.Thanks.
yeesian commentedon Oct 10, 2025
We'll work on providing better validation and error messages, thank you for the report!
fix(cli): validate agent folder names for agent_engine
surajksharma07 commentedon Feb 5, 2026
@slilichenko The issue happens because Python module names can't contain dashes - they're interpreted as minus operators.
Rename your agent folder to use underscores instead (e.g.,
agent_folder_nameinstead ofagent-folder-name) and the deployment will work.PR #4246 is open to add proper validation with a clearer error message.
For now, just swap dashes for underscores in your folder name.
wuliang229 commentedon Feb 13, 2026
This seems to be no longer an issue due to as I just tested with
adk deploy agent_engine --project=$PROJECT_ID --region=$LOCATION_ID --display_name="My First Agent" hello-world. Seems to be related to how the template has changed.