adk-samples
adk-samples copied to clipboard
Duplicate key name
Location: https://github.com/google/adk-samples/blob/main/agents/personalized-shopping/personalized_shopping/shared_libraries/web_agent_site/engine/goal.py#L134
There is a duplicate dictionary key "name" in the product_goals.append() call:
product_goals.append(
{
"asin": asin,
"category": product["category"],
"query": product["query"],
"name": product["name"], # First definition
"product_category": product["product_category"],
"instruction_text": f"{instruction_text}{option_text}{price_text}",
"attributes": attributes,
"price_upper": price_upper,
"goal_options": goal_options,
"name": product["Title"], # Overwrites previous 'name'
}
)
This results in the "name" field being silently overwritten with product["Title"], potentially replacing the actual product name.
✅ Fix
Rename one of the "name" keys or remove the duplicate to preserve the intended value.
Example fix:
"name": product["name"],
"title": product["Title"], # Renamed to avoid conflict
closing the issue as the PR is merged