docstr: Put an incoming message onto the correct agent's message queue.
  
  :param message:
      message to put on queue
code: def _on_new_message(self, message: Dict[str, Any]):
      """
      Put an incoming message onto the correct agent's message queue.
  
      :param message:
          message to put on queue
      """
      message = self.restructure_message(message)
      agent_id = message["sender"]["id"]
      if not self.world_runner.is_initialized():
          self.observe_message(
              agent_id,
              "Please wait while the worlds are initializing...",
          )
          self.world_runner.init_fut.result()
  
      if agent_id not in self.messenger_agent_states:
          self._on_first_message(message)
          return
  
      agent_state = self.get_agent_state(agent_id)
      assert agent_state is not None
      if agent_state.get_active_agent() is None:
          # return agent to overworld
          if (
              message.get("text", "")
              and message["text"].upper() == "EXIT"
          ):
              # remove agent from agent_pool
              to_remove = []
              for world_type, _time in agent_state.time_in_pool.items():
                  to_remove.append(world_type)
              for world_type in to_remove:
                  self.remove_agent_from_pool(
                      agent_state, world_type, mark_removed=False
                  )
              self.after_agent_removed(agent_state.get_id())
              agent_state.set_active_agent(
                  agent_state.get_overworld_agent()
              )
          else:
              self.observe_message(
                  agent_id,
                  "Please wait while we pair you with another person. "
                  "If you wish to exit, type *EXIT*.",
              )
              self.sender.typing_on(agent_id)  # type: ignore
      else:
          # If an agent is in a solo world, we can put a typing indicator
          # and mark the message as read
          agent = agent_state.get_active_agent()
          if len(agent.message_partners) == 0:
              self.handle_bot_read(agent.id)  # type: ignore
          agent.put_data(message)
  
imports: from abc import ABC, abstractmethod
  from asyncio import Future
  import copy
  import sys
  import logging
  import datetime
  import threading
  import time
  import traceback
  from typing import Dict, Any, Optional, List, Callable
  from parlai.chat_service.core.agents import ChatServiceAgent
  import parlai.chat_service.utils.logging
  import parlai.chat_service.utils.misc
  import parlai.chat_service.utils.server
  from parlai.chat_service.core.world_runner import ChatServiceWorldRunner
  from parlai.core.opt import Opt
label_desc: Use image node_id 18 for calling the ChatServiceManager obj's underlying member method code with example usage: obj._on_new_message(message) without return types