Tesla’s stock rose due to optimism surrounding Elon Musk’s AI and robotics ventures, despite ongoing challenges in the auto business.