Dogmeat usually died, by my own hands at that. Cross my line of fire and well, guess you'll die.
Speaking of stupid AI, how about making it smarter? Lets see, I'm dressed in power armor and I have a plasma rifle and I have a raider coming at me with a pipe. If I was that raider I would be heading in the opposite direction.