Skip to content

Python: A2AAgent should default name/description from AgentCard when not explicitly provided #4630

Closed

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.

Activity

  1. changed the title [-]A2AAgent should default name/description from AgentCard when not explicitly provided[/-] [+]Python: A2AAgent should default name/description from AgentCard when not explicitly provided[/+] on Mar 11, 2026
  2. added
    a2aUsage: [Issues, PRs], Target: A2A
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Mar 12, 2026
  3. added a commit that references this issue on Mar 12, 2026
    43bf53d
  4. moved this from In Progress to In Review in Agent Frameworkon Mar 12, 2026
  5. added a commit that references this issue on Mar 13, 2026
    f696ac9
  6. moved this from In Review to Done in Agent Frameworkon Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

a2aUsage: [Issues, PRs], Target: A2ApythonUsage: [Issues, PRs], Target: Python

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions