Actually, the problem is all of the above, and none of the above. If you sneeze, the AI derps. If you mine anything, the AI derps. If you look at him funny, the AI derps.
There's no immediately obvious trigger event for the derping AI, so much !!SCIENCE!! (read Dwarf Fortress forums, lol) is...