Reverts openai/codex#3538 It panics on forking first message. It also calculates the index in a wrong way.