merge wsclient and agentclient