Codex CLI requests consistently cut off at ~150s (stream disconnected); please increase or make timeout configurable

Resolved 💬 4 comments Opened Sep 11, 2025 by PoseidonLi0514 Closed Sep 29, 2025
💡 Likely answer: A maintainer (aibrahim-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.33.0

Which model were you using?

gpt-5

What platform is your computer?

Linux 6.14.0-1011-aws x86_64 x86_64

What steps can reproduce the bug?

Summary:
Codex CLI requests are consistently cut off at around 150 seconds, which makes it difficult to complete complex coding tasks that require longer reasoning and multi-file edits. The stream terminates with the error shown below. The VS Code extension seems to allow a longer timeout and often completes the same tasks, but the exact duration is unclear.

---

Steps to Reproduce

  1. Open Codex CLI and start a session with streaming enabled.
  2. Ask Codex to implement a complex, multi-file refactor or generate substantial code with tests (e.g., multi-step agent flow that applies patches and explains changes).
  3. Let the model think and stream for a while without interrupting.
After approximately 150 seconds, the stream stops and the CLI reports an error.

Error message

stream error: stream disconnected before completion: Transport error: error decoding response body

What is the expected behavior?

  • Long-running requests should be allowed to finish streaming if the model is still producing output.
  • The timeout should be longer by default (e.g., 5–10 minutes), or at least configurable via a flag or environment variable.
  • The timeout value should be consistent (or clearly documented) across the CLI and the VS Code extension.

What do you see instead?

  • Requests consistently terminate near 150s with a transport/stream decoding error.
  • Complex tasks (long reasoning, multi-file patches) fail to complete in the CLI.

Additional information

  • Network is stable; this occurs across multiple sessions and prompts.

Impact

  • High: Complex refactors, larger code generation, and longer reasoning sessions regularly fail in CLI usage.
  • This forces users to split work into many smaller prompts or switch tools.

View original on GitHub ↗

4 Comments

aibrahim-oai contributor · 11 months ago

Do you see this still on the latest version?

editnori · 11 months ago

I do on the ide on 0.4.12

Asignment"},{"type":"agent_reasoning","text":"Analyzing assertion polarity inconsistency**"}],"rollout_path":"C:\\Users\\Layth M Qassem\\.codex\\sessions\\2025\\09\\20\\rollout-2025-09-20T23-57-41-01996aa2-8d67-7692-913f-cb7c2c1191cf.jsonl"}}
2025-09-21 08:22:21.754 [warning] CLI: codex_core::codex: stream disconnected - retrying turn (1/5 in 206ms)...
2025-09-21 08:22:24.526 [warning] CLI: codex_core::codex: stream disconnected - retrying turn (2/5 in 390ms)...
2025-09-21 08:22:28.872 [warning] CLI: codex_core::codex: stream disconnected - retrying turn (3/5 in 754ms)...
2025-09-21 08:22:33.399 [warning] CLI: codex_core::codex: stream disconnected - retrying turn (4/5 in 1.561s)...
2025-09-21 08:22:38.655 [warning] CLI: codex_core::codex: stream disconnected - retrying turn (5/5 in 3.097s)...

Even in new chats it just will reoccur

ae-openai contributor · 11 months ago

This is fixed on current versions. Please re-open if you're seeing otherwise!

editnori · 11 months ago

Yes def fixed!!!

This is fixed on current versions. Please re-open if you're seeing otherwise!