Tesla on Tuesday recalled 1.8 million vehicles over a software issue that could fail to detect an unlatched hood.