Skip to content

macOS desktop: image-heavy chat stuck in remote compaction retries / HTTP 400; 74 MB request and same-chat recovery evidence #55076

Open

Description

@silentfishwm

Summary

On macOS, a long image-heavy Codex desktop chat repeatedly became unable to continue. Remote compaction failed with Broken pipe retries followed by HTTP 400 and only {"detail":"Bad Request"}. The UI continued to show a running turn with no assistant output for minutes.

This is the second similar incident the user reports within a week. The October 18 incident below was diagnosed from local client logs. After backing up the history and removing only historical tool-image payloads while preserving text, the original chat successfully compacted, returned a minimal OK response, and subsequently resumed the user's work on the same model.

Related reports: #18629, #41338, #52320, #52406. This report adds an October 18 occurrence on desktop 26.1007.71326, actual transport-size measurements, and an observed same-chat recovery after image-history cleanup. It does not establish the backend's exact rejection reason.

Environment

  • Codex desktop: 26.1007.71326, build 20398, production channel.
  • Bundled runtime recorded by the session: 0.162.0-alpha.17.2.
  • Platform: macOS.
  • Model: gpt-6.1-sol, reasoning high, default service tier.
  • Authentication: ChatGPT.
  • The app's update checker reported up_to_date for its configured channel.
  • Observed failure date: 2026-10-18. Times below are UTC.
  • Subscription details, project content, local usernames/paths, and complete transcripts are intentionally omitted.

Observed failure

Client logs show:

14:20:37 remote compaction v2 stream failed; retrying request after delay
         retries=1 max_retries=2
         compact_error=stream disconnected before completion:
         IO error: Broken pipe (os error 32)

14:21:12 remote compaction v2 stream failed; retrying request after delay
         retries=2 max_retries=2
         compact_error=stream disconnected before completion:
         IO error: Broken pipe (os error 32)

14:21:22 Compressed request body with zstd
         pre_compression_bytes=74361259
         post_compression_bytes=22724793

14:22:04 POST /backend-api/codex/responses
         status=400 Bad Request
         response body: {"detail":"Bad Request"}
         Failed to run pre-sampling compact

A subsequent attempt repeated the Broken pipe retries and reached an HTTP fallback request of 74,360,630 bytes before compression / 22,725,934 bytes after compression. That turn ended with:

Error running remote compact task: {"detail":"Bad Request"}

It lasted 514,263 ms (about 8 minutes 34 seconds), with no assistant message produced.

Backend correlation IDs for two observed HTTP 400 responses:

  • 2026-10-18 14:17:55 UTC: 8d14f8c2-d5b3-4167-988d-86e01217b20c
  • 2026-10-18 14:22:04 UTC: 11106af9-c150-45de-8809-18d8e56ee33f

History and recovery evidence

  • The last recorded successful sampling request before this failure sequence used 408,456 input tokens; the session reported a 475,000-token context window. This is a prior successful request's usage, not a token measurement of the rejected request.
  • The latest large history segment contained 30 inline image blocks totaling approximately 72.5 MB after its last successful compaction.
  • Image-bearing tool results used input_image / data:image/...;base64,... inside replayable tool output.
  • After the stalled turn failed, the chat was archived/unloaded and all eight matching transcript segments were backed up.
  • Only historical tool-image blocks were replaced with omission text. User/developer text was preserved; line byte lengths were preserved to avoid shifting indexed offsets. Original image payloads remain in the local backups and source files were not modified.
  • 169 historical tool-image blocks were replaced across two image-bearing history segments. These are cumulative historical counts, not the rejected request's active image count.
  • The original chat was then unarchived and asked for a minimal reply on the same model. Compaction and the turn completed successfully: OK, no error, approximately 139 seconds.
  • The user subsequently resumed the original task. No model switch or replacement chat was needed.

The recovery is evidence supporting image/history handling as an investigation lead. It is not proof of a fixed size ceiling: unloading/reloading happened as part of the repair, and the server's rejection reason remains unknown. The manual transcript edit is an emergency workaround, not a supported or generally safe recovery procedure.

Reproduction conditions

There is no small deterministic reproduction yet. The observed sequence is:

  1. Continue a long desktop chat that repeatedly inspects local images or receives image-producing tool results.
  2. Accumulate inline image payloads in replayable history.
  3. Continue the chat until automatic or pre-turn compaction is needed.
  4. Observe remote compaction transport failures, generic HTTP 400 fallback, and repeated failed continuations without an actionable recovery path.

Expected upstream behavior

  • Track serialized request bytes as well as tokens, and manage image replay independently of token-based compaction.
  • Bound or externalize image payloads without silently degrading source assets or removing required visual inspection.
  • Provide a supported local recovery path when the remote compaction request itself is rejected.
  • Return a specific rejection reason and actionable diagnostics rather than only {"detail":"Bad Request"}.
  • Keep the UI informative when compaction/retry is stalled and avoid forcing users into repeated manual continuations.

Lowering the token auto-compaction threshold is not a fix for this incident. A later local workaround setting it to 120,000 caused another compaction shortly after recovery and wasted additional time; that override was removed. The failed-request evidence above predates that change.

No credentials, raw image payloads, private project source, or full diagnostic database/transcript is included in this report.

