fix
Browse files412 unmodified lines4134144154164174184194204214224234247 unmodified lines432433434435436437438439412 unmodified lines"""def extract_space_id_from_history(history: Optional[List[Dict]], username: Optional[str] = None) -> Optional[str]:"""Extract existing space ID from chat history (for updates after followups/imports)Args:history: Chat history (list of dicts with 'role' and 'content')username: Current username (to verify ownership of imported spaces)Returns:7 unmodified lines# Look through history for previous deployments or importsfor msg in history:role = msg.get('role', '')content = msg.get('content', '')# Check assistant messages for deployment confirmationsif role == 'assistant':412 unmodified lines4134144154164174184194204214224234247 unmodified lines432433434435436437438439440441442443444445446412 unmodified lines"""def extract_space_id_from_history(history: Optional[List], username: Optional[str] = None) -> Optional[str]:"""Extract existing space ID from chat history (for updates after followups/imports)Args:history: Chat history (list of lists [[role, content], ...] or list of dicts)username: Current username (to verify ownership of imported spaces)Returns:7 unmodified lines# Look through history for previous deployments or importsfor msg in history:# Handle both list format [[role, content], ...] and dict format [{'role': ..., 'content': ...}, ...]if isinstance(msg, list) and len(msg) >= 2:role = msg[0]content = msg[1]elif isinstance(msg, dict):role = msg.get('role', '')content = msg.get('content', '')else:continue# Check assistant messages for deployment confirmationsif role == 'assistant':
backend_deploy.py+11-4