Skip to content

Remote compact consistently fails for a long GPT-5.5 session and blocks thread continuation #30596

Closed

Description

@The-Martyr

What version of Codex CLI is running?

0.142.4

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.5 (reasoning high)

What platform is your computer?

Linux h800-8-1 6.14.0-37-generic #37~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 20 10:25:38 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

What terminal emulator and version are you using (if applicable)?

Windows Terminal over SSH, TERM=xterm-256color

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1782748186s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.142.4",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/ubuntu/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/ubuntu/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/ubuntu/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/ubuntu/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/ubuntu/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/home/ubuntu/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/home/ubuntu/.codex",
        "config.toml": "/home/ubuntu/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/home/ubuntu",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, auto_compaction, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "33",
        "log dir": "/home/ubuntu/.codex/log",
        "mcp servers": "0",
        "model": "gpt-5.5",
        "model provider": "openai",
        "sqlite home": "/home/ubuntu/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.43.0",
      "details": {
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git build options": "git version 2.43.0; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.43.0",
        "repo detected": "false",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 38
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/home/ubuntu/.nvm/versions/node/v24.15.0/bin/codex",
        "current executable": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install context": "npm (package /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed package root": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex",
        "npm update target": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 80
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "no MCP servers configured",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 70
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 1372
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install method": "npm (package /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.142.4"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "/home/ubuntu/.codex/tmp/arg0/codex-arg02P3EWk/codex-linux-sandbox",
        "execve wrapper helper": "/home/ubuntu/.codex/tmp/arg0/codex-arg02P3EWk/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/ubuntu/.codex (dir)",
        "active rollout files": "24 files, 220529437 total bytes, 9188726 average bytes",
        "archived rollout files": "4 files, 16411693 total bytes, 4102923 average bytes",
        "goals DB": "/home/ubuntu/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/ubuntu/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/ubuntu/.codex/log (dir)",
        "memories DB": "/home/ubuntu/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/home/ubuntu/.codex (dir)",
        "state DB": "/home/ubuntu/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 199
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "24",
        "rollout DB active rows": "24",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "4",
        "rollout DB archived rows": "3",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread id sample": "019e7d0a-0aaf-7952-aacf-1d19d80617ea",
        "rollout DB duplicate rollout thread ids": "1",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "1",
        "rollout DB missing archived sample": "/home/ubuntu/.codex/archived_sessions/rollout-2026-05-31T07-57-50-019e7d0a-0aaf-7952-aacf-1d19d80617ea.jsonl",
        "rollout DB model providers": "openai=16, codex=10, mirror=1",
        "rollout DB rows": "27",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=13, vscode=11, subagent:other=2, subagent:thread_spawn=1",
        "rollout DB stale rows": "0"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "0 active, 1 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "duplicate thread inventory entries found",
          "measured": "1 duplicate rollout thread ids, 0 duplicate DB paths",
          "expected": "one rollout path and thread id per thread",
          "remedy": "Attach the doctor report to a bug report so support can inspect samples.",
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 2523
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language C",
      "details": {
        "EDITOR": "not set",
        "LANG": "C.UTF-8",
        "VISUAL": "not set",
        "os": "Ubuntu 24.4.0 (noble) [64-bit]",
        "os language": "C",
        "os type": "Ubuntu",
        "os version": "24.4.0"
      },
      "remediation": null,
      "durationMs": 14
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "SSH_CLIENT": "present",
        "SSH_CONNECTION": "present",
        "SSH_TTY": "present",
        "TERM": "xterm-256color",
        "color output": "enabled",
        "effective locale": "C.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "176x57"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "ubuntu",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "warning",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.142.4",
        "check for update on startup": "true",
        "last checked at": "2026-06-29T11:27:55.753926338Z",
        "latest version probe": "curl: (28) Resolving timed out after 5000 milliseconds",
        "npm update target": "/home/ubuntu/.nvm/versions/node/v24.15.0/lib/node_modules/@openai/codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "/home/ubuntu/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 5084
    }
  }
}

What issue are you seeing?

A long Codex CLI thread can no longer continue because every request triggers remote compaction, and the remote compact task consistently fails.

Before the first failure, /status showed:

Context window: 13% left (310K used / 353K)

The first compaction attempt failed with:

Error running remote compact task: Selected model is at capacity. Please try a different model.

Subsequent attempts failed with:

