[BUG] A2A Doesn't Work on 1.2.0
Checks
- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] 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
hi @minorun365 can you please provide the code for the A2A server implementation that you have as well as the version of a2a-sdk that your environment is using?
@jer96 Sorry! I updated it.
i was able to reproduce this with an environment with a2a-sdk == 0.2.11, however i do not encounter this with 0.2.16. the most recent release of strands did not release any A2A changes and the most recent tested version of a2a-sdk used within Strands is 0.2.16. as such, i'm hesitant to think that a breaking change was introduced on our side.
can you confirm that the python environment running your A2A server is definitely using the latest version of a2a-sdk? you may potentially be running different python or virtual environments and the dependencies may not be up-to-date.
the following commands should help:
pip install -U 'strands-agents[a2a]'pip install -U a2a-sdk
both run in the python environment you are using to run the server.
@jer96 Thank you! I fixed the deps and raised a PR.
https://github.com/strands-agents/sdk-python/pull/581
@minorun365 amazing, thank you so much for the contribution!