Skip to content

Bug: image-heavy chats repeatedly reconnect and become very slow #20805

Open

Description

@vyctorbrzezowski

Summary

When a Codex App chat accumulates many attached images over the course of a conversation, the app starts reconnecting on nearly every new prompt/steer/follow-up and the thread becomes extremely slow.

Reconnecting retries

What version of the Codex App are you using (From “About Codex” dialog)?

26.429.30905

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.3.0 arm64 arm
macOS

What issue are you seeing?

When a chat accumulates many attached images over the course of a conversation, the Codex app eventually starts showing Reconnecting... on almost every interaction: new prompts, steering messages, follow-ups, etc.

This is not necessarily caused by attaching many images in a single prompt. In my case, it happens after a longer workflow where images are gradually added across the conversation: several screenshots in one prompt, another image later, more UI iteration screenshots after that, and so on.

Once the chat reaches that state, each new interaction often goes through multiple reconnect attempts, usually up to 5/5. After the retries finish, the run may continue, but the chat becomes extremely slow.

This has been happening consistently for roughly the last 10 days, around late April / early May 2026.

Common cases where I hit this:

  • Browser/sidebar annotation runs that attach many images during the work
  • UI iteration workflows with many screenshots across multiple prompts
  • Longer chats where images accumulate gradually over time

What steps can reproduce the bug?

  1. Start a Codex App chat.
  2. Work through a longer image-heavy flow.
  3. Attach images gradually across the conversation, not necessarily all in one prompt.
    • Example: several screenshots in one prompt, another screenshot later, then more UI iteration screenshots in follow-up prompts.
  4. Continue sending prompts, steering messages, or follow-ups after the thread has accumulated many attached images.
  5. Observe repeated Reconnecting... messages, often reaching 5/5.
  6. After the reconnect cycle completes, the chat may continue, but interactions become extremely slow.

What is the expected behavior?

Image-heavy chats should remain responsive across the conversation, or degrade gracefully without repeated reconnect cycles on every new interaction.

The app should not repeatedly go through Reconnecting... 2/5, 3/5, 4/5, 5/5 after a thread has accumulated many images.

Additional information

The attached screenshot shows the repeated reconnect messages during a run.

