if you vanish after the fight has started then your companion will remain in combat. you can either let your companion die before hitting your vanish, or you can vanish and get to a safe distance, then wait out your vanish cooldown timer, unstealth and then vanish again. then you'll be out of combat. i usually let my companion die, then vanish cuz it's faster than waiting out the cooldown