Preheat oven to 400°F.
Spread tomatoes, onion and garlic in an even layer on a rimmed baking sheet. Drizzle with oil and sprinkle with ¼ teaspoon each salt and pepper; toss to coat. Roast until the tomatoes burst and the onion is very soft, 20 to 25 minutes.
Carefully transfer the tomatoes, onions and garlic to a blender. Add sugar to taste, thyme and the remaining ½ teaspoon salt and ¼ teaspoon pepper. Blend, scraping down the sides as necessary, until very smooth, 1 to 2 minutes. (Use caution when pureeing hot liquids.) Garnish with more fresh thyme, if desired.
