code: function reconnect() {
          if (_loadAgentsPromise) {
              // Agents are already loading, so don't unload
              return _loadAgentsPromise;
          }
  
          unloadAgents();
  
          // Clear any existing related documents before we reload the agents.
          // We need to recreate them for the reloaded document due to some
          // desirable side-effects (see #7606). Eventually, we should simplify
          // the way we get that behavior.
          _.forOwn(_relatedDocuments, function (relatedDoc) {
              _closeRelatedDocument(relatedDoc);
          });
  
          return loadAgents();
      }
docs: Unload and reload agents
  @return {jQuery.Promise} Resolves once the agents are loaded