Step 1In a large, heavy skillet, heat the oil over medium heat. Add the onion and cook, stirring occasionally, until it is tender and light golden, about 10 minutes. Add the jalapeno pepper, if using, the garlic and the cumin, and cook over low heat, stirring, for 2 minutes. Remove from heat.
Step 2Chop the chickpeas in a food processor with a pulsing motion, leaving a few small pieces. Transfer the chickpeas to a medium bowl. Add the onion mixture and mix well. Season to taste with salt, pepper and cayenne.
Step 3Unfold one pastry sheet on a cool, lightly floured surface (keep the other sheet refrigerated). Roll the pastry sheet out to a 12-by-9-inch rectangle. Cut the sheet into 12 (3-inch) squares.
Step 4Spoon 2 teaspoons of the filling in the center of each square. Brush the edges of the dough around the filling with the beaten egg. Fold the pastry over the filling to form triangles. Pinch the edges together firmly.
Step 5Sprinkle 2 foil-lined baking sheets with water. Place the filled pastries onto one of the sheets. Brush the center of each pastry with beaten egg, and sprinkle over the sesame seeds. Refrigerate the sheet for at least 30 minutes before baking. Meanwhile, roll out the second puff pastry sheet and form the rest of the pastries. This makes about one-half cup more filling than is needed for the pastries; the remaining filling can be used as a spread for toast or crackers.
Step 6Heat the oven to 400 degrees. Bake the pastries for 10 minutes, then rotate each baking sheet and continue baking until the pastries are puffed and browned, about 6 minutes more. Serve hot or warm.