Skip to content

Local Windows and remote SSH tasks fail during compaction: response body decoding / SSE idle timeout #45216

Open

Description

@andrew199723

Environment

  • Codex Desktop on Windows, affecting both local tasks and tasks on a remote SSH host.
  • Remote Codex CLI version verified during troubleshooting: 0.154.0.
  • Authentication: ChatGPT subscription.
  • The exact Windows Desktop build and its local runtime version have not been independently captured for this report.

What happened?

Multiple existing Codex tasks fail during automatic context compaction and cannot continue. This was reproduced in remote SSH tasks. I also encounter the error in a local Windows Desktop task, so the reported scope is not limited to remote SSH.

Observed error messages include:

Error running remote compact task: stream disconnected before completion:
Transport error: network error: error decoding response body
stream disconnected before completion: idle timeout waiting for SSE
stream disconnected before completion:
IO error: cannot decrypt peer's message

The local occurrence and the additional SSE timeout are user-observed symptoms; the remote diagnostics below do not independently establish the local failure stage or that all three messages have the same cause.

Reproduction and impact

  1. Continue an existing Codex Desktop task until automatic context compaction is required.
  2. Send another message.
  3. Compaction fails with a stream/transport error.
  4. Retrying the affected task triggers compaction again and can fail before any normal task work begins.

During the remote tests, failed no-op turns lasted approximately 208, 230, 251, and 240 seconds. These are whole-turn durations, not independently measured durations of a single network request or a proven proxy timeout.

Expected behavior: compaction completes and the task continues, or Codex provides a safe recovery path that preserves completed work and conversation context.

Actual behavior: repeated compaction failures prevent continuation of affected tasks. Other tasks can still be used to inspect the failures.

Remote diagnostics already performed

  • Configuration loads successfully; remote_compaction_v2 was restored to its default value, true.
  • The Responses WebSocket handshake succeeded with HTTP 101. This verifies connection establishment, not long-stream reliability.
  • Restarting the remote app server did not resolve the compaction failure.
  • The decode failure recurred with multiple proxy routes and TCP/gRPC transports.
  • Direct access to the authenticated ChatGPT request returned HTTP 403, so a successful direct-versus-proxy comparison was not possible.
  • Experimental proxy routing changes were reverted.

These tests do not isolate the cause to a proxy, the client, the model, or the OpenAI backend. The additional local Windows occurrence also needs investigation.

Separate legacy endpoint error during troubleshooting

Setting remote_compaction_v2 = false produced a different error:

Error running remote compact task: unexpected status 404 Not Found
URL: https://chatgpt.com/backend-api/codex/responses/compact

That override has been removed. After restarting with the default enabled, the tested task stopped returning this 404 but continued failing with the response-body decoding error.

Diagnostic identifiers

  • Codex Desktop feedback ID: 01a099ef-7998-7181-9482-c4065a287da2
  • Example affected remote thread ID: 01a099ce-6369-74b0-85af-ca74ebb30a1e
  • The following request identifiers are specifically from the separate legacy 404 attempts, not from the SSE/decode failures:
    • Request ID: 3079b92a-a1ec-4d73-8367-06313b9e98fc; CF-Ray: a3a5dbfef8981ea1-AMS
    • Request ID: 293df0ca-9d17-43c6-89d7-c3e4aa7c0b4e; CF-Ray: a3a5dc62ac2e1add-AMS

Related reports

These are related symptoms and diagnostic leads, not a claim of identical root causes or released fixes.

Could maintainers investigate the affected compaction requests, advise on recovery of existing tasks, and identify whether this report should be consolidated with one of the issues above?

