Azure: stream disconnected before completion: response.failed event received
Open 💬 19 comments Opened Jan 26, 2026 by codeofdusk
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.91.0
What subscription do you have?
Azure (Visual Studio Enterprise)
Which model were you using?
gpt-5.2-codex
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal 1.23.13503.0
What issue are you seeing?
Codex runs for a while, then gives me the error:
stream disconnected before completion: response.failed event received
What steps can reproduce the bug?
Sadly no clear str, but it often happens in /review or long-running loops with high reasoning effort.
Uploaded thread: 019bfc27-dd66-7431-96e3-881df4751b68
What is the expected behavior?
Stream completes normally.
Additional information
_No response_
19 Comments
CC @etraut-openai.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This looks like it's an issue that we fixed (or at least mitigated) a couple of weeks ago. Under certain circumstances, the latest models are taking a long time to stream responses, and this can trigger a timeout at the HTTP layer. The fix was to introduce a keepalive on the server side. It's quite possible that the Azure team has not yet integrated this change on their side. You might want to report the issue to them.
In the meantime, could the tiemout (on the Codex CLI side) be made configurable, or is it already?
A client-side fix isn't possible for this. It need to be fixed on the server.
Still facing this issue with gpt-5.3-codex on Azure
@matys1, make sure you're reporting these issues to Azure as well. If it's a connectivity issue on their side, they won't know that you're facing issues if you report it here.
Still getting this and I am using gpt-5.1-codex-mini high. this is frustrating. These issues dont happen on claude code. so to come here and experience it, really defeats the purpose of using codex at all
Most of these the "disconnected before completion" issues turn out to be network connectivity issues — often related to VPNs, proxies, and firewalls. We receive a lot of these bug reports and don't have time to investigate them all. We are working on a connectivity analyzer tool to help users self-diagnose these issues.
As I mentioned above, if you have not already done so, I recommend reporting these issues to Azure as well. If this is a connectivity issue on their side, they will not know about it if you don't report it to them.
same here with xhigh - @etraut-openai where do we report this to Azure?
I was running into this issue and resolved it by increasing the capacity on the Azure deployed model (e.g.
300).This worked for us, thanks!
I kept running into this on Azure with gpt-5.3-codex and 5.4. Built a workaround that auto-retries on stream disconnect and splits large tasks into separate sessions to avoid context overflow and compaction errors.
https://github.com/pauldinu10/codex-smart
It's a PowerShell wrapper that runs each task from a tasks.md file as a fresh codex exec --full-auto session. If the stream drops, it retries automatically up to N times. Not a fix, but makes Codex usable for long migrations.
same here with 5.5 - super annoying!
Hey all, are you still having the issues using azure ai foundry through codex ? If yes I managed to fix the issue (I think). I was experiencing the issue everyday and then I thought about a parameter in azure AI foundry.
When you create a deployment (basically deploy gpt 5.4 or 5.5 model in Azure AI Foundry), you can control the token per minute rate and by default it is set to 250k. I increased it to a million token per minute and it solved the issue.
I think the issue was that once codex reach the limit, it get rate alerte from azure ai foundry which leads to the reconnecting.
<img width="722" height="111" alt="Image" src="https://github.com/user-attachments/assets/e37efba5-f24a-45eb-adcd-3aa8ce2e5817" />
Which account are you in? I can't do that...
It works, thanks!
Changing the token limit from 250k to 1 million solved the issue for me as well. Previously at 250k token limit, I would get the error: "■ stream disconnected before completion: response.failed event received." Following my change to 1 million, it did not happen again.
Using gpt 5.6, still having this issue, on one of the VM it works fine, on the other it does not