An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hi Bharath Mohan,
Thanks for sharing the details. Since the same code works when you switch back to GPT 5.2 or GPT 5.4 mini, this strongly suggests the request format is fine and the issue is specific to how GPT 5.4 is selecting or invoking the built in apply patch tool in Azure OpenAI.
First, please double check that apply patch is being sent as a built-in tool in your request exactly as documented. In the apply patch guide, the tool is enabled by including it in the tools array, and when the model decides to use it the response should contain apply patch call items that your app then applies and returns results for. If you are not seeing any apply patch call output at all in the GPT 5.4 response, that means the model is not choosing the tool for that run even though it is present. You can compare a working GPT 5.2 response versus a failing GPT 5.4 response to see whether apply patch call objects appear only in the working case. Apply Patch tool documentation
Next, try a clean isolation test to rule out tool mixing issues. Some users have observed that apply patch works when it is the only tool provided, but stops being used when any additional custom tool is included in the same request. If your request includes other tools, run one test where you remove every other tool and keep only apply patch, then ask for a small file change. If that starts working, a practical workaround is to split your flow into two calls. Use one call that only allows apply patch to produce the diffs, apply them in your environment, then do the next call for further reasoning or follow up. [learn.microsoft.com], [learn.microsoft.com]
Also make sure you are following the expected apply patch loop. The documented flow is that the model emits patch operations, you apply them, then you send back an apply patch call output event with the status and any logs, and you keep the tool enabled so the model can continue editing if needed. If the patch outputs are not being returned back to the model properly, it can lead to the model not continuing the patch workflow reliably.
If you want to help others reproduce this quickly, it would be helpful to share the minimal request payload that works on GPT 5.2 and fails on GPT 5.4, along with whether any other tools are present in the failing request. In the meantime, using GPT 5.4 mini or GPT 5.2 for patch steps and using GPT 5.4 for the reasoning only steps is a reasonable temporary approach until GPT 5.4 tool selection behavior becomes consistent.
I Hope this helps. Do let me know if you have any further queries.
Thankyou!