Heat the vegetable oil in a large wok or pan over medium heat.
Add the onion, garlic, ginger, and chopped chili peppers. Stir-fry for a couple of minutes until fragrant.
Add the chili paste and continue to stir-fry for another minute.
Add the tomato sauce, soy sauce, and sugar. Stir well to combine.
Gently place the crab halves into the pan, ensuring they are coated with the sauce. Cover the pan and let the crabs cook for about 10-12 minutes, or until they turn bright orange and the meat is cooked through.
Once the crabs are cooked, remove them from the pan and set aside on a serving plate.
Increase the heat to high and stir the cornstarch mixture into the remaining sauce in the pan. Cook for a minute or two until the sauce thickens.
Pour the thickened sauce over the crabs.
Garnish with chopped spring onions and fresh cilantro leaves.
Serve hot with steamed rice or crusty bread.