code: async def handle_agent_message(self, agent_addr, message):
          
          message_handlers = {
              AgentHello: self.handle_agent_hello,
              AgentJobStarted: self.handle_agent_job_started,
              AgentJobDone: self.handle_agent_job_done,
              AgentJobSSHDebug: self.handle_agent_job_ssh_debug,
              Pong: self._handle_pong
          }
          try:
              func = message_handlers[message.__class__]
          except:
              raise TypeError("Unknown message type %s" % message.__class__)
          self._create_safe_task(func(agent_addr, message))
docs: Dispatch messages received from agents to the right handlers