Skip to content

[Bug]: Agent Card not retrieved if all interfaces supports only protocol version 1.0 #1111

Description

@carmine-sacco

What happened?

It looks that at least one interface must support protocol version 0.3 when you use create_agent_card_routes from a2a.server.routes.agent_card_routes. The issue is because the function to_compat_agent_card convert the agent card to format into 0.3 version and it doesn't provide any interface if there isn't anyone with legacy version 0.3.

def to_compat_agent_card(core_card: pb2_v10.AgentCard) -> types_v03.AgentCard:
    # Map supported interfaces back to legacy layout
    """Convert agent card to v0.3 compat type."""
    compat_interfaces = [
        interface
        for interface in core_card.supported_interfaces
        if (
            (not interface.protocol_version)
            or is_legacy_version(interface.protocol_version)
        )
    ]
    if not compat_interfaces:
        raise errors.VersionNotSupportedError(
            'AgentCard must have at least one interface with compatible protocol version.'
        )

Is it a BUG or is it an architecture decision?

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions