Preheat oven to 425F. Grease or line a baking sheet.
Heat the oil in a large skillet over medium heat. When it shimmers, add the onion and cook, stirring occasionally, until golden-brown, 8 to 10 minutes.
While the onion cooks, stir together the cream cheese and mashed potatoes in a medium bowl, then set aside.
Add the mushrooms and thyme, if using, to the onion, and season with salt and pepper to taste. Cook, stirring occasionally, until mushrooms are tender and all the liquid they've released has evaporated, 3 to 5 minutes. Transfer to the bowl with the potato mixture and stir to combine. Set aside to cool. Remove the pie crust from the refrigerator so it can soften slightly.
On a lightly floured work surface, roll out the pie crust into a rough rectangle. Use a sharp knife or pizza cutter to square off the rounded edges, then cut the dough into 8 equal rectangles.
Place a heaping tablespoon of filling about an inch from the bottom of 1 piece of dough, then carefully fold the dough over. Crimp the edges together with a fork. Transfer completed pie-rogies to the prepared baking sheet.
Brush tops of pies lightly with the egg wash, then cut a slit in the top of each to allow steam to escape.
Bake until crusts are golden brown, 25 to 30 minutes. Transfer pies to a rack to cool.