Now I need to modify the DOMContentLoaded handler to also initialize agent buttons, load contact memories, and update token estimate. Let me find it:


1873:        document.addEventListener('DOMContentLoaded', function() {


  1873→        document.addEventListener('DOMContentLoaded', function() {
  1874→            loadProviders();
  1875→            loadConversationHistory(); // Load conversation history on page load
  1876→        });
  1877→
  1878→        // Load AI providers from API
  1879→        async function loadProviders() {
  1880→            try {

        document.addEventListener('DOMContentLoaded', function() {
            loadProviders();
            loadConversationHistory(); // Load conversation history on page load
        });

        // Load AI providers from API
        async function loadProviders() {
            try {


Edit

        document.addEventListener('DOMContentLoaded', function() {
            loadProviders();
            loadConversationHistory(); // Load conversation history on page load
        });

        document.addEventListener('DOMContentLoaded', function() {
            loadProviders();
            loadConversationHistory();
            initAgentButtons();
            updateTokenEstimate();
            // Load contact memories if we have a primary contact
            if (primaryContactId) {
                loadContactMemories(primaryContactId);
            }
        });