Heat oil in a large nonstick skillet over medium-high heat. Add onion and celery, and season with salt and pepper. Cook stirring occasionally, until softened, about 6 minutes.
Stir in flour and cook for 1 minute. Add thyme, lentils, tempeh, peas, and broth and continue cooking, stirring often, until broth has thickened and vegetables are heated through, about 5 minutes. Set aside.
Preheat the oven to 350 dg. F. Lightly grease a 9 x 9-inch baking dish.
In a medium saucepan, place sweet potatoes, a good pinch of salt, and water to cover. Bring to a boil, reduce heat to a simmer and cook until fork tender, about 10 minutes. Drain well and set aside.
Transfer lentil mixture to casserole and spread evenly. Place potatoes in a medium bowl with milk and cinnamon and mash to desired consistency. Season with salt and pepper and spread on top of lentil mixture, smoothing decoratively with the tines of a fork.
Bake until edges of pie begin to bubble and lentil mixture is piping hot, 30 to 40 minutes. Serve immediately.