Reconnecting loop + "Stream disconnected before completion: Transport error: network error: error decoding response body" when using GPT-5.2-Codex (high thinking) in VS Code & CLI

Resolved 💬 3 comments Opened Dec 23, 2025 by elecdot Closed Dec 23, 2025
💡 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.76.0. Bug found when using the Codex VS Code extension 0.4.56 (but reproducible via the Codex CLI)

What subscription do you have?

Plus

Which model were you using?

gpt-5.2-Codex

What platform is your computer?

Host: Microsoft Windows NT 10.0.26200.0 x64; Running on WSL: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

When using the Codex VS Code extension (reproducible via the Codex CLI) with the GPT-5.2-Codex model in high thinking mode, requests eventually fail repeatedly with:

Reconnecting 1/5 …
…
Reconnecting 5/5 …
Stream disconnected before completion: Transport error: network error: error decoding response body

This behavior renders long-running or extended reasoning sessions unstable / unusable after a short period of successful operation. Similar patterns appear across environments and multiple recent reports.([GitHub](https://github.com/openai/codex/issues/8302?utm_source=chatgpt.com "stream disconnected before completion: Transport error ..."))

Key observations from my environment:

  • VPN / proxy is stable and does not drop mid-session.
  • Proxy IP does not change and other traffic (e.g., ChatGPT web) remains functional.
  • The issue is not created by every request — it tends to occur after some usage in a session.
  • In same session, simply switching:
  1. model → works (e.g., GPT-5.1-Codex-Max),
  1. thinking level (high → middle) → works,

indicates the failure correlates with the _combination of GPT-5.2-Codex + high settings + sustained inference_.

What steps can reproduce the bug?

  1. Open VS Code with the Codex extension configured.
  1. Connect successfully to a GPT-5.2-Codex (high thinking) session.
  1. Issue multi-turn or multi-step prompts (e.g., coding tasks or extended conversation).
  1. Observe connection output repeating:

``
Reconnecting 1/5 …
…
Reconnecting 5/5 …
Stream disconnected before completion: Transport error …
``

  1. Confirm that switching either model or thinking mode in the same session can temporarily restore functionality.

What is the expected behavior?

  • A stable, completing streaming response for each valid prompt without repeated reconnection attempts or premature disconnects.
  • Session should either:
  • stream the full response, or
  • fail in a solid, meaningful error once per request, but not loop reconnect multiple times until eventual hard disconnect.

---

Actual Behavior

  • After some initial success, the session goes into a reconnect loop and ultimately fails with a “stream disconnected” transport error.
  • This behavior often requires exiting and restarting Codex sessions, and impacts both editor workflows and CLI reconstructions.
  • Behavior is reproducible across:
  • Codex VS Code extension,
  • Codex CLI runs,

Additional information

Attempts & Workarounds Tried

  • Verified network connectivity is stable and not dropping mid-session.
  • Switched models within the same session (GPT-5.1-Codex-Max) — solves reconnection for that session.
  • Switched thinking strength (high → middle) — also temporarily works.
  • Restarting sessions / re-auth does not prevent eventual recurrence. (temporarily works at begin)

---

Feedback

A simple attempt for /feedback: 019b3f46-a0c0-74f2-979e-9f72dffc2a12

---

Hope will help :)

related issues I found:

  • [#5679]
  • [#8302]

---

Note: I am not a native English speaker. This bug report was drafted with the assistance of ChatGPT. If there are parts that seem inconsistent or awkward, it may be due to edits I made when adapting the draft—please excuse any mistakes.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 8 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6710
  • #6398
  • #6397

Powered by Codex Action

etraut-openai contributor · 8 months ago

Thanks for reporting. We're aware of this issue and are working on a fix. We're using #8302 to track the issue.

Groverlee · 4 months ago

Environment

  • codex-cli version: 0.121.0 (latest as of 2026-04-19)
  • Install path: /home/groverlee/.claude/plugins/cache/openai-codex/codex/1.0.3/
  • Node.js: v18.19.1
  • OS: Linux (Ubuntu, kernel 6.17.0-20-generic)
  • Auth method: ChatGPT OAuth (active, verified)
  • Model: gpt-5.4 (with model_reasoning_effort = "xhigh" in ~/.codex/config.toml, but also reproduces on medium)
  • Workflow: Using codex-companion.mjs review --background from Claude Code plugin wrapper

What happens

/codex:review and /codex:rescue consistently fail on one specific repository with the following pattern:

[codex] Starting Codex review thread.
[codex] Thread ready (019da88e-7dd5-7203-9a24-ec1bc6acb711).
[codex] Reviewer started: current changes
[codex] Codex error: Reconnecting... 1/5
[codex] Codex error: Reconnecting... 2/5
[codex] Codex error: Reconnecting... 3/5
[codex] Codex error: Reconnecting... 4/5
[codex] Codex error: Reconnecting... 5/5
[codex] Codex error: Reconnecting... 1/5  (second round)
[codex] Codex error: Reconnecting... 2/5
...
[codex] Codex error: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
[codex] Reviewer finished.
[codex] Assistant message captured: Review was interrupted. Please re-run /review and wait for it to complete.
[codex] Turn failed.

After Reviewer started: current changes, the stream stays at zero bytes of payload for 60-90 seconds, then enters the Reconnecting loop and eventually dies. No reasoning tokens, no output text — nothing is emitted.

Scope of reproduction

On this one repository, across a single session (2026-04-19 night → 2026-04-20 morning):

| Attempts | Result |
| -------- | ----------------------------------- |
| 20 | 0 successful, 20 same-mode failures |

The same account (groverpumc@gmail.com, ChatGPT OAuth) previously completed a full /codex:review cycle on a different, smaller repository (test_cc_code) earlier in the same evening, returning a 9-issue review→fix→verify loop in ~8 minutes. So the auth, binary, and network path work in general — the failure is bound to this particular repo or the repo's diff pattern.

What I tried (eliminated as causes)

  • Plugin reinstall (npm install -g @openai/codex): no change.
  • codex logout → rm ~/.codex/auth.json → codex login: no change.
  • model_reasoning_effort: tested xhigh and medium, both fail identically.
  • Review gate toggle (enable / disable): no effect on manual review failures.
  • OPENAI_API_KEY: not set (no conflict with ChatGPT OAuth).
  • MCP servers: ~/.codex/config.toml has no [mcp_servers.*] entries.
  • Diff size: fails on both a 48-line single-file diff and an 800-line multi-file diff.
  • Working-tree scope vs. branch scope: both fail the same way.
  • experimental_use_rmcp_client: not set (default).

Minimum reproduction

  1. git init a repository.
  2. Add one small file (e.g., a 48-line shell script).
  3. git add <file> so the working tree has a staged diff.
  4. Run /codex:review --background (or node codex-companion.mjs review --background).
  5. Observe: thread is ready, reviewer starts, then zero-byte silence for ~60s → Reconnecting 1/5 → … → stream disconnected.

Request

If this is a known issue tracked under an existing ticket, please point me there and I'll add my logs as an additional datapoint. Otherwise, any diagnostic information you need (full session log, Codex session IDs, etc.) I can provide.

Related open issues that look similar: #13811, #13245, #8465, #14583.