You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft Windows NT 10.0.26200.0 x64 (codex in WSL2)
What issue are you seeing?
i am on WSL2 Ubuntu@latest and working on python project. Prompted to analyze project and suggest features which was OK. codex suggests. when i choose one idea it started planning, exploring, updating files and unexpectedly thows below: ■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error
prompt him to continue and after a few steps it's the same. it can finish implementing a feature. the error appears several times during the work process and regardless of the type of work I do with Codex
What steps can reproduce the bug?
idk, random. maybe a size of project > small.
What is the expected behavior?
No response
Additional information
No response
Reacted by Thomas Stokes, fplonka-ft, nha, Vlado Handziski, Geoff Ereth, Manos Kalaitzoglou, Kellen Miller, suspiciousfellow, Ilmari Oranen, t-spar and 10 more
Issues were reviewed and none were found with this error: stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error
NOTE: i moved to 0.59.0-alpha.5 i do not see the error, only reconections but rarely
EDIT: 1h working and was fine :) wrote that's fine received ■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error, hahaha. :/
I am getting this issue on a my mac. Upgraded to 0.60.1 and same problem. It fails with gpt-5-codex and gpt-5.1-codex. It is utterly unusable at this point.
Same here as well, tried latest codex-cli 0.61.0 (windows) and still getting"stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error"
If anyone has Azure support, it's probably worth reporting it there. This isn't a bug in either Azure or Codex per se, it's an integration problem between them. Given that one likely response is to shift from the Azure API to the direct Open AI API (= what we have done), I think Microsoft will be more motivated to fix this than OpenAI...
I reported this to Azure support their suggestion was to up the TKM on the deployed model, this has mostly resolved my issues. I'm going to share this thread with my CSM and the support ticket.
I reported this to Azure support their suggestion was to up the TKM on the deployed model, this has mostly resolved my issues. I'm going to share this thread with my CSM and the support ticket.
@jfreemanwbd Is there any recommendation on what could be a decent TPM, we use it for some PoC only and default 100K was good enough till this stream error popped up?
Out of frustration I just doubled ours to 300k yesterday AM and it's been mostly good, I've not had the error today with some light use, but it did still pop up occasionally yesterday afternoon.
I guess what I'm really wondering about is how we could have been hitting 150k TPM with just myself and one other user on the deployment. Support was unable to point to any place that an error was surfaced indicating this was actually the problem. I'm also going to post this thread in the Microsoft Foundry Discord.
Higher TPM is a workaround, not a fix. The original error is due to rate-limiting but should be handled gracefully. That null is returned throws the breaking error.
This workaround resolved the issue for me. I set the TPM as high as I could and the errors stopped.
Also on azure. Getting this on gpt-5-codex with 200K TpM and gpt-5.1-codex with 100K TpM. I don't see any options to increase, but I can fill out a form to request a quota increase.
On macOS, so issue seems mislabeled.
Also, it does not feel like it is TPM-related. Feels more like time-of day.
E.g. I have been using codex heavily for a few hours, with it taking many iterations and working for a long time. No issue. Then it started popping up. Went looking for a solution. Came here, read the thread. Posted a message. 15 min later, it errors out with this error almost immediately.
I have exaclty the same issue: using GPT-5, GPT-5-codex, GPT-5.1, GPT-5.1-codex models. I've got it in both the codex CLI in windows, as in the CLI using WSL2. I'm working with my own deployed models on Azure AI Foundry.
I don't have the luxury of being able to increase my TPM, but changing the following setting in the config.toml fixed the issue for me..
stream_max_retries = 100
I see the retries move up to 7 or 8 now, and then continue, where it would have previously failed.
Still this is a workaround, not a solution.
Edit: Also happening with GPT-5.2
Edit2: And with GPT-5.2-Codex
Reacted by Esteban A. Vidal, Geoff Ereth, Andrew Riggs, t-spar, Pillema and Julian Hollmann
Activity
github-actions commentedon Nov 15, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
voytas75 commentedon Nov 15, 2025
Issues were reviewed and none were found with this error:
stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Errorvoytas75 commentedon Nov 15, 2025
NOTE: i moved to
0.59.0-alpha.5i do not see the error, only reconections but rarelyEDIT: 1h working and was fine :) wrote that's fine received
■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error, hahaha. :/voytas75 commentedon Nov 15, 2025
jump on 5.1-codex = same situation :(
antonsoo commentedon Nov 15, 2025
Same
thingersoft commentedon Nov 16, 2025
Same here — it seems to occur more frequently when using the *-codex models.
datacatalyst-io commentedon Nov 17, 2025
Same issue on GPT-5. Rolling back to o3 fixes it. codex-cli 0.58.0
Uploaded thread: 019a8beb-ca38-7e33-bf88-bf3879ae83f5
Have closed my duplicate post.
christianvossCaeli commentedon Nov 17, 2025
Same here, even on 0.59.0-alpha.5
vikduf commentedon Nov 17, 2025
Same issue, started happening after 5.1 upgrade (am on azure aswell)
gadogado commentedon Nov 18, 2025
seeing the same behavior for azure on 0.59.0-alpha.6
Zanzavar commentedon Nov 18, 2025
same issue here, on azure as well, started happening after 5.1
9 remaining items
ChrisEdwards commentedon Nov 20, 2025
I am getting this issue on a my mac. Upgraded to 0.60.1 and same problem. It fails with gpt-5-codex and gpt-5.1-codex. It is utterly unusable at this point.
snehginb commentedon Nov 21, 2025
Same here as well, tried latest codex-cli 0.61.0 (windows) and still getting"stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error"
leonarddai-solutino commentedon Nov 21, 2025
same issue here after upgrading to 0.61.0 (Mac) using azure.
codex with openai chatgpt subscription works fine
datacatalyst-io commentedon Nov 21, 2025
If anyone has Azure support, it's probably worth reporting it there. This isn't a bug in either Azure or Codex per se, it's an integration problem between them. Given that one likely response is to shift from the Azure API to the direct Open AI API (= what we have done), I think Microsoft will be more motivated to fix this than OpenAI...
jfreemanwbd commentedon Nov 21, 2025
I reported this to Azure support their suggestion was to up the TKM on the deployed model, this has mostly resolved my issues. I'm going to share this thread with my CSM and the support ticket.
snehginb commentedon Nov 21, 2025
@jfreemanwbd Is there any recommendation on what could be a decent TPM, we use it for some PoC only and default 100K was good enough till this stream error popped up?
jfreemanwbd commentedon Nov 21, 2025
Out of frustration I just doubled ours to 300k yesterday AM and it's been mostly good, I've not had the error today with some light use, but it did still pop up occasionally yesterday afternoon.
I guess what I'm really wondering about is how we could have been hitting 150k TPM with just myself and one other user on the deployment. Support was unable to point to any place that an error was surfaced indicating this was actually the problem. I'm also going to post this thread in the Microsoft Foundry Discord.
azhar-alhasan commentedon Nov 25, 2025
It is so annoying; it’s starting to occur way too frequently. :(
Setup:
Version: v0.63.0
Model: gpt-5.1-codex (medium)
MacOs, VSCode
Error:
■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error
› continue
• Explored
└ Search progressive in api
Read composer.py
Search PayloadGenerator in src
Search build_adapter_registry
Read init.py
■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error
› continue
• Explored
└ List ls
Read architecture.md
Search progressive in architecture.md
Search adapter in architecture.md
■ stream disconnected before completion: failed to parse ErrorResponse: invalid type: null, expected struct Error
JariHuomo commentedon Nov 25, 2025
This workaround resolved the issue for me. I set the TPM as high as I could and the errors stopped.
adamal commentedon Nov 26, 2025
Also on azure. Getting this on gpt-5-codex with 200K TpM and gpt-5.1-codex with 100K TpM. I don't see any options to increase, but I can fill out a form to request a quota increase.
On macOS, so issue seems mislabeled.
Also, it does not feel like it is TPM-related. Feels more like time-of day.
E.g. I have been using codex heavily for a few hours, with it taking many iterations and working for a long time. No issue. Then it started popping up. Went looking for a solution. Came here, read the thread. Posted a message. 15 min later, it errors out with this error almost immediately.
eavidal commentedon Nov 27, 2025
FYI increasing my TPM did the trick for me too
Pillen commentedon Dec 1, 2025
I have exaclty the same issue: using GPT-5, GPT-5-codex, GPT-5.1, GPT-5.1-codex models. I've got it in both the codex CLI in windows, as in the CLI using WSL2. I'm working with my own deployed models on Azure AI Foundry.
I don't have the luxury of being able to increase my TPM, but changing the following setting in the config.toml fixed the issue for me..
stream_max_retries = 100
I see the retries move up to 7 or 8 now, and then continue, where it would have previously failed.
Still this is a workaround, not a solution.
Edit: Also happening with GPT-5.2
Edit2: And with GPT-5.2-Codex
etraut-openai commentedon Mar 29, 2026
This bug report hasn't received any new upvotes or posts in over two months. I presume that the issue has been fixed on the Azure side. Closing.