It's quite tricky as they optimize the agent loop, similar to codex.
It's probably not enough to have answer-prompt -> tool call -> result critic -> apply or refine, there might be a specific thing they're doing when they fine tune the loop to the model, or they might even train the model to improve the existing loop.
You would have to first look at their agent loop and then code it up from scratch.