-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Summary
When constructing an A2AAgent with an agent_card, the name and description parameters must be explicitly passed even though the AgentCard already contains this information. This creates unnecessary duplication:
# Current - redundant
agent = A2AAgent(agent_card=card, name=card.name, description=card.description)
# Proposed - card provides defaults
agent = A2AAgent(agent_card=card)Current Behavior
In A2AAgent.__init__(), name and description default to None and are passed directly to BaseAgent.__init__(). The agent_card is only used for transport setup (creating the HTTP client). If name/description are not explicitly provided, they remain None on the agent instance - even though the card has them.
Proposed Change
When agent_card is provided and name/description are not explicitly set, A2AAgent.__init__() should fall back to agent_card.name and agent_card.description:
def __init__(self, *, name=None, description=None, agent_card=None, ...):
if agent_card is not None:
name = name or agent_card.name
description = description or agent_card.description
super().__init__(name=name, description=description, ...)This is backward compatible - explicit values still take precedence.
Motivation
When using A2AAgent as a participant in GroupChat orchestrations, the agent's name and description are essential for routing decisions. It's natural to expect that passing an AgentCard (which already carries these fields) would be sufficient.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status