2323from a2a .client .client import ClientConfig
2424from a2a .client .client import Consumer
2525from a2a .client .client_factory import ClientFactory
26+ from a2a .client .middleware import ClientCallContext
2627from a2a .types import AgentCapabilities
2728from a2a .types import AgentCard
2829from a2a .types import AgentSkill
@@ -1429,6 +1430,7 @@ def setup_method(self):
14291430 self .mock_session = Mock (spec = Session )
14301431 self .mock_session .id = "session-123"
14311432 self .mock_session .events = []
1433+ self .mock_session .state = {}
14321434
14331435 self .mock_context = Mock (spec = InvocationContext )
14341436 self .mock_context .session = self .mock_session
@@ -1682,6 +1684,7 @@ async def test_run_async_impl_with_meta_provider(self):
16821684 mock_a2a_client .send_message .assert_called_once_with (
16831685 request = mock_message ,
16841686 request_metadata = request_metadata ,
1687+ context = ClientCallContext (state = self .mock_session .state ),
16851688 )
16861689
16871690
@@ -1703,6 +1706,7 @@ def setup_method(self):
17031706 self .mock_session = Mock (spec = Session )
17041707 self .mock_session .id = "session-123"
17051708 self .mock_session .events = []
1709+ self .mock_session .state = {}
17061710
17071711 self .mock_context = Mock (spec = InvocationContext )
17081712 self .mock_context .session = self .mock_session
@@ -1989,6 +1993,7 @@ async def test_full_workflow_with_direct_agent_card(self):
19891993 mock_session = Mock (spec = Session )
19901994 mock_session .id = "session-123"
19911995 mock_session .events = [mock_event ]
1996+ mock_session .state = {}
19921997
19931998 mock_context = Mock (spec = InvocationContext )
19941999 mock_context .session = mock_session
@@ -2084,6 +2089,7 @@ async def test_full_workflow_with_direct_agent_card_and_factory(self):
20842089 mock_session = Mock (spec = Session )
20852090 mock_session .id = "session-123"
20862091 mock_session .events = [mock_event ]
2092+ mock_session .state = {}
20872093
20882094 mock_context = Mock (spec = InvocationContext )
20892095 mock_context .session = mock_session
0 commit comments