Saute: Slice the garlic cloves and rinse the Thai basil. Heat cooking oil in a wok over medium-low heat, then add the sliced garlic and chili flakes, frying for two minutes. Remove the garlic and set aside the chili oil.
Roast the nuts: In a separate pan, roast almonds and pecan nuts over low heat for under two minutes, then grind into a fine powder. Add the Thai basil and fried garlic to the grinder, blending until a paste forms.
Add the condiments: Return the chili oil to medium-low heat and mix in oyster sauce, rice vinegar, butter, sugar, and salt. Stir until combined, then add the pesto, cooking for three minutes while mixing thoroughly.