codex icon indicating copy to clipboard operation
codex copied to clipboard

Stream disconnected before completion: Transport error: network error: error decoding response body

Open shermju opened this issue 10 months ago • 10 comments

What version of Codex is running?

codex-cli 0.92.0

What subscription do you have?

PRO

Which model were you using?

5.2 Codex

What platform is your computer?

Darwin 25.2.0 arm64 arm

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

VSCode

What issue are you seeing?

Reconnecting... 1/5 (1h 31m 00s • esc to interrupt) └ Stream disconnected before completion: Transport error: network error: error decoding response body

What steps can reproduce the bug?

Run a workflow for an extended period of time.

What is the expected behavior?

Not to do this?

Additional information

Reconnecting... 1/5 (1h 31m 00s • esc to interrupt) └ Stream disconnected before completion: Transport error: network error: error decoding response body

shermju avatar Jan 27 '26 19:01 shermju

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

  • #8465
  • #8351
  • #9872
  • #8775
  • #8294

Powered by Codex Action

github-actions[bot] avatar Jan 27 '26 19:01 github-actions[bot]

Please use the /feedback slash command to upload your logs and session details, then post your thread ID here.

etraut-openai avatar Jan 27 '26 19:01 etraut-openai

This sounds similar to my issue, the TLDR was prompts that create large output tokens seem to break streaming as of current. If you can break your prompt into separate individual calls that generate smaller outputs it will likely work, or refactor to require smaller output size. I spent a ton of time dealing with this and it turned out to be 100% the number of output tokens it was trying to create.

MisterRound avatar Jan 27 '26 20:01 MisterRound

This worked for me:

The issue was a stale, cached authentication session in the local config (it was prioritizing an old/limited API Org instead of my ChatGPT subscription).

  1. Kill lingering processes and remove the cached auth file:
pkill -f codex
rm ~/.codex/auth.json
  1. Start fresh (forcing no env vars to ensure a clean login):
env -u OPENAI_API_KEY -u OPENAI_ORGANIZATION codex
  1. Select "Sign in with ChatGPT" when prompted.

Lmk if it also works for you or helps?

ahmed-ela avatar Jan 28 '26 04:01 ahmed-ela

I've only ever been signed in on this account. Never utilized codex without a subscription.

shermju avatar Jan 28 '26 15:01 shermju

@etraut-openai This is the same error string/title as #9872 ("stream disconnected before completion: Transport error: network error: error decoding response body").

If you’re trying to reduce duplicates/noise, I think this can be closed as a duplicate of #9872 so reports/repros stay centralized.

swordfish444 avatar Jan 28 '26 17:01 swordfish444

This is a very generic error, and there can be multiple causes. I'd like to keep this issue open until I have some logs to look at.

@papasherms, are you still seeing this? If so, please upload your logs using /feedback and post the thread ID here. Without logs, there's not much I can do to diagnose your issue.

etraut-openai avatar Jan 28 '26 17:01 etraut-openai

@etraut-openai Thread ID: 019c05c0-0c2a-7731-935e-15c75c883627

shermju avatar Jan 28 '26 17:01 shermju

I also just noticed another bug where if I drag an image to the CLI it puts the image the message input for all open CLI agents that are running...

shermju avatar Jan 28 '26 17:01 shermju

@papasherms, I don't see any evidence of a transport error in the logs you uploaded. Did you repro the problem immediately before uploading those logs?

etraut-openai avatar Jan 28 '26 19:01 etraut-openai