This seems related to accumulated conversation state / attachments over time rather than a one-off network disconnect, because once a chat reaches this state the reconnect behavior tends to repeat on subsequent prompts in the same thread.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on May 2, 2026
  2. Keesan12 commented on May 18, 2026

    @Keesan12

    This feels like attachment accretion is being treated as normal context growth until transport starts flapping.

    The fix probably is not bigger retries. The runtime likely needs an attachment-aware health receipt before each turn: attachment count or weight, reconnect streak, and a threshold where the thread stops accepting more images without a compact-or-summarize step. Otherwise the reconnect loop just hides that the thread is already in a degraded state.

    If you end up adding that kind of receipt layer, I would love to compare it against the same boundary we are handling in MartinLoop, because "responsive chat" versus "attachment-heavy evidence log" feels like the real seam here.

  3. anngrrr commented on May 25, 2026

    @anngrrr

    I may have found an important pattern related to the Windows freezing/reconnect issue.

    In my case, the problem became severe specifically in a long Codex thread containing many image attachments (multimodal workflow). I was frequently using screenshots/images to explain tasks to Codex.

    Symptoms:

    • Windows desktop freezes right after sending a message
    • freezes again after response completion
    • repeated reconnect loops
    • “Not Responding” states
    • progressively worse over time
    • sessions that previously took ~1 minute now can take 20-30 minutes

    The issue did NOT start immediately after updating the app. The update happened earlier, while the severe freezing started later, which makes me suspect a server-side rollout / feature flag interaction.

    My suspicion is that reconnect/recovery logic may be struggling with large multimodal thread hydration/restoration on Windows.

  4. Keesan12 commented on May 25, 2026

    @Keesan12

    That pattern makes the seam clearer: this is probably less about generic Windows slowness and more about long-lived multimodal thread hydration crossing a practical threshold without any operator-visible warning.

    If the team adds a health receipt here, I would make it explicit before send rather than only after reconnect starts:

    • attachment count or weight
    • thread hydration time
    • reconnect streak
    • a degrade flag that switches the thread from "keep accumulating evidence" to "compact or fork first"

    That would give users a readable boundary instead of a mystery slowdown. If you end up testing that kind of threshold, I would genuinely love to compare notes, because this is very close to the same "evidence log versus active working context" boundary we keep hitting in MartinLoop.

  5. vyctorbrzezowski commented on Jun 5, 2026

    @vyctorbrzezowski
    Author

    This is still relevant. So far, been using this skill to counter it:

    https://clawhub.ai/vyctorbrzezowski/codex-session-image-scrubber

    It cleans images/base64 from the session and keeps context, telemetry, etc. Chat becomes much lighter and responsive agian.

  6. YurySolovyov commented on Jun 5, 2026

    @YurySolovyov

    FWIW, I've been telling codex to draw some programmatic art in python as placeholder and then in separate session replace it with something real from Image Gen as workaround.

  7. Bangeanix commented on Jun 18, 2026

    @Bangeanix

    This is still relevant. So far, been using this skill to counter it:

    https://clawhub.ai/vyctorbrzezowski/codex-session-image-scrubber

    It cleans images/base64 from the session and keeps context, telemetry, etc. Chat becomes much lighter and responsive agian.


    This worked beautifully for me!! Thanks a ton! 😃

  8. iamtornado commented on Aug 23, 2026

    @iamtornado

    Adding a current Windows Desktop corroboration, with generated images rather than only manually attached screenshots.

    Environment:

    • Windows 11 Pro x64, build 26200
    • Codex Desktop; the affected session metadata reports Codex core/CLI 0.149.0-alpha.4.1
    • Observed on 2026-08-22

    Sanitized local evidence:

    • The append-only rollout grew to 79,070,850 bytes (~75.41 MiB).
    • The task generated 10 PNG artifacts totaling 21,968,314 bytes (~20.95 MiB).
    • The rollout contains 32 embedded data:image URIs (28 unique payloads), accounting for approximately 43.86 MiB of Base64 text.
    • After six generated images were present, one turn went through WebSocket retries 1/5 through 5/5 over about nine minutes and then logged falling back to HTTP.
    • With seven generated images in history, a later turn repeated the complete 1/5-to-5/5 sequence and HTTP fallback.
    • The retained logs contain 10 retry events and two HTTP fallbacks. Error forms include Connection closed normally, websocket closed by server before response.completed, and Windows os error 10054.

    This confirms that the visible Reconnecting... state was backed by actual response-stream retries and HTTP fallback, not only UI sluggishness. This is not a packet capture, so I cannot claim that the entire rollout was transmitted on every turn or that image bytes alone are the proven root cause. However, the timing and persisted-history growth are strongly consistent with this report.

    Related reports such as #33760 and #24550 suggest generated-image/history payload growth as a possible mechanism. Please prioritize investigation into whether historical inline image payloads are retained or re-serialized into subsequent requests, and whether Desktop can deduplicate, externalize, or compact them before transport. This issue makes longer image-generation workflows increasingly difficult to continue.

    Privacy note: I am not uploading the raw rollout, logs, images, local paths, task ID, or conversation content because they contain private data.

  9. Lyt-May commented on Aug 30, 2026

    @Lyt-May

    Codex desktop 26.825.32147 (build 7303), bundled CLI 0.146.0-alpha.3.1, macOS 26.5.2 arm64.

    Image-heavy UI iteration tasks repeatedly enter “Reconnecting”. A turn referencing four images produced a 7,887,884-byte JSONL record; another with eight assets produced a 12,924,451-byte record. In one occurrence, the last tool output completed at 16:55:05, the task aborted at 16:58:21, the worker exited at 16:58:27, and a new worker started at 16:58:36. Continuing the task then remained at task_started. Narrow unified-log inspection showed no explicit WebSocket, network, crash, or memory error.

    Expected: image data stored out of line or deduplicated, bounded parallel image payloads, and a clear resumable error when a worker is replaced.

    Privacy: raw transcripts, images, project name, username, local paths, and task IDs are omitted.

  10. NeverMissYou12 commented on Sep 28, 2026

    @NeverMissYou12

    Independent macOS reproduction on 2026-09-28: measured persistent slowdown after HTTP fallback

    I am adding a newer reproduction and local diagnostic evidence to this existing issue. The same user-visible pattern still occurs on desktop build 26.924.22138.

    Summary

    After Codex reaches reconnect 5/5 and resumes, subsequent steps remain much slower. Local logs show WebSocket failures followed by HTTP fallback. In affected sessions, later HTTP requests repeatedly prepare large compressed full-context bodies. The matching source version keeps the fallback active for the runtime session.

    This is a reproducible user-observed regression pattern, not a fully isolated root-cause claim. Please investigate transport recovery, large-context request reuse, and any additional usage from retries or incomplete responses.

    Environment

    • macOS 27.0, Apple Silicon / arm64
    • Desktop app 26.924.22138, build 11645
    • Bundled Codex 0.158.0-alpha.2.1
    • Model: gpt-6-astra; reasoning: ultra in the live reproduction and the same-turn before/after map comparison
    • Configured model_context_window = 1000000; the affected live turn reports an effective window of 828400 tokens
    • Timezone: Asia/Shanghai, UTC+08:00
    • Network/proxy cause: not isolated by this investigation
    • In-app diagnostic upload: not submitted; the IDs below are local thread/turn IDs, not feedback-upload IDs.

    Reproduction pattern

    1. Continue an existing long local chat that includes image attachments and tool outputs.
    2. Submit an ordinary follow-up request.
    3. When a model-stream interruption occurs, observe reconnect attempts reaching 5/5.
    4. The task resumes, but subsequent small steps and even a short reply remain slow.

    The interruption was observed naturally, not deliberately injected. These steps describe the observed pattern; they are not a guaranteed deterministic reproduction on another network.

    Live reproduction on 2026-09-28

    All timestamps in this table are UTC.

    Time Observation
    15:34:42 New turn started
    15:35:15.854 Reconnect 3/5; matches the user's 23:35:18 UTC+8 screenshot
    15:35:42.536 Reconnect 5/5
    15:35:51.264 falling back to HTTP
    15:35:51.342–15:36:29.762 Prepared compressed request body 19,100,619 bytes; 38.420 s to HTTP response headers
    15:36:49.884–15:37:23.263 Another 19,102,745-byte compressed body; ~33.38 s to headers

    Thread: 01a0e18e-d877-77e2-9786-7ba94e7258e3
    Turn: 01a0e8a7-6f9c-7ce0-880a-a9d4131955f0

    The stream errors include normal connection closure, Broken pipe, and closure before response.completed. Message/tool activity resumed. The short live snapshot establishes the retry/fallback/repeated-request sequence; the longer-duration slowdown evidence comes from the historical cases below.

    Historical measurements

    Case End-to-end result Local tools / transport evidence
    Presentation revision 24 min 39 s Local commands total ~13.6 s; HTTP bodies 39.46–47.72 MiB
    Later summary document in that chat 57 min 03 s Local commands total ~13.3 s; 18 non-overlapping compression-to-header intervals total 2,820.995 s (~47 min); bodies 47.79–52.57 MiB
    Short thank-you reply 104.427 s; TTFT 99.695 s No tools; 53.54 MiB compressed request body; 84.545 s to HTTP headers
    Map-building turn, same model and effort Median adjacent response-completion interval ~20.5 s before interruption, ~77.5 s after recovery 26 pre-interruption intervals and 12 post-recovery intervals; transition excluded; cache-hit ratio remained around 99%

    Presentation thread: 01a0df21-2db3-77b3-bd14-14ec98c8579a
    Summary-document turn: 01a0e218-acf9-7c80-ba86-e876d53d3b2b
    Short-reply turn: 01a0e250-9a36-73a1-afda-a7c8ccd68267
    Map-building turn: 01a0e209-d6ac-7221-85c0-1852b21dd8f6

    Token usage clarification

    The presentation parent chat records 55 unique model response IDs and 9,225,334 total tokens: 8,265,088 cached input + 922,382 uncached input + 37,864 output. Reasoning tokens are already included in output. This total includes the initial presentation, revision, subsequent summary document, and short reply, rather than the initial presentation alone. Child-agent usage is excluded from this number.

    Per-response increments match the final cumulative total; cumulative snapshots were not repeatedly summed. Repeated logical input accounting can also occur with WebSocket incremental transport. Therefore the entire token total should not be attributed to HTTP fallback, and it does not establish double billing or subscription usage weights. Please audit server-side usage for failed/retried requests separately.

    Matching source and suspected mechanism

    Bundled version matches tag rust-v0.158.0-alpha.2.1, commit 0d9c7cbfa6cf1489f55a8a9542b75ddd2c061807.

    Expected behavior: recovery should avoid leaving every subsequent small step subject to repeated large full-context requests where reuse/recovery is feasible, or clearly surface the degraded transport and a recovery path.

    Measurement limits

    • Time to response headers includes upload, network and server handling/queueing. It is not a pure upload-speed or pure inference measurement.
    • Compressed body sizes are prepared request lengths, not measured network-interface traffic.
    • HTTP 200 headers do not guarantee response.completed. Request counts can exceed recorded model-response usage counts.
    • No equivalent WebSocket byte-size series was retained, so no measured transport byte ratio is claimed.
    • The initial disconnect's cause, extra backend work, and actual billing require server-side investigation.
    • No current controlled restart/network experiment was performed. No account secrets or chat bodies are included.

    Request and supporting evidence

    Please correlate the identified turns with server-side traces, investigate recovery from session-scoped HTTP fallback and full-context requests, and audit incomplete/retried-response usage. Related measured image-upload behavior is reported in #45109; I have not established that every case has the same root cause.

    Selected sanitized evidence is included below; the full sanitized bundle can be provided on request. No ZIP is attached to this comment. The original screenshot is also omitted because it contains unrelated sidebar chat titles.

    Selected sanitized evidence (inline)

    The following are normalized records extracted from the local logs and session usage events; chat bodies, credentials, and private file paths are omitted. All timestamps are UTC.

    Live reproduction thread: 01a0e18e-d877-77e2-9786-7ba94e7258e3
    Turn: 01a0e8a7-6f9c-7ce0-880a-a9d4131955f0

    {"db_id":17179028,"utc":"2026-09-28T15:35:42.536+00:00","detail":"stream disconnected - retrying sampling request (5/5 in 3.5s)... turn_id=01a0e8a7-6f9c-7ce0-880a-a9d4131955f0 retries=5 max_retries=5 sampling_error=stream disconnected before completion: IO error: Broken pipe (os error 32)","event":"retry"}
    {"db_id":17179186,"utc":"2026-09-28T15:35:51.264+00:00","detail":"falling back to HTTP","event":"client_event"}
    {"db_id":17179194,"utc":"2026-09-28T15:35:51.342+00:00","pre_compression_bytes":26200543,"post_compression_bytes":19100619,"compression_duration_ms":34,"event":"HTTP_compressed_body"}
    {"db_id":17179371,"utc":"2026-09-28T15:36:29.762+00:00","status":"200","event":"HTTP_response_headers"}
    {"db_id":17179500,"utc":"2026-09-28T15:36:49.884+00:00","pre_compression_bytes":26202871,"post_compression_bytes":19102745,"compression_duration_ms":29,"event":"HTTP_compressed_body"}
    {"db_id":17179689,"utc":"2026-09-28T15:37:23.263+00:00","status":"200","event":"HTTP_response_headers"}

    A later short reply in the presentation chat also prepared a 53.54 MiB compressed body, with no local tool calls and ~84.55 s from compression to response headers.

    Thread: 01a0df21-2db3-77b3-bd14-14ec98c8579a
    Turn: 01a0e250-9a36-73a1-afda-a7c8ccd68267

    {"db_id":17158234,"utc":"2026-09-27T10:02:08.707+00:00","event":"HTTP_compressed_body","pre_compression_bytes":80337092,"post_compression_bytes":56144876,"compression_duration_ms":120}
    {"db_id":17158877,"utc":"2026-09-27T10:03:33.252+00:00","event":"HTTP_response_headers","status":"200"}

    Selected completed-response IDs for server-side correlation:

    Turn Recorded UTC Response ID Input / cached input / output tokens
    01a0e250-9a36-73a1-afda-a7c8ccd68267 2026-09-27T10:03:52.743Z resp_0493514d48a94e12016ab8e9f2d94887d08de80f400de6fc85 307000 / 214912 / 366
    01a0e8a7-6f9c-7ce0-880a-a9d4131955f0 2026-09-28T15:36:49.803Z resp_082b6067b0c672a7016aba897c6cd087d09cd02ab3602eb997 298059 / 22144 / 390
    01a0e8a7-6f9c-7ce0-880a-a9d4131955f0 2026-09-28T15:37:34.828Z resp_082b6067b0c672a7016aba89b1999487d09e5ab224996e277c 298510 / 297856 / 307

    Cached input is a subset of input; reasoning tokens are included in output. These completed-response records do not establish the number or usage of incomplete/retried backend requests.

  11. chipfighter commented on Sep 29, 2026

    @chipfighter

    Same pattern here on the Windows desktop app, and it's what pushed me to build a workaround. It also fits the measurements above: once a task is on the HTTP path, every request carries the whole history again, every image included, so even a one-line follow-up uploads tens of MB.

    So I built an open-source plugin for the Codex desktop app that lets you drop old images from what gets sent, without starting a new task (disclosure: I'm the author): Codex Attachment Manager.

    • A Context Assets tab in the side panel lists every image in the task, turn by turn, with its size: your uploads, the screenshots that browser and sidebar annotations attach, tool screenshots and generated images. With many images, you can filter by source.
    • Uncheck the ones you no longer need. From the next message on, a local proxy replaces them with short placeholders before the request leaves your machine, and the conversation stays in the same task. This works on the HTTP path too: each request still sends the full history, but an unchecked image shrinks to a few hundred bytes. In a 15-image test, one request went from 24.9 MB to 212 KB. The rollout on disk isn't modified.
    • The model is told the images were left out on purpose. If it needs one back, it replies need IMG-xxx, and you check it again.

    It only changes what gets sent, so it won't help with slow opening of old image-heavy threads or large local session files. Tested on Windows with Codex 26.924. On macOS it installs and starts in CI, but nobody has tried it in the desktop app yet, so a report from a Mac would help a lot.

    Install it from Codex's Plugins page (add the marketplace chipfighter/codex-attachment-manager) or with the one-line command in the README.

    The panel's filter shows only the PDF page, then every image again, and the uploads are unchecked a turn at a time. Asked about the chat button in the v1 desktop mockup, the model replies need IMG-001; the panel points to IMG-001, the user checks it, and the model answers from the image: orange.

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

    appIssues related to the Codex desktop appbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions