Spike saw him approach from the town not long after he himself had returned from Rarity’s. Twilight had told him to stay outside to greet Handy when he did eventually come back, which was definitely something he was not looking forward to.