Falling back from WebSockets to HTTPS transport.
stream disconnected before completion

The HTTPS fallback also failed:

Error running remote compact task: stream disconnected before completion

Request IDs:

a3152a70-cac5-404d-9b73-2d6b1d922e29
d4d30398-caa3-4104-ae23-aac921919a1e
3bb4cfab-d26c-4a1a-82fa-a4626f297751

After the first failed compact attempt, the Context window row disappeared from /status, although the thread ID remained unchanged.

The same GPT-5.5 model works normally in a new thread. Only this existing long thread is blocked because it must complete remote compaction before it can process another request.

Affected thread:

019ed8bf-0b19-7af1-bbd8-3d3f9e6dbc5b

The session logs and diagnostics have already been uploaded through /feedback.

What steps can reproduce the bug?

Uploaded thread: 019ed8bf-0b19-7af1-bbd8-3d3f9e6dbc5b

What is the expected behavior?

Remote compaction should complete successfully, reduce the thread's context usage, and allow the existing thread to continue using GPT-5.5.

A transient capacity or transport error should be retried safely without making the thread permanently unusable. The context usage information should also remain visible in /status after a failed compact attempt.

Additional information

Codex CLI version: 0.142.4
Account type: ChatGPT Plus
Model: gpt-5.5, reasoning high
Affected thread: 019ed8bf-0b19-7af1-bbd8-3d3f9e6dbc5b

codex doctor reported:

16 ok · 1 idle · 1 notes · 1 warn · 0 fail degraded

The following checks passed:

  • State databases are healthy
  • Authentication is configured
  • WebSocket handshake succeeds with HTTP 101
  • Active provider endpoints are reachable
  • Codex CLI is on the latest available version

The thread inventory warning reported by codex doctor refers to a different thread ID:
019e7d0a-0aaf-7952-aacf-1d19d80617ea

The affected thread contains important ongoing work, so switching models or starting a new thread is not an adequate workaround.

The full Codex logs, doctor report, rollout JSONL, and auto-review rollout were already uploaded using /feedback.

Activity

  1. added
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on Jun 29, 2026
  2. The-Martyr commented on Jun 29, 2026

    @The-Martyr
    Author

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

    Powered by Codex Action

    I reviewed the suggested potential duplicates.

    This appears related to #29302 and to the recent remote-compaction failures reported in #30554, #30559, and #30593, but my case is not an exact duplicate:

    • This occurs in Codex CLI 0.142.4 on Linux, not in the Codex Desktop App.
    • The affected thread was already being used in CLI; this is not an App-to-CLI compaction synchronization issue.
    • Before the failure, /status showed 310K used / 353K with 13% left.
    • The first compact attempt failed with Selected model is at capacity.
    • Later attempts failed after WebSocket fallback to HTTPS with stream disconnected before completion.
    • A new thread using the same GPT-5.5 model works normally, so this is not a general connectivity failure like can not connect codeX remote server! #30555.
    • After the failed compact attempt, the context-window row disappeared from /status, while the same thread ID remained active.

    I have uploaded the affected CLI thread, rollout logs, and doctor diagnostics through /feedback:

    019ed8bf-0b19-7af1-bbd8-3d3f9e6dbc5b

    I am keeping this issue open because it provides a CLI-specific reproducible case and uploaded diagnostics for a long thread that can no longer be continued.

  3. The-Martyr commented on Jun 29, 2026

    @The-Martyr
    Author

    Update: I was able to recover the thread by changing the reasoning effort from gpt-5.5 high to gpt-5.5 medium and then retrying compaction.

    The CLI reported:

    Model changed to gpt-5.5 medium
    Context compacted
    

    Compaction had repeatedly failed while using the same gpt-5.5 model with reasoning effort set to high, first with a capacity error and later with stream disconnections. After switching only the reasoning effort to medium, compaction succeeded immediately in the same thread.

    This suggests the failure may be specific to the capacity or execution path used for remote compaction with gpt-5.5 high, rather than corruption of the thread or a general connectivity problem.

    The affected thread was successfully preserved and is usable again. I am leaving the issue open because the original failure remains reproducible under the high reasoning configuration and could permanently block other long threads unless users discover this workaround.

  4. etraut-openai commented on Jun 29, 2026

    @etraut-openai
    Contributor

    Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use /feedback and open a new bug report.

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

    CLIIssues related to the Codex CLIbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)contextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions