If one forgot to make an explicit tnai that he is not accepting the fast when going to sleep, but he asked his family to prepare food for him for melava malka and then inadvertently fell asleep for 2 hours in his clothes on his bed before eating, was he allowed to eat when waking up before alos? (He did not intend to go to sleep for such a long time).
This is a common occurrence that this person is inadvertently overcome by sleep on motzei Shabbos and wakes up in the middle of the night to eat melava malka.
He is allowed to eat when he wakes up. This is for two reasons. Since you only fell asleep inadvertently, and you didn’t go to sleep for the night, then we would not say that the fast has already started for you, since you still have not yet ended the previous day. Especially since this is a common occurrence. Secondly, since you specifically asks others to prepare food for you, it would be no less than having in mind to still eat, and we can rely on that b’dieved to eat even after sleeping before the start of the taanis.
O:CH 564-1. See Kovetz Halachos 2-12, that R’ S. Kaminetsky shlit”a says even more than this. He says that even if a person went to sleep for the night, however he always eats melava malka, and this night he forgot to eat, that he is allowed to eat if he wakes up during the night. The reason being, since it is mitzvah tht he always does, we can assume that he did not want to be mekabel the taanis yet because he didn’t yet eat melava malka.