Stream disconnected before completion on VPS using ChatGPT OAuth (worked 12 hours prior, reproducible, network verified)

Resolved 💬 2 comments Opened Feb 13, 2026 by patrickcantelmi-eng Closed Feb 13, 2026

What version of Codex CLI is running?

0.101.0

What subscription do you have?

Pro

Which model were you using?

5.3

What platform is your computer?

Ubuntu 25 on VPS

What terminal emulator and version are you using (if applicable)?

Powershell

What issue are you seeing?

Here’s a tighter, engineer-focused version for the “What issue are you seeing?” section:

Issue Observed:

Codex CLI consistently fails with:

stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

OAuth login succeeds (codex login --device-auth completes normally), but any subsequent prompt immediately fails during the streaming response phase.

The failure occurs before any model output is returned and is reproducible across:

Codex CLI 0.101.0 (latest)

Codex CLI 0.100.0 (rolled back)

Manual POST requests to the same endpoint via curl return expected 401 responses and do not disconnect, indicating:

TLS is functioning

Network connectivity is stable

Endpoint is reachable

No Cloudflare challenge present

The issue appears isolated to the CLI’s streaming connection handling for OAuth-mode requests to chatgpt.com/backend-api/codex/responses.

This setup worked continuously for ~10 hours the previous day with no configuration changes.

What steps can reproduce the bug?

Use a VPS (datacenter IP) running Ubuntu (x86_64).

Install Codex CLI globally:

bun add -g @openai/codex

Confirm version:

codex --version

(Tested on 0.101.0 and 0.100.0)

Authenticate using ChatGPT OAuth:

codex logout
codex login --device-auth

Complete device authorization in browser (login succeeds).

Run a minimal prompt:

codex "say hello"

Observe immediate failure:

stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

Additional Verification

curl -X POST https://chatgpt.com/backend-api/codex/responses returns expected 401 (no disconnect).

Both --http1.1 and --http2 tested successfully via curl.

Rolling back CLI version does not change behavior.

No local configuration changes between working state and failure state.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