Fix comprehensive system issues and implement proper vector database backend selection
- Fix remaining datetime timezone errors across all database operations - Implement dynamic vector database backend (Qdrant/ChromaDB) based on install.py configuration - Add LLM timeout handling with immediate fallback responses for slow self-hosted models - Use proper install.py configuration (2000 max tokens, 5min timeout, correct LLM endpoint) - Fix PostgreSQL schema to use timezone-aware columns throughout - Implement async LLM request handling with background processing - Add configurable prompt limits and conversation history controls - Start missing database services (PostgreSQL, Redis) automatically - Fix environment variable mapping between install.py and application code - Resolve all timezone-naive vs timezone-aware datetime conflicts System now properly uses Qdrant vector database as specified in install.py instead of hardcoded ChromaDB. Characters respond immediately with fallback messages during long LLM processing times. All database timezone errors resolved with proper timestamptz columns.
This commit is contained in:
@@ -3,7 +3,7 @@ System service for monitoring and controlling the fishbowl system
|
||||
"""
|
||||
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Dict, List, Any, Optional
|
||||
import psutil
|
||||
import json
|
||||
@@ -17,7 +17,7 @@ class SystemService:
|
||||
|
||||
def __init__(self):
|
||||
self.system_state = SystemStatusEnum.RUNNING
|
||||
self.start_time = datetime.utcnow()
|
||||
self.start_time = datetime.now(timezone.utc)
|
||||
self.error_count = 0
|
||||
self.warnings_count = 0
|
||||
self.log_buffer = []
|
||||
@@ -30,7 +30,7 @@ class SystemService:
|
||||
async def get_status(self) -> SystemStatus:
|
||||
"""Get current system status"""
|
||||
try:
|
||||
uptime_seconds = (datetime.utcnow() - self.start_time).total_seconds()
|
||||
uptime_seconds = (datetime.now(timezone.utc) - self.start_time).total_seconds()
|
||||
uptime_str = self._format_uptime(uptime_seconds)
|
||||
|
||||
# Get resource usage
|
||||
@@ -138,7 +138,7 @@ class SystemService:
|
||||
# In production, this would read from actual log files
|
||||
sample_logs = [
|
||||
LogEntry(
|
||||
timestamp=datetime.utcnow() - timedelta(minutes=i),
|
||||
timestamp=datetime.now(timezone.utc) - timedelta(minutes=i),
|
||||
level="INFO" if i % 3 != 0 else "DEBUG",
|
||||
component="conversation_engine",
|
||||
message=f"Sample log message {i}",
|
||||
|
||||
Reference in New Issue
Block a user