In a heavy-bottomed pot set over medium heat, saute the onions in the oil or butter until translucent, approx. 3-5 minutes.
Add the red pepper, tomatoes, and pesto. Cover and simmer for 30 minutes. Stir in fresh herbs. Using an immersion blender, puree the soup until it reaches the desired consistency. Alternatively, transfer the tomato mixture to a blender in small batches. Add back to the pan.
Add sugar to taste to balance the acidity of the tomatoes. Season with salt and pepper to taste. Garnish as desired and serve.