To the Instant Pot, layer in the onions, garlic, chicken thighs, dried basil, dried oregano, and salt.
Add in the pasta and vegetable stock, making sure that the pasta is covered with the stock. Do not mix.
Place the lid on the Instant Pot, set it to sealing, and then press the manual button, setting the pressure cooker to 7 minutes.
Once done, quick release the steam. If you have too much liquid, you are welcome to drain it.
Add in the pesto sauce, peas, and baby spinach. Stir to combine.
Add in parmesan if using and stir to combine.