Cut the tomatoes into the quarters and finely chop the brown onion.
Heat 1 tablespoon of oil in a large pot or deep pan and brown the onions for 1-2 minutes.
Add the tomatoes, cover with a lid, and cook for 20 minutes, until the tomatoes are soft, stirring regularly. Whilst stirring break up the tomatoes to form a tomato sauce.
Add 1 cup of sambal sauce and stir for a few minutes on low heat.
Add ½ cup of petai beans and continue to stir for another few minutes on low heat.
Cook the spaghetti until al dente.
Serve the spaghetti with the sambal and tomato sauce and enjoy!