@@ -986,13 +986,15 @@ async def test_function_tool_execution_success(
986986 assert isinstance (tool_start_event , RealtimeToolStart )
987987 assert tool_start_event .tool == mock_function_tool
988988 assert tool_start_event .agent == mock_agent
989+ assert tool_start_event .arguments == '{"param": "value"}'
989990
990991 # Check tool end event
991992 tool_end_event = await session ._event_queue .get ()
992993 assert isinstance (tool_end_event , RealtimeToolEnd )
993994 assert tool_end_event .tool == mock_function_tool
994995 assert tool_end_event .output == "function_result"
995996 assert tool_end_event .agent == mock_agent
997+ assert tool_end_event .arguments == '{"param": "value"}'
996998
997999 @pytest .mark .asyncio
9981000 async def test_function_tool_with_multiple_tools_available (self , mock_model , mock_agent ):
@@ -1111,6 +1113,7 @@ async def test_function_tool_exception_handling(
11111113 assert session ._event_queue .qsize () == 1
11121114 tool_start_event = await session ._event_queue .get ()
11131115 assert isinstance (tool_start_event , RealtimeToolStart )
1116+ assert tool_start_event .arguments == "{}"
11141117
11151118 # But no tool output should have been sent and no end event queued
11161119 assert len (mock_model .sent_tool_outputs ) == 0
@@ -1133,10 +1136,20 @@ async def test_tool_call_with_complex_arguments(
11331136
11341137 await session ._handle_tool_call (tool_call_event )
11351138
1136- # Verify arguments were passed correctly
1139+ # Verify arguments were passed correctly to tool
11371140 call_args = mock_function_tool .on_invoke_tool .call_args
11381141 assert call_args [0 ][1 ] == complex_args
11391142
1143+ # Verify tool_start event includes arguments
1144+ tool_start_event = await session ._event_queue .get ()
1145+ assert isinstance (tool_start_event , RealtimeToolStart )
1146+ assert tool_start_event .arguments == complex_args
1147+
1148+ # Verify tool_end event includes arguments
1149+ tool_end_event = await session ._event_queue .get ()
1150+ assert isinstance (tool_end_event , RealtimeToolEnd )
1151+ assert tool_end_event .arguments == complex_args
1152+
11401153 @pytest .mark .asyncio
11411154 async def test_tool_call_with_custom_call_id (self , mock_model , mock_agent , mock_function_tool ):
11421155 """Test that tool context receives correct call_id"""
0 commit comments