Skip to content

macOS Desktop: repeated WebSocket reconnects followed by 15-minute HTTP fallback timeout in image-heavy workflows #56913

Open

Description

@maomaoyu403

Summary

Codex Desktop on macOS repeatedly stalls on Connecting/Reconnecting during image/video workflows. One long conversation recovered after WebSocket-to-HTTP fallback, but later the HTTP retry itself waited over 15 minutes and returned 408. A separate newer conversation also disconnected.

Related: #55730 and #18960. This report adds HTTP-fallback timeout evidence and a separate newer-conversation observation. Please merge/close as a duplicate if appropriate.

Environment

  • macOS 26.2, Apple Silicon arm64; ChatGPT sign-in.
  • Incident logs record Desktop client 26.1021.31345 and core client 0.164.0 (not a fresh binary-version assertion).
  • Models: gpt-6.1-sol in the older conversation; gpt-6-astra in the newer one.
  • Clash/Mihomo TUN via a VPS proxy, with WARP egress for ChatGPT/OpenAI. Proxy/network involvement has not been ruled out.
  • All timestamps below: 2026-10-25, UTC.

A: WebSocket retries followed by slow HTTP recovery

  • 05:35:55: turn started.
  • 05:36:00–05:36:20: retries 1/5 through 5/5: stream disconnected before completion: IO error: Broken pipe (os error 32).
  • Reconnection handshakes succeeded between failures.
  • 05:36:28: falling back to HTTP; zstd request body pre_compression_bytes=39290701 post_compression_bytes=28884008.
  • 05:44:37: HTTP 200, about 8 minutes 9 seconds after fallback request preparation.
  • 05:44:40: assistant output resumed.

These are HTTP body sizes, not captured failed WebSocket payload sizes.

B: later HTTP streaming failure and 15-minute timeout

In the same conversation:

  • 08:27:03: HTTP request pre_compression_bytes=52496891 post_compression_bytes=38685415.
  • 08:42:13: HTTP 200 response headers logged.
  • 08:42:17: streaming failed: Transport error: network error: error decoding response body.
  • 08:42:17: retry request pre_compression_bytes=52497435 post_compression_bytes=38685580.
  • 08:57:30: 408 Request Timeout, approximately 15 minutes 13 seconds after retry preparation.
  • Another similarly sized request was prepared immediately afterwards.
  • Recorded context: 338,783 tokens, below the recorded 450,000-token auto-compaction threshold.

C: a newer conversation also disconnected

This is a separate observation, not proof of the same root cause:

  • Context: 86,401 tokens.
  • 15:02:15: retry 1/5: websocket closed by server before response.completed.
  • 15:02:16: WebSocket reconnected successfully.
  • 15:03:39: retry 2/5: IO error: Broken pipe (os error 32).
  • 15:03:40: WebSocket reconnected successfully.
  • No HTTP fallback had appeared at inspection time. Request byte size and Close code were unavailable for this case.

Reproduction and limitations

Observed during extended image/video workflows with retained history and multiple tool calls. No deterministic minimal reproduction yet.

Large HTTP bodies and retained historical images make request size a plausible contributor in A/B, but do not prove a specific WebSocket limit or a shared root cause for every disconnect. Logs do not distinguish upload time, network/intermediary delay, and backend waiting. Stable short ICMP tests do not rule out large-transfer or proxy issues.

Expected behavior / investigation request

  1. Preserve WebSocket Close code/reason; distinguish transient failures from explicit size rejection.
  2. Consider serialized-byte budgets, including retained images, separately from token-based compaction.
  3. Avoid unchanged retries when an explicit size rejection is identified, and choose a supported recovery path.
  4. Investigate HTTP fallback stalls/timeouts rather than assuming fallback alone resolves the problem.
  5. Show actionable progress (retrying, changing transport, waiting for response), instead of prolonged generic Connecting/Reconnecting.

Only sanitized diagnostic excerpts are included: no credentials, private prompts/images, raw transcripts, local paths, proxy addresses, or account/conversation identifiers.

Prepared from local logs and submitted by an assistant at the user's explicit request.

Activity

  1. added
    bug
    app
    connectivity
    on Oct 25, 2026
  2. github-actions commented on Oct 25, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. chipfighter commented on Oct 29, 2026

    @chipfighter

    @maomaoyu403 Waiting more than 15 minutes to continue an image-heavy task sounds rough. For the retained-picture part of your workflow, I built Context Attachment Manager after repeated character-image revisions kept making my Codex chat reconnect. I'm the author.

    It's free and open source, currently v0.9.1 with 560 GitHub Stars. People facing similar image-history problems are using it and sharing feedback. After installation and restarting Codex, automatic selection is on by default. The assistant retrieves originals when needed, including after compaction, instead of carrying every old image into each turn.

    The panel gives you thumbnails, search by remembered visual details, zoomable previews, and control over references to keep selected. Original quality and conversation records are preserved. Management stays on your machine; the plugin doesn't separately collect or upload your pictures or chats.

    https://github.com/chipfighter/context-attachment-manager
    The page has setup steps. Once you're comfortable with it, you can ask Codex or Claude Code to install it for you. It supports Codex Desktop and the local Code tab in Claude Desktop.

    If you're still doing visual work in Codex Desktop, I'd welcome a try and your feedback on whether reducing the carried image history helps in your case.

  4. olafchou commented on Nov 4, 2026

    @olafchou

    Additional observations: Desktop 26.1029.61003 / CLI 0.166.0-alpha.6, retained image history and repeated per-chat stalls

    Adding local observations from 2026-11-04 to this existing issue. The account owner explicitly requested this feedback. These observations resemble the reported symptoms; they do not establish an identical root cause.

    Environment

    • macOS 15.2, Apple Silicon arm64.
    • Desktop app 26.1029.61003, build 24614 (read from the installed bundle).
    • Bundled CLI 0.166.0-alpha.6 (verified with the bundled executable).
    • ChatGPT sign-in; affected model gpt-6.1-sol, high reasoning in the recorded application turns.
    • Local workflows involving webpage inspection, screenshots, generated portraits, and iterative image review.
    • Clash Verge / Mihomo v1.19.32, system proxy and TUN. Multiple existing routes/profiles were tested. There was no physical no-proxy control, so ISP, proxy, intermediary, or service-side involvement has not been ruled out.
    • The affected application configuration used a provider entry named OpenAI, with requires_openai_auth=true, supports_websockets=true, Responses API, and no custom base URL. Diagnostic CLI probes also used temporary overrides that ignored user provider/plugin configuration; those overrides were not applied globally to the affected chats.

    User-visible failure

    Two established image-heavy chats repeatedly stopped making progress while remaining active in the sidebar/Thinking state. Stopping and sending a text-only “continue” did not reliably recover the same chats. Other requests could complete during the investigation, so this was not a demonstrated total connectivity outage.

    This significantly interrupts ordinary multi-turn visual work. The UI does not clearly distinguish uploading retained context, waiting for a response, retrying a failed transport, and actual model thinking. A brief successful tool call can be followed by another prolonged stall.

    Application log measurements

    Two observed HTTP request preparations recorded:

    Affected chat JSON bytes before zstd Bytes after zstd
    A 18,872,804 13,855,507
    B 19,654,286 14,166,423

    These are serialized request-body sizes reported by the client, not measurements of how many bytes the remote server accepted. Later preparations were almost unchanged in size despite short text follow-ups.

    Observed errors included:

    stream disconnected before completion: error sending request
    IO error: Broken pipe (os error 32)
    

    In the HTTP phase, some consecutive preparation/failure/retry events were approximately 10 minutes apart. Earlier WebSocket observations also included repeated failures around 81 seconds after upgrade. These timings vary by request and are not presented as a universal timeout or payload limit.

    Controls and bounded upload experiments

    1. Small real model requests worked on several alternative existing proxy routes. Examples returned HTTP 200, PROBE_OK, and response.completed in approximately 6.5, 7.6, 9.8, and 10.8 seconds. These were actual authenticated model requests, not Google latency tests or WebSocket-upgrade checks.
    2. Earlier in the investigation, an ephemeral native CLI request with a roughly 2.36 MB synthetic PNG reached turn.completed in 73.45 seconds. This was not a strict same-route/same-time comparison with every later failure.
    3. To approximate the larger application bodies without uploading private images/history, a fresh HTTP/1.1 Responses request was built using six distinct synthetic PNGs, low image detail, no tools, low reasoning, and a request for PROBE_OK. The JSON was 18,887,481 bytes, zstd-compressed to 14,170,239 bytes. Distinct images avoided a misleadingly tiny compressed body caused by duplicating identical bytes.
    4. Full-size uploads were not verified successful on the sampled routes. Examples failed during body upload, before response events:
      • Route A: successful application-side send calls covered 3,342,336 bytes before TimeoutError; total elapsed 70.73 seconds.
      • Route B: 9,895,936 bytes before BrokenPipeError; 125.89 seconds.
      • Route C: 3,866,624 bytes before TimeoutError; 44.70 seconds.
      • Additional routes from other existing subscription profiles also had upload-stage failures. Some attempts failed during TLS setup; those are separate observations and do not establish a payload-size cause.
    5. The direct HTTP diagnostic used normal certificate verification and a declared Content-Length, sending the body in 64 KiB application chunks. Counts above mean bytes accepted by successful local send calls, not proof of remote application receipt. It had bounded timeouts; its 15-second per-write timeout could fail earlier than the Desktop client's retry cycle.
    6. Cross-profile controls used temporary local instances of the same installed Mihomo binary, with TUN disabled for those instances and the main system proxy selection left unchanged. They broaden the tested routes but do not eliminate shared local-network/core dependencies or establish that all available routes fail.

    The observation that a small request works therefore does not establish that a large retained-history request will work. Conversely, these failures alone do not prove a Codex-only bug or exclude network/proxy causes. A separate earlier fresh-chat failure involved a much smaller compressed body, so no single fixed size threshold has been established.

    Recovery observed

    With the user's authorization, we created two new chats with concise text-only handoffs and local file paths, without copying the old image history. Both produced assistant commentary and completed multiple real tool calls. The old chats were then archived through the normal app interface; their active turns were confirmed interrupted and their records preserved.

    This is an observed workaround, not proof of a permanent fix or that the underlying visual tasks were completed. The user should not have to repeatedly rebuild chats to continue routine work.

    Reproduction scope

    The user-observed sequence is:

    1. Work normally through multiple image/screenshot/tool turns in one local chat.
    2. Continue with a short text instruction after history has accumulated.
    3. The chat stays active/Thinking, transport retries recur, and substantial historical image bodies are prepared again.
    4. Stop/resend “continue”; the same chat can fail again.
    5. A new lightweight text handoff can begin making progress on the same machine.

    There is no fully deterministic minimal application reproduction yet. The synthetic upload experiment is a separate control, not an exact reproduction of the original conversation.

    Requested engineering investigation

    • Account for serialized request bytes and retained media, separately from token-based context/compaction budgets.
    • Expose whether a turn is uploading, receiving model output, retrying, or waiting on a tool, with actionable errors instead of an indefinitely active spinner.
    • Investigate unchanged large-history retries, WebSocket-to-HTTP fallback, and why a disconnected turn can remain active without useful recovery.
    • Provide a supported way to stop and recover an affected chat, reduce retained media in future requests, and preserve the transcript/source files without manual JSONL or SQLite edits.
    • Clarify whether a known fix or supported setting applies to this exact Desktop/bundled-CLI version.

    Related symptom reports: #32555, #45921, #57725. These references are not assertions that every report has the same cause.

    Privacy: This comment contains only sanitized measurements and error categories. No credentials, subscription URLs, node names/addresses, account or conversation IDs, private prompts/images, raw transcripts, local paths, or original screenshots are included. TLS verification was not disabled; conversation history was not rewritten and databases were not reset.

  5. 942377949 commented on Nov 6, 2026

    @942377949

    Additional reproduction: automatic compaction fails before a text-only reply

    Affected macOS application logs record Desktop 26.1029.61003 and bundled CLI 0.166.0-alpha.6 (ChatGPT sign-in). An established image-heavy conversation repeatedly stalls even when the follow-up requests only a short text reply and prohibits file operations.

    Observed results:

    • One text-only turn took 499341 ms (8m19s). WebSocket retries failed with Broken pipe (os error 32); the client fell back to HTTP and eventually replied.
    • The next turn failed after 252543 ms (4m13s), before normal sampling, in run_pre_sampling_compact, reason=ContextLimit, phase=PreTurn.
    • A temporary switch from GPT-6.1 Sol to GPT-6.1 Terra failed in the same pre-turn compaction stage after 246234 ms (4m06s), with websocket closed by server before response.completed. The original Sol/medium setting has been restored.
    • Restarting the app and stopping/resending did not resolve the affected conversation.

    A successful WebSocket handshake was not sufficient for successful compaction. We did not capture the serialized failing WebSocket message size or Close 1009, so this does not establish a specific payload limit or an identical root cause to other reports.

    In-app feedback with diagnostics has already been submitted successfully. Its ID can be provided privately if maintainers need it. No private conversation title/ID, prompts, images, credentials, raw transcripts, or local file paths are included in this comment.

    Please advise whether there is an official fix or supported in-place recovery that preserves the original conversation and source files, without manual JSONL/SQLite edits or requiring a new conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugconnectivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions