In a large, wide pot, over medium heat, add the oil and the onions. Fry slowly until the onions start to soften and go golden brown – about 10-15 minutes.
Add the mushrooms, thyme & fennel, turn the heat up and continue to fry (stirring often) until the mushrooms release their moisture and go soft and dark (about 10-15 minutes).
Add the balsamic vinegar and stir until it has reduced. Season with salt & pepper and leave to cool for 15 minutes.
On a large baking tray lined with baking paper, lay out the sheet of puff pastry horizontally. Add the filling horizontally down the centre of the pastry, then fold over the sides to create a long log.
Use a fork to seal the edges, then turn it over carefully. Score with a knife, brush with egg and sprinkle with sesame.
Bake in a preheated oven at 200 C for 30-35 minutes.