Skip to content

[macOS desktop] Recurrent HTTP 400 {"detail":"Bad Request"} during normal turns and remote compaction below context limit #52406

Open

Description

@ontgomerymainte-create

What happens

Codex desktop repeatedly interrupts long-running local chats with HTTP 400 and only {"detail":"Bad Request"} in the response. This has affected more than one chat. Both ordinary model requests and remote compaction have failed, so compaction is not a reliable recovery path.

This is intermittent: an ordinary continuation later succeeded with the same active image history and without a new compaction. I do not have a deterministic minimal reproduction yet.

Environment

  • macOS, Codex desktop 26.1002.52244, build 13536, prod release channel.
  • Bundled codex-cli: 0.162.0-alpha.2.
  • Model: GPT-6.1 Sol; reasoning: high; service tier: priority.
  • ChatGPT authentication; no custom model provider.
  • The app updater reports up_to_date for the configured channel.
  • Endpoint: https://chatgpt.com/backend-api/codex/responses.

Failure and successful controls

All timestamps below are UTC on 2026-10-09. Sizes are reconstructed request-body sizes from the local diagnostic investigation, not server-side measurements.

Result Time Request ID Uncompressed bytes Compressed bytes
HTTP 400 03:43:38 d230fc23-9c96-4b94-81bf-4b97cad72522 16,200,440 8,778,325
HTTP 200, immediately preceding request 03:43:26 5f847219-4054-47b0-9c8b-e85e61226999 16,187,156 8,772,171
HTTP 200, larger request 03:38:02 eb746e00-c745-4421-9944-4819b16979b1 25,071,411 18,597,014

At the latest failure, client logs reported:

  • auto_compact_scope_tokens=88921.
  • Auto-compaction threshold: 100000.
  • full_context_window_limit=258400.
  • Both token-limit-reached flags were false.

The larger successful request means a simple fixed 8 MiB request-size cutoff does not explain these observations.

Additional failures in the same chat occurred at 2026-10-08T21:03:20Z, 2026-10-09T02:09:24Z, and 02:09:58Z. At 02:25:37Z, the log specifically recorded Error running remote compact task: {"detail":"Bad Request"}. Successful compactions also occurred between these failures. Another local chat had HTTP 400 failures on October 7.

Local checks and recovery observations

  • The session JSONL parsed successfully.
  • Checks of the five failure boundaries found correctly paired tool call/output IDs and no duplicate IDs.
  • Relevant image encodings and image integrity checks passed.
  • The latest failing active history contained 16 PNG images. The last addition before failure was approximately 8,145 characters of text, with no new image.
  • An ordinary continuation between 04:02:30Z and 04:04:54Z succeeded without another compaction, while those 16 images remained in the active history.
  • No environment HTTP/HTTPS/ALL proxy or enabled system HTTP proxy was found. A VPN extension is present; no VPN on/off comparison was performed.

Separate explanation for apparently early compaction

A local troubleshooting workaround had explicitly set model_auto_compact_token_limit=100000. That explains compaction at approximately 39% of the 258400-token window. It did not prevent HTTP 400 and has been removed from the configuration. Existing running chats still showed the cached 100000 threshold; reload verification remains pending. I am not presenting that configured threshold as evidence of a default context-window defect.

Expected behavior / requested investigation

Please correlate the failed and successful request IDs to identify the precise backend validation failure, including why a remote compaction can also receive the same generic 400. An actionable error and a supported recovery path would help avoid repeatedly interrupting long-running work.

The request-size and token observations above are evidence, not a confirmed root cause. No account credentials, raw request bodies, screenshots, project source, or complete session transcripts are included in this public report.

Related: #52320 and #43711. This report adds macOS evidence and intermittent failure/success controls.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    contextIssues related to context management (including compaction)
    on Oct 9, 2026
  2. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. ontgomerymainte-create commented on Oct 14, 2026

    @ontgomerymainte-create
    Author

    Follow-up: a separate connectivity failure can leave a local turn active indefinitely

    This is a new observation, not another confirmed HTTP 400 and not evidence that the earlier 400 has the same cause.

    Environment now:

    • macOS 26.6.2
    • Desktop 26.1007.30912 (build 20156)
    • Bundled codex-cli 0.162.0-alpha.17.2
    • GPT-5.6 Sol / Ultra, ChatGPT authentication, local chat

    Timeline (UTC):

    • 2026-10-13 14:31:24: POST https://chatgpt.com/backend-api/codex/responses returned HTTP 200.
    • 14:36:27: responses_retry logged stream disconnected before completion: idle timeout waiting for SSE, retry 1/5.
    • 14:36:43: the retry logged Request failed ... error sending request for url (.../responses).
    • No later model request or terminal turn event was present for that parent turn until the user manually stopped it on October 14.
    • A subagent completed and its result arrived at 14:44:27, but the parent did not resume.
    • A further user input was recorded at 16:32:06, but no new turn began for that input.
    • 2026-10-14 00:39:05: manual Stop produced an Interrupt and the parent turn finally became interrupted / the chat became idle.
    • A subsequent text-only recovery check completed normally in 22.431 seconds, without restarting the desktop app. The next business turn also resumed tool execution.

    Other observations:

    • During the same incident window, the subagent logged request timeouts, WebSocket idle timeouts, and tls handshake eof. Model-list refresh also timed out. This supports a connectivity problem broader than just one parent request, but does not locate the failure at the VPN, upstream route, or service.
    • The parent last reported approximately 154,080 input tokens against a 258,400-token window; this was not a full-context event.
    • The parent request was 27,416,996 bytes before zstd and approximately 18,776,958 bytes after compression. Recent screenshot tool outputs contributed substantial image data. However, retained logs also contain many successful HTTP 200 responses for compressed requests above 18 MB, and the recovery check retained a similarly large history. A fixed request-size cutoff is therefore not established.
    • A TUN VPN is in use. An explicit chatgpt.com proxy rule had already been added before this incident; that correction did not prevent this later stream-timeout / hung-turn case.
    • Current unauthenticated GET probes through both TUN and local SOCKS reached the endpoint with valid TLS and expected HTTP 405 in under a second. These are reachability checks only, not proof of stable authenticated inference or complete streaming.

    Requested investigation: why did the parent turn remain active after the failed retry, without recovering or producing a terminal error? Could the retry/error path ensure a bounded outcome so an old failed turn cannot block subsequent user messages indefinitely?

    Only sanitized observations are included; no credentials, raw request bodies, screenshots, source code, private account IDs, or full transcripts are attached.

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)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