openai / openai/codex

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

Open
#45,216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug connectivity context remote
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

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
  • #38969 — automatic context compaction fails with error decoding response body.
  • #38434 — remote compaction and long-running task failures across clients.
  • #43038 — compaction hangs, including reports of idle timeout waiting for SSE.
  • #43140 — a reported SSE terminal-error handling defect that can mask the original error as an idle timeout.
  • #39771 — reported false idle timeouts during high-reasoning WebSocket generation.
  • #42468 — remote_compaction_v2 = false and the legacy compaction endpoint 404.

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing automatic compaction on Windows Desktop and a remote SSH task with remote_compaction_v2 enabled, comparing the response-body decoding and SSE idle-timeout failures. Review related issues #38969, #38434, #43038, #43140, and #39771. Done means identifying a reproducible failure boundary or documenting a safe recovery path for affected tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.