Repository navigation
Description
Codex app version
Desktop Codex: 26.608.12217 — released Jun 8, 2026
Platform / plan
- macOS Tahoe
26.5.1 - Apple Silicon MacBook Pro
- Pro plan
- Mode: GPT-5.5 Fast
Related feedback ID
019eb48b-00d0-7b91-b50a-cbd119bb5c4c
Summary
I am seeing a serious connection stability issue where the same Codex task repeatedly hits:
stream disconnected before completion: idle timeout waiting for websocket
This is not a one-time disconnect. It can happen repeatedly within a single task, causing Codex to enter reconnect attempts and interrupting the task flow.
Observed behavior
During one active Codex task:
- Codex begins working normally.
- The stream becomes unstable.
- The UI shows reconnect attempts such as:
Reconnecting 2/5
- The task then reports:
stream disconnected before completion: idle timeout waiting for websocket
- The same kind of timeout can appear repeatedly in the task.
Expected behavior
Codex should maintain a stable websocket/stream connection during a running task. If a temporary timeout happens, Codex should recover cleanly and continue the same task state without repeated failures.
At minimum, Codex should:
- avoid repeated websocket idle timeouts in the same task,
- preserve task state during reconnects,
- resume reliably after a reconnect,
- provide a clear retry/resume path if automatic recovery fails,
- and show a more actionable error message when the stream cannot recover.
Actual behavior
The task repeatedly encounters idle timeout waiting for websocket, which interrupts the workflow and makes the session unreliable.
Why this matters
This is a serious reliability problem. Codex tasks often run for a long time and consume significant usage. If a task repeatedly disconnects because of websocket idle timeouts, it wastes time, breaks continuity, and makes Codex difficult to rely on for normal development work.
Request
Please investigate the websocket idle-timeout behavior and reconnect handling in Codex Desktop. A running task should not repeatedly fail with idle timeout waiting for websocket, especially when the user is actively waiting for Codex to continue.
Activity
github-actions commentedon Jun 11, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
vab2048 commentedon Jul 26, 2026
Seems to be the same issue as reported in Sep 2025 #3355
SteinsHead commentedon Sep 13, 2026
Additional occurrence on Codex 0.154.0: automatic remote compaction V2 stalls for approximately 300 seconds, then retries with the same WebSocket idle-timeout error.
This is a sanitized report from existing logs, not a deterministic reproduction or a claim that the underlying cause is identical to the original issue.
Environment
0.154.0.gpt-6-astra, reasoning effortultra, ChatGPT authentication, built-in OpenAI provider.features.context_management.experimental_mode = true.responses_websocket). Detailed network topology is omitted for privacy; this report does not assert a direct connection.Observed timeline
All times below are UTC on 2026-09-12. Entries are selected fields transcribed from existing structured logs, not a raw log dump.
auto_compact_scope_tokens=246703,auto_compact_scope_limit=244800, andfull_context_window_limit=258400.token_limit_reached=true, butfull_context_window_limit_reached=false.run_auto_compact{reason=ContextLimit phase=MidTurn}and sent the request throughresponses_websocket; this attempt reported a reused connection.remote compaction v2 stream failed; retrying request after delay, withretries=1 max_retries=2andcompact_error=stream disconnected before completion: idle timeout waiting for websocket. Approximately 303 seconds elapsed.At inspection around 17:57 UTC, no successful compaction record or resumed normal model output had appeared for this attempt. This is an observation cutoff, not evidence that the request could never recover. SSH and app-server status reads remained responsive; this does not establish that the outbound model stream was healthy.
There was an earlier occurrence in the same long task: compaction around 16:54:24, followed by the same idle-timeout/retry at 16:59:28. Normal model activity was observed later. The symptom can therefore recur after recovery rather than being only a one-time startup failure.
What this establishes, and what it does not
rust-v0.154.0source,ContextManagementand the default-enabledRemoteCompactionV2are separate features, andrun_auto_compactselects V2 using provider capabilities andRemoteCompactionV2. Disabling the experimental flag is not equivalent to disabling V2 or automatic compaction.Relevant source: feature definitions and automatic compaction dispatch.
Suggested investigation and regression coverage
Related symptom report: #44464 (compaction with TLS EOF/fallback errors), but not asserted to have the same cause. PR #44487 preserves incoming prompts on pre-turn compaction failure; that is valuable but is not itself a fix for this mid-turn WebSocket idle timeout.
No private conversation content, task IDs, hostnames, IP addresses, project paths, credentials, raw headers, or raw logs are included. No running tasks were interrupted or configuration changed while collecting this evidence.
machineyearningengineer commentedon Sep 23, 2026
Additional occurrence on macOS 27.0 with Codex CLI 0.156.1 (23 September 2026). This is a sanitized summary of local diagnostic logs, not a deterministic reproduction.
A GPT-6 Sol (medium) turn started at 17:59:08 UTC. It produced no completed model response or tool call. At 18:04:10, the client logged a sampling retry with
stream disconnected before completion: idle timeout waiting for websocket; the turn was cancelled at 18:05:29 after 381 seconds. A later Sol turn starting at 18:29:58 was cancelled after 107 seconds without a completed response or tool call; it ended before the approximately five-minute idle timeout, so I cannot assign the same error to that turn. A subsequent GPT-5.5 (low) request completed in 49.8 seconds, with a recorded first-token time of 17.7 seconds.The noteworthy pattern is that idle-timeout retries were logged across several concurrent tasks and models on the same host:
Completed Sol turns in the affected task had recorded first-token times around 5–9 seconds. The simultaneous cross-model timeouts suggest a shared transport or upstream problem rather than a consistently slow Sol model. The logs do not identify whether the root cause was the local network, client connection handling, or the service.
The five-minute delay before retry is especially disruptive because the UI can appear to be thinking with no actionable indication of the stalled stream. It would help to distinguish time waiting for the first response event from model computation and to detect or surface a dead stream sooner.