Preheat oven to 350ºF. Slice the garlic heads in half along their equator. Place together in a large piece of foil. Wrap tightly and roast until softened and golden brown (about 30 minutes).
While the garlic is cooking, start the soup. Heat a soup pot over medium heat. Add the oil and sauté the onions, carrots, celery, and thyme until softened and just starting to brown (about 5 minutes). Add the stock. Taste and adjust seasoning with salt and pepper.
When garlic is cool enough to handle, squeeze out the garlic and discard the skins. Stir the garlic into the soup.
Add the ditalini and cook until al dente (about 10 minutes). Add the peas and asparagus and cook another 2 minutes or until crisp tender.