Skip to content

[BUG] A2A Doesn't Work on 1.2.0 #572

@minorun365

Description

@minorun365

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

1.2.0

Python Version

3.12.7

Operating System

mac0S 15.5

Installation Method

pip

Steps to Reproduce

Run this example server

https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/agent-to-agent/#basic-server-setup

import logging
from strands_tools.calculator import calculator
from strands import Agent
from strands.multiagent.a2a import A2AServer

logging.basicConfig(level=logging.INFO)

# Create a Strands agent
strands_agent = Agent(
    name="Calculator Agent",
    description="A calculator agent that can perform basic arithmetic operations.",
    tools=[calculator],
    callback_handler=None
)

# Create A2A server (streaming enabled by default)
a2a_server = A2AServer(agent=strands_agent)

# Start the server
a2a_server.serve()

Expected Behavior

❯ python 4_a2a_server.py                  
INFO:     Started server process [92853]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [92853]

This works on Strands 1.1.0

Actual Behavior

❯ python 4_a2a_server.py              
Strands A2A server encountered exception.
Traceback (most recent call last):
  File "/Users/mi-onda/.pyenv/versions/3.12.7/lib/python3.12/site-packages/strands/multiagent/a2a/server.py", line 228, in serve
    uvicorn.run(self.to_starlette_app(), host=host or self.host, port=port or self.port, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mi-onda/.pyenv/versions/3.12.7/lib/python3.12/site-packages/strands/multiagent/a2a/server.py", line 171, in to_starlette_app
    a2a_app = A2AStarletteApplication(agent_card=self.public_agent_card, http_handler=self.request_handler).build()
                                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mi-onda/.pyenv/versions/3.12.7/lib/python3.12/site-packages/strands/multiagent/a2a/server.py", line 123, in public_agent_card
    return AgentCard(
           ^^^^^^^^^^
  File "/Users/mi-onda/.pyenv/versions/3.12.7/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for AgentCard
defaultInputModes
  Field required [type=missing, input_value={'name': '俳句エージ...y=None, streaming=True)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
defaultOutputModes
  Field required [type=missing, input_value={'name': '俳句エージ...y=None, streaming=True)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing

Additional Context

a2a-protocol 0.1.0
a2a-sdk 0.2.16
python-a2a 0.5.9

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions