Codex model under byok meet Unrecoverable agent model looping detected

I am using Cursor in BYOK mode. When I use it in Agent Mode to add comments to referenced files, the following error occurs.

The model I am using is gpt-5.1-codex, because this model only supports the Responses protocol, while Cursor can only send requests using the Completions protocol. After I implemented protocol conversion in my proxy service, the following error still occurs. Could you please tell me how to solve this problem?

Request ID: 55d91e15-4d27-4d7f-bafd-2c58f586768e
{“error”:“ERROR_CUSTOM_MESSAGE”,“details”:{“title”:“Unrecoverable agent model looping detected”,“detail”:“Unrecoverable agent model looping detected.”,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}

Hey, thanks for the report. This is a known issue with the BYOK + gpt-5.1-codex combo in Agent Mode, and the team is working on a fix.

Main issue: BYOK currently only supports /v1/chat/completions, while GPT-5 and 5.1 models use the /v1/responses format. Even with protocol conversion on the proxy side, loop detection in Agent Mode can produce false positives when using custom models.

I have also found that this issue occurs with the Claude Opus 4.5 model as well, though with a relatively low occurrence rate. What could be the cause?

Details are as follows:

Request ID: e72df936-5974-4048-b48e-801c4f935cc5

{“error”:“ERROR_CUSTOM_MESSAGE”,“details”:{“title”:“Unrecoverable agent model looping detected”,“detail”:“Unrecoverable agent model looping detected.”,“additionalInfo”:{},“buttons”:[],“planChoices”:[]},“isExpected”:true}

Thanks for the extra info about Claude Opus 4.5.

The loop detection issue is most likely caused by the same thing. In Agent Mode, the loop detection system can give false positives when using BYOK. This doesn’t only affect GPT-5/5.1-codex, it can also show up with other models when they’re used through a proxy.

The team is working on a fix, but unfortunately we don’t have an exact ETA yet.