Codex prints this line:

text

⚠️ stream error: stream disconnected before completion: … ; retrying 1/5 in 198ms…

What matters is the part after the colon. The first line is identical, but the text that follows points to completely different causes. Because people copy only the first line when searching, the two problems get mixed together.

Sort out which one you have

Text that followsWhat it means
stream closed before response.completedThe connection dropped
Your input exceeds the context window of this modelYou ran out of context

A. stream closed before response.completed — connection

The stream closed before the response finished. Public issues repeatedly report that the same account and version behave differently on a different network. One reporter noted it works on their office machine but fails on their personal one. [community report]

What to check:

  1. Retry on another network — tether to a phone and see if it changes. If it does, the problem is on the network side
  2. Proxy, VPN, or corporate firewall — middleboxes sometimes cut long-lived streaming connections
  3. Let the retries runretrying 1/5 means Codex is already retrying. If it succeeds after a few attempts, that points to an intermittent connection

B. Your input exceeds the context window — context

This has nothing to do with the network. You exceeded what the model can accept.

Public issues report that running /compact close to the context limit appeared to succeed and showed 100% context available, after which every follow-up message failed with this error. [community report]

What to do:

  1. Start a new session — the most reliable option. Paste a summary forward if you need continuity
  2. Do not postpone /compact until you are nearly out — run it while you still have room
  3. Do not feed whole large files — read only the range you need

Why this is still open

Over a hundred public issues carry this exact message, reported across many versions, including one filed on 2026-07-26. No official fix announcement was found at the time of writing. [unconfirmed]

So there is no "upgrade to version X and it goes away" answer here. Sorting your case into A or B using the text after the colon is the most practical thing you can do right now.