Repository navigation
Conversation
to_agent_engine filled in the agent folder name as the display name before reading .agent_engine_config.json, so the fallback always overwrote the display_name from the config file. Fall back to the folder name only when neither --display_name nor the config file sets one. Fixes google#7619
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
adk deploy agent_engineignoresdisplay_namefrom.agent_engine_config.jsonwhen--display_nameis not passed.to_agent_enginesets the agent folder name as a fallback (display_name = display_name or app_name, added in d4b2a8b) before it reads the config file. As a result,display_nameis always truthy and overwrites the value from the config file.Solution:
Apply the folder-name fallback only when neither
--display_namenor the config file setsdisplay_name. This restores the behavior before d4b2a8b, so the precedence is--display_name> config file > folder name.Testing Plan
Unit Tests:
Added
test_to_agent_engine_display_name_precedencetotests/unittests/cli/utils/test_cli_deploy.py. It covers three cases: the config file value is used,--display_nametakes precedence, and the folder name is used when neither is set. The config-file case fails without the fix.Manual End-to-End (E2E) Tests:
Deployed a minimal quickstart-style agent to a real Agent Platform project with this branch. The agent folder
display_name_e2econtains this.agent_engine_config.json, and--display_namewas not passed:{ "display_name": "Display Name From JSON", "description": "E2E check for google/adk-python#7620" }Overriding display_name in agent platform config with display_name_e2e.displayName: "Display Name From JSON"anddescription: "E2E check for google/adk-python#7620", as returned by thereasoningEngines.getAPI and shown in the Cloud Console below.Cloud Console after deploying:

Before the fix, the same setup produced the folder name as the display name. I checked this locally by running
to_agent_enginewith a fakeagentplatformclient and inspecting the config passed toruntimes.update():display_name = my_agent,description = Desc From JSONdisplay_name = Name From JSON,description = Desc From JSONChecklist