Heat the oil in a large stockpot or Dutch oven. Saute the onion and white scallions over medium-high heat until soft, 5 minutes. Add the mushrooms and cook until they've reduced in size and begun releasing their liquid, 5 minutes. Stir in the ginger, garlic, and sambal olek or sriracha. Cook until fragrant, 1 more minute.
Carefully pour in the tamari and vinegar (hot vinegar can sting the eyes), scrapping up any brown bits that have formed on the bottom of the pan. Add the stock and bring to a boil. Reduce the heat to medium and simmer for 10 minutes until the flavors have melded. In a small mixing bowl, whisk the cornstarch and 1/3 cup of water to create a slurry. Add it to the pot and simmer the soup until slightly thickened, another 10 minutes.
Remove the soup from the heat and slowly pour in the egg while stirring the liquid. The egg will form soft strings and will cook immediately. Taste the soup and add salt as necessary. Garnish with the green scallions and serve.