It seems that it's based on the enemy movement range, i.e. they wake up when lizardman is 2 tiles away but would ignore a warrior until it's on adjacent tile. I'm not sure now but i think I once had a worker stopping when there was no enemy visible, I think it was a lizardman within attack range but still covered with fog of war.