Activity

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

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. silentfishwm commented on Oct 18, 2026

    @silentfishwm
    Author

    Follow-up from the same October 18 incident: the original 450,000-token auto-compaction threshold has now been verified in the loaded chat, not merely in the saved configuration.

    At 14:58:30–14:58:44 UTC, client logs recorded auto_compact_scope_limit=Some(450000), full_context_window_limit=Some(475000), and token_limit_reached=false at approximately 122,651–122,942 context tokens. The verification turn used normal sampling, without pre-turn compaction.

    Even with that restored live threshold, the initial sampling stream disconnected at 14:57:27 UTC with websocket closed by server before response.completed, causing a retry. The same turn eventually completed successfully with a minimal OK reply after approximately 158 seconds. Thus the local threshold mistake is corrected, but stream reliability remains an independent unresolved observation; this is not evidence of an upstream fix.

    The earlier attempt immediately before this reload also encountered repeated remote-compaction websocket disconnections. Those additional premature compactions used the cached 120,000-token workaround setting and must not be confused with a default-threshold bug. No private project contents or raw transcripts are attached.

  4. chipfighter commented on Oct 29, 2026

    @chipfighter

    @silentfishwm I saw that removing historical tool-image content let you continue the same chat. I built Context Attachment Manager for ongoing image-history management after my own character-image revisions kept piling up and making Codex 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 picture forward.

    The panel gives you thumbnails, search by remembered visual details, zoomable previews, and control over references you want to keep selected. Original image quality and conversation records are preserved. Management stays on your machine without the plugin separately collecting or uploading 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. Supported clients are Codex Desktop and the local Code tab in Claude Desktop.

    If you're continuing with image-heavy projects, I'd welcome a try and your thoughts on whether it helps keep the same task usable over time.

  5. statuscompleted-arch commented on Nov 5, 2026

    @statuscompleted-arch

    Additional Windows desktop observation from an image-generation workflow, including the same remote-compaction error.

    Observed sequence

    • A fresh chat completes a batch of eight images successfully.
    • A subsequent batch request in that chat can fail with {"detail":"Bad Request"}. In one inspected occurrence, the failure followed another review of reference images, before image generation was called.
    • Manual /compact also failed with Error running remote compact task: {"detail":"Bad Request"}.

    Temporary recovery
    Switching between Terra and Sol inside the affected chat sometimes lets me continue. The error can recur on the newly selected model, and switching back helps again. Otherwise, I have to create another chat.

    In my workflow this can happen after just one completed batch in a newly created chat. I have not established a request-size ceiling or a deterministic minimal reproduction. The image/history and compaction symptoms seem relevant to this report, but a common root cause is unconfirmed. A supported same-chat recovery path would be very helpful.

  6. miyahluvgames-source commented on Nov 13, 2026

    @miyahluvgames-source

    Additional macOS native /compact occurrence

    An image-heavy chat in Codex Desktop repeatedly returned HTTP 400 with {"detail":"Bad Request"}. Native manual /compact returned Error running remote compact task: {"detail":"Bad Request"} and created no new compaction checkpoint.

    Environment

    • macOS on Apple Silicon
    • Codex Desktop 26.1106.51428, build 26605
    • Installed native CLI/app-server 0.167.0-alpha.4.1
    • Model gpt-6.1-sol, ChatGPT authentication, HTTP Responses transport
    • Default auto-compaction target of 450,000 tokens

    Original transport observations

    Request Uncompressed bytes zstd bytes HTTP status
    Earlier ordinary request 33,193,429 24,110,408 200
    First failed continuation 34,969,861 — 400
    Native manual compaction 34,975,555 24,125,402 400

    The rejected active input contained 28 inline image parts. Their image URL strings totaled 33,093,421 bytes. One identical tool-image part occurred twice, each copy contributing 1,763,310 encoded bytes.

    The endpoint's exact rejection reason remains unconfirmed. A same-body compression A/B comparison for this occurrence is pending. Related compression-dependent observations appear in #60594.

    Why manual compaction also carries the image payload

    An isolated wire capture used the installed official native client and a reconstructed active history with a local synthetic Responses Lite endpoint.

    Official-client request Uncompressed bytes Image parts
    Ordinary sampling 34,948,041 28
    Manual compaction 34,948,359 28

    Both paths serialized the accumulated images before compaction could replace the history with a summary. This makes manual remote compaction depend on the service accepting the same large image history involved in the failed continuation.

    An experimental request-side exact-deduplication change produced 27 images and a 33,185,335-byte manual-compaction request in that isolated capture. Local regression checks preserved user images, unique unknown images, tool-call/output ordering and original saved image payloads.

    Validation used a synthetic local service. The affected cloud chat is awaiting an application restart and a fresh native /compact attempt, so its recovery remains unverified.

    Observed workflow and requested behavior

    The affected workflow accumulated image-bearing tool outputs, including an identical image repeated in separate outputs, then failed both continuation and native manual compaction. A clean synthetic cloud reproduction remains pending.

    A supported same-chat recovery path would help when remote compaction is rejected. Serialized-byte accounting and selective replay of redundant tool images could complement token-based compaction while retaining references needed for visual work. A specific rejection reason would also make this failure actionable.

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

    appbugconnectivitycontext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions