#!/usr/bin/env python3 """ Comprehensive monitoring after removing ChatMessage import """ import time import requests def comprehensive_monitor(): """Monitor the deployment with detailed analysis""" print("šŸ”§ COMPREHENSIVE MONITORING AFTER IMPORT FIXES") print("=" * 70) url = "https://huggingface.co/spaces/John-jero/IDAgentsFreshTest" for attempt in range(8): # Extended monitoring try: print(f"\nā±ļø Check #{attempt + 1} at {time.strftime('%H:%M:%S')}") response = requests.get(url, timeout=25) print(f"Status: {response.status_code}") print(f"Size: {len(response.text):,} bytes") # Check for success indicators text = response.text.lower() if response.status_code == 200: print("āœ… Status 200: Excellent!") # Look for specific app components if "infectious diseases agent builder" in text: print("šŸŽ‰ ID AGENTS INTERFACE DETECTED!") print("šŸš€ Your app is now running successfully!") break elif "agent builder" in text: print("šŸ¤– Agent builder detected - app is working!") break elif "get started" in text: print("šŸŽÆ Landing page detected - app loading...") elif "gradio" in text: print("šŸ“± Gradio framework active...") elif "error" in text: print("āš ļø Error detected in response") # Show more context if error if "chatbot" in text and "type" in text: print("šŸ” Possible Chatbot type error detected") elif "building" in text or "preparing" in text: print("šŸ”„ Still building...") else: print("šŸ“± Response received, analyzing...") elif response.status_code == 401: print("šŸ” Status 401: Authentication/build page") elif response.status_code == 502: print("šŸ”§ Status 502: Server starting/restarting") else: print(f"āŒ Unexpected status: {response.status_code}") # Show detailed preview for debugging preview = response.text[:500].replace('\n', ' ').replace('\r', '') print(f"Content preview: {preview[:200]}...") # Look for specific error patterns error_patterns = [ "chatbot.__init__", "unexpected keyword argument", "type", "gradio", "failed to launch" ] for pattern in error_patterns: if pattern in text: print(f"šŸ” Detected pattern: '{pattern}'") if attempt < 7: print("ā³ Waiting 20 seconds...") time.sleep(20) except Exception as e: print(f"āŒ Request failed: {e}") if attempt < 7: time.sleep(20) print(f"\nšŸŽÆ FINAL ASSESSMENT:") print(f"Visit: {url}") print("\nšŸ” Expected to see:") print("• Landing page with 'Infectious Diseases Agent Builder' title") print("• 'Get Started' button") print("• Simple chatbot interface") print("• No Gradio/Chatbot error messages") print("\nšŸ”‘ If successful, next actions:") print("• Add OPENAI_API_KEY in HF Space settings") print("• Add SERPER_API_KEY in HF Space settings") print("• Test agent creation functionality") print("• Verify full agent builder workflow") if __name__ == "__main__": comprehensive_monitor()