This pasta is equally delicious warm and at room temperature.
Preheat oven to broil, with rack about 8 inches below heating element. Brush a rimmed baking sheet with 1 tablespoon oil, and arrange onions on it in a single layer. Brush onions with 2 tablespoons oil; season with salt and pepper. Broil onions until golden brown on top, about 15 minutes. Flip onions and broil until golden brown on other side, 5 to 7 minutes more. Transfer to a large bowl.
Meanwhile, bring a large pot of generously salted water to a boil. Add pasta and cook until al dente; drain. Transfer pasta to bowl with onions. Let cool 15 minutes. Gently stir in cucumber, herbs, remaining 3 tablespoons oil, and vinegar and toss to combine. Season with salt and pepper to taste.