IDAgentsFreshTest / monitor_comprehensive.py
IDAgents Developer
Force authentication: Create hf_config.py and ensure auth always applies
cc8b97c
raw
history blame
3.95 kB
#!/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()