Skip to content

Commit 6eafeea

Browse files
authored
fix: default prototype mode to deployment_target='none' (#855)
* fix: default prototype mode to deployment_target='none' When --prototype is used without an explicit --deployment-target, default to 'none' instead of picking the first available target. This avoids pulling in unnecessary deployment-specific files for minimal projects. * fix: correct Agent Engine console URL path Add missing /agent-engines/ segment to the console URL so playground and console links route correctly. * refactor: combine deployment target auto-select conditions
1 parent 7d28803 commit 6eafeea

File tree

2 files changed

+27
-20
lines changed
  • agent_starter_pack
    • cli/commands
    • deployment_targets/agent_engine/python/{{cookiecutter.agent_directory}}/app_utils

2 files changed

+27
-20
lines changed

agent_starter_pack/cli/commands/create.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -726,30 +726,37 @@ def create(
726726

727727
final_deployment = deployment_target
728728
if not final_deployment:
729-
available_targets = get_deployment_targets(
730-
deployment_agent_name, remote_config=remote_config
731-
)
732-
if not available_targets:
733-
raise click.ClickException(
734-
f"Error: No deployment targets available for agent '{deployment_agent_name}'."
735-
)
736-
# Auto-select if only one target available or in auto-approve mode
737-
if len(available_targets) == 1:
738-
final_deployment = available_targets[0]
729+
if prototype:
730+
final_deployment = "none"
739731
console.print(
740-
f"Info: Using '{final_deployment}' (only available deployment target for this agent).",
741-
style="yellow",
742-
)
743-
elif auto_approve:
744-
final_deployment = available_targets[0]
745-
console.print(
746-
f"Info: --deployment-target not specified. Defaulting to '{final_deployment}' in auto-approve mode.",
732+
"Info: Prototype mode: using deployment_target='none'.",
747733
style="yellow",
748734
)
749735
else:
750-
final_deployment = prompt_deployment_target(
736+
available_targets = get_deployment_targets(
751737
deployment_agent_name, remote_config=remote_config
752738
)
739+
if not available_targets:
740+
raise click.ClickException(
741+
f"Error: No deployment targets available for agent '{deployment_agent_name}'."
742+
)
743+
# Auto-select if only one target available or in auto-approve mode
744+
if len(available_targets) == 1 or auto_approve:
745+
final_deployment = available_targets[0]
746+
if len(available_targets) == 1:
747+
console.print(
748+
f"Info: Using '{final_deployment}' (only available deployment target for this agent).",
749+
style="yellow",
750+
)
751+
else:
752+
console.print(
753+
f"Info: --deployment-target not specified. Defaulting to '{final_deployment}' in auto-approve mode.",
754+
style="yellow",
755+
)
756+
else:
757+
final_deployment = prompt_deployment_target(
758+
deployment_agent_name, remote_config=remote_config
759+
)
753760
if debug:
754761
logging.debug(f"Selected deployment target: {final_deployment}")
755762

agent_starter_pack/deployment_targets/agent_engine/python/{{cookiecutter.agent_directory}}/app_utils/deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ def print_deployment_success(
152152
)
153153
print(f"Service Account: {default_sa}")
154154
{%- if cookiecutter.is_adk and not cookiecutter.is_adk_live and not cookiecutter.is_a2a %}
155-
playground_url = f"https://console.cloud.google.com/vertex-ai/agents/locations/{location}/agent-engines/{agent_engine_id}/playground?project={project}"
155+
playground_url = f"https://console.cloud.google.com/vertex-ai/agents/agent-engines/locations/{location}/agent-engines/{agent_engine_id}/playground?project={project}"
156156
print(f"\n📊 Open Console Playground: {playground_url}\n")
157157
{%- else %}
158-
console_url = f"https://console.cloud.google.com/vertex-ai/agents/locations/{location}/agent-engines/{agent_engine_id}?project={project}"
158+
console_url = f"https://console.cloud.google.com/vertex-ai/agents/agent-engines/locations/{location}/agent-engines/{agent_engine_id}?project={project}"
159159
print(f"\n📊 View in Console: {console_url}\n")
160160
{%- endif %}
161161

0 commit comments

Comments
 (0)