Activity

  1. added
    bug
    app
    context
    connectivity
    on Sep 13, 2026
  2. github-actions commented on Sep 13, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. changed the title [-]Remote SSH threads become unusable when automatic context compaction fails[/-] [+]Local Windows and remote SSH tasks fail during compaction: response body decoding / SSE idle timeout[/+] on Sep 13, 2026
  4. SouthWinter commented on Sep 13, 2026

    @SouthWinter

    Independent Linux remote-SSH reproduction: both WebSocket and HTTP/SSE compaction time out

    Adding a separate Linux incident because it overlaps this report closely and provides a same-machine, two-thread comparison. This does not establish that every transport error in this issue has one root cause.

    Environment

    • Codex Desktop connected to a remote Linux x86_64 host
    • codex-cli 0.153.4
    • ChatGPT authentication
    • gpt-6-astra, reasoning effort medium
    • remote_compaction_v2=true
    • Effective auto-compaction scope limit: approximately 180,000 tokens

    Observed behavior

    Two independent tasks on the same remote host entered automatic compaction and could not continue. The newer task was genuinely fresh rather than a fork or imported transcript.

    The newer task reached run_auto_compact{reason=ContextLimit phase=MidTurn}, then followed this sequence:

    1. WebSocket connected successfully.
    2. Three WebSocket attempts each remained without an upper-layer response event for about five minutes and ended with:
      remote compaction v2 stream failed
      stream disconnected before completion: idle timeout waiting for websocket
      
    3. Codex emitted falling back to HTTP.
    4. HTTP requests completed upload and received response headers, but HTTP/SSE attempts also ended after an idle interval with:
      stream disconnected before completion: idle timeout waiting for SSE
      

    A fresh task therefore did not avoid the failure once one tool-heavy turn crossed the context threshold.

    Historical comparison

    The older task had completed 34 automatic context compactions successfully under the same installation. The last successful compaction was persisted at 2026-09-13T11:32:47Z.

    That final success already showed degradation: two earlier SSE attempts hit idle timeouts, while a later attempt eventually completed after roughly 20 minutes for the overall compaction/retry sequence. Subsequent compactions failed.

    This suggests that merely reaching the configured token threshold is not sufficient to explain the failure. The threshold had been crossed and compacted successfully many times before.

    Approximate incident window: 2026-09-13 11:10-14:00 UTC.

    Request and connectivity observations

    • Approximate JSON request sizes before zstd request compression:
      • older failing task: 1.26 MB
      • newer failing task: 835 KB
    • Request compression and upload completed normally.
    • codex doctor reported:
      • authentication OK
      • app server running
      • HTTP provider endpoint reachable
      • Responses WebSocket handshake succeeded with HTTP 101
    • The shared app-server process remained running throughout.
    • No 401, 429, quota, DNS, or handshake error was observed.

    These checks establish successful setup and connection establishment; they do not rule out a long-stream proxy problem or identify a server-side cause.

    Correlation identifiers

    Shared with the users explicit authorization:

    • Older affected task: 01a0918c-fed7-7623-b9ed-7342111a6b96
    • Fresh affected task: 01a09ad1-94ae-7120-8e8d-d9f74bcf5b62
    • Codex feedback-associated task: 01a09b16-f0d4-7cb0-98de-c749fded552e

    The built-in /feedback report was submitted without full session logs because the conversations contain unpublished research material. No project name, prompts, local paths, credentials, raw transcripts, or research content are included here.

    This incident also resembles the WebSocket retry amplification documented in #42896, with the additional observation that HTTP/SSE did not recover either. Please correlate the identifiers above with remote compaction latency and emitted application-level stream events if those traces are available.

  5. Nobodyrookie commented on Sep 23, 2026

    @Nobodyrookie

    Windows Desktop follow-up (2026-09-23): compaction failure and bounded recovery test

    A long-running GPT-6 Astra task on Codex CLI 0.156.1 was blocked by automatic remote compaction. Its history shows 13 successful compactions, most recently at 2026-09-23 06:20 UTC. The last token-count event reported 243,295 input tokens against a 258,400-token effective window. The next mid-turn compaction and a subsequent pre-turn compaction both failed after retries with stream disconnected before completion: Transport error: network error: error decoding response body. The compact request was approximately 2.33 MB before zstd compression and 1.17 MB after compression. The HTTP attempts received status 200 with chunked transfer encoding before the stream failed. The goal was then marked blocked. Existing workspace edits remained on disk.

    A separate network symptom occurred later on the same Windows machine: even a minimal fresh CLI request received a Cloudflare 403 at /backend-api/codex/models?client_version=0.156.1 on one proxy exit. After switching the proxy route, an identical minimal request completed. This establishes a route-specific connectivity problem at that later time, but does not establish that the earlier 200-then-disconnect compaction failures had the same cause.

    As a reversible recovery experiment, model_context_window = 400000 was added to the user config. A fresh CLI session reported an effective 380,000-token window and completed the minimal request. The blocked original task has not yet been successfully resumed or verified under this setting. Please advise on a supported way to recover an existing blocked goal without losing its completed work, and whether backend traces can distinguish proxy stream loss from compaction service failure. No project content, credentials, or raw logs are included.

  6. ddddyyyy commented on Oct 4, 2026

    @ddddyyyy

    I have an additional Windows Desktop observation with a model-switch recovery. This does not establish that the model itself is the root cause.

    Environment

    • Windows 10 Pro 22H2, x64, build 19045.6466.
    • Running Codex Desktop MSIX package: OpenAI.Codex_26.930.3930.0_x64__2p2nqsd0c76g0. This is the verified package version, not a value copied from the About dialog.
    • Session metadata records Codex core/CLI version 0.160.0.
    • Authentication: ChatGPT Plus; built-in OpenAI provider.
    • Local Windows task with a long conversation containing tool outputs and images.
    • Incident date: October 4, 2026. Times below are UTC.

    Observed sequence

    Operation UTC time Result
    Automatic compaction, gpt-6.1-sol, medium Started 10:25:31; task failed 10:33:41 Initial request and two retries failed
    Manual compaction, gpt-6.1-sol, medium 10:33:48–10:42:00 Initial request and two retries failed
    Manual compaction, gpt-6.1-sol, high 10:42:18–10:50:33 Initial request and two retries failed
    Manual compaction after switching to gpt-6-astra 10:51:57–10:55:31 Completed in 213.396 seconds; compacted history was persisted

    All three failed tasks ended with:

    Error running remote compact task: stream disconnected before completion:
    Transport error: network error: error decoding response body
    

    After successful compaction, I switched back to gpt-6.1-sol and continued working in the same thread normally.

    Diagnostic evidence

    • Automatic compaction triggered at total_usage_tokens=245842, against a threshold of 244800 and an effective context limit of 258400. The log recorded full_context_window_limit_reached=false.
    • All nine failed requests received HTTP 200 from https://chatgpt.com/backend-api/codex/responses, then failed while consuming the response stream.
    • Several retry warnings appeared approximately 118 seconds after the HTTP response headers. This is a timing observation, not proof of a particular timeout or proxy fault.
    • Request sizes were essentially unchanged across the model switch: approximately 44.33 MB before zstd and 32.89 MB after compression.
    • The successful attempt produced a persisted compacted record, a completed ContextCompaction item, and task_complete without an error.

    Identifiers for investigation:

    • Thread: 01a10105-fa4f-7331-af2f-40dbcb936d85.
    • First failed request: efb1523a-6924-4a42-96ee-4703f8766395.
    • Successful Astra request: 3dd4e820-d8b6-4a18-b4c5-670837f00e09.

    Reproduction boundary and expected behavior

    These are repeated observations in one existing thread, not a minimal reproduction or a controlled comparison of models. I have not independently reproduced this in a fresh thread or ruled out transient network/backend behavior.

    The observed steps were: continue a long image/tool-heavy thread until automatic compaction triggers; retry manually with Sol at medium and high; switch to Astra and compact the same thread; switch back to Sol and continue.

    Expected: compaction completes and preserves task continuity, or the app provides a recoverable failure with actionable diagnostics.

    Could maintainers inspect the failed and successful requests to determine whether this belongs to the existing transport/compaction issue or a separate model-dependent compaction path?

    Authentication headers, cookies, local usernames/paths and full conversation contents are omitted.

  7. ViktorVr1981 commented on Oct 11, 2026

    @ViktorVr1981

    Additional independent user report from a ChatGPT Pro subscriber on Windows 10 Pro 22H2, with recurring failures since 2026-10-03 and still ongoing 2026-10-11. The reporter has captures from multiple distinct Codex/Work threads, including both:

    Error running remote compact task: stream disconnected before completion: Transport error: network error: error decoding response body
    Error running remote compact task: stream disconnected before completion: idle timeout waiting for SSE
    

    One recovery thread shows the decode error three times in succession; a separate thread shows repeated SSE idle timeouts. The reporter also describes a failure in a new thread on Oct 7 (timeline reported by user; screenshot calendar date not embedded). Longer tasks are blocked; small, bounded tasks sometimes remain usable.

    Detailed independent report (environment, limitations, timeline, and maintainer questions): #53111.

    We are seeking a supported way to recover existing long-running conversations safely, and a method to provide request/session IDs privately without exposing user project data. No specific root cause is asserted.

  8. key239 commented on Oct 21, 2026

    @key239

    Windows Codex/Work: repeated HTTP 200 response-stream decoding failures clustered around 120 seconds

    Environment

    Windows, Codex Desktop/Work.

    Observed agent/runtime version: 0.163.0-alpha.10.2.

    Model: gpt-6.1-sol, reasoning effort: max.

    The exact desktop package build is not independently confirmed.

    Problem

    Repeated failures with:

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

    This affects both remote context compaction and ordinary response generation. The interface retries up to five times, then fails.

    Evidence

    Local log correlation identified 17 affected turns, including 6 explicit remote-compaction failures.

    All 72 matched failed requests received HTTP 200 before the stream failed.

    Of those requests, 65 failed approximately 120–122 seconds after request construction.

    The problem also affects newly created conversations. An older conversation successfully completed compaction but subsequently failed during ordinary generation.

    Local tools may complete successfully despite the model response stream failing. In one affected turn, 20 local commands had completed successfully.

    Two failed requests had locally persisted response items approximately 6.6 and 49.3 seconds before failure. These are persistence timestamps, not verified network receive timestamps.

    Current hypothesis

    The timing distribution suggests a possible request-lifetime limit around 120 seconds.

    However, available logs cannot distinguish request-total timeout from idle timeout or determine whether the disconnect originates at the client, proxy, network gateway, or backend.

    HTTP 200 alone does not establish successful completion of the response body.

    Expected behavior

    Long-running requests should complete when supported, or fail with an actionable error. When a stream fails after tool execution, completed work should remain recoverable without repeated side effects.

    Request to maintainers

    Could the maintainers correlate affected request IDs with server-side termination reasons and inspect potential 120-second request or streaming limits?

    It would also help to expose sanitized diagnostics showing the timestamp of the last network response frame and whether termination was initiated by the client, gateway, or server.

    I can provide sanitized timestamps, request identifiers, and local event correlations privately.

    Related: #45216

    No root cause or confirmed workaround is claimed.

  9. dsSep commented on Oct 30, 2026

    @dsSep

    Independent Windows reproduction (2026-10-30): Sol compaction repeatedly disconnects; Terra compaction recovers the same conversation

    Adding a sanitized follow-up with a verified recovery and failed/successful request identifiers. The exact termination layer is still unknown.

    Environment

    • Windows desktop; the engine actually used for the recovery test reports codex-cli 0.164.0-alpha.11.1. The Desktop package build was not independently verified.
    • ChatGPT Plus authentication; gpt-6.1-sol, low reasoning.
    • CC Switch 4.0.21 aggregation was initially enabled, but the same affected conversation also failed with verified direct requests to https://chatgpt.com/backend-api/codex/responses.
    • “Direct” here means bypassing CC Switch. An existing local outbound network proxy remained in the path; this was not a proxy-free network control.

    Failure and impact
    The long conversation reached run_auto_compact{reason=ContextLimit phase=PreTurn}. Subsequent prompts, even a greeting-only prompt, could not begin normal generation because compaction kept failing:

    Error running remote compact task: stream disconnected before completion:
    Transport error: network error: error decoding response body
    

    The last recorded input usage before the incident was approximately 442,671 tokens, with a reported effective window of 475,000. This is the last server usage record, not a reconstruction of the exact client compaction-trigger count. Compaction request JSON was approximately 24.06 MB before zstd and 14.36 MB after compression.

    Selected timestamps below are UTC, 2026-10-30:

    Path/model HTTP 200 headers Failure/completion Interval after headers
    Direct / Sol 07:27:41 Decode failure 07:29:39 118 s
    CC Switch / Sol 07:41:35 Decode failure 07:43:33 118 s
    CC Switch / Sol retry 07:43:41 Decode failure 07:45:39 118 s
    Direct / Terra, full-history copy 08:09:12 Persisted compaction 08:11:02 ~110 s

    Other matched Sol failures clustered at 116–119 seconds after headers. HTTP 200 did not mean the stream completed. These timestamps alone do not identify a timeout setting, prove an idle interval, or identify which component closed the connection.

    Bounded diagnostics and recovery

    • Actual official-endpoint HTTP requests failed as well as CC Switch forwarding.
    • An isolated full-history copy using the same engine also failed with WebSocket followed by HTTP fallback.
    • A loopback forwarding test using Python/OpenSSL against the same official endpoint reproduced a TLS record error; limiting that diagnostic path to TLS 1.2 instead produced an incomplete response. These tests retained the common outbound proxy and do not exonerate or implicate that proxy.
    • A fresh isolated copy using gpt-6.1-terra over the normal official HTTP endpoint completed native compaction. The local catalog exposed the same 500,000 context window and compaction protocol hash for Sol and Terra.
    • The copy's entire original transcript prefix was verified byte-for-byte by SHA-256; no history was manually removed to obtain success.
    • A separate resume of the compacted copy successfully answered a greeting-only prompt, with subsequent input usage of 96,659 tokens.
    • The user then switched the original affected conversation to Terra in official direct mode, completed compaction, and confirmed recovery without moving to a new conversation.

    This is a recovery observation, not a randomized model comparison or proof of a Sol model defect. Backend load/routing changes and shared network behavior remain possible explanations.

    Correlation identifiers

    • Direct Sol failure at 07:29:39 UTC: 6e418bb0-2a05-4f91-8e11-69813e630600
    • Forwarded Sol failure at 07:43:33 UTC: 3d5ca2fa-d917-4537-acb9-73a0caf8b27c
    • Successful Terra copy request: req_dac35fb2815441f3ba099ea8b257fd93

    Could maintainers correlate these requests with server-side termination reasons and compaction progress, and clarify whether the clustered disconnects reflect an upstream deadline, an application-stream error, or another transport problem? A supported automatic fallback preserving the original conversation would also help.

    No prompts, project material, screenshots, raw transcripts, authentication headers, cookies, credentials, account identifiers, original thread ID, or local paths are included.

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

    appbugconnectivitycontextremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions