How to Solve GPT-5 ‘reasoning’ Error Without previous_response_id (Item ‘…’ of type ‘reasoning’ was provided without its required following item.)

I was running my chat service using previous_response_id, but when I added the GPT-5 model, reasoning became mandatory. No matter what I tried, I kept getting item-related errors.

So I tested every possible case and eventually discovered the solution myself—methodically going through each scenario until I found the answer.