Skip to content

{"detail":"Bad Request"} on every turn + failed remote compact for one thread; other threads unaffected #52320

Open

Description

@getrdone

{"detail":"Bad Request"} on every turn + failed remote compact for one thread; other threads unaffected

Environment

  • Codex version: 0.162.0 (x86_64-pc-windows-msvc), desktop app
  • OS: Windows 11 (10.0.26100)
  • Auth: ChatGPT (plan: prolite), model gpt-6.1-sol, effort low
  • Failures observed: 2026-10-08, 22:49–23:08 local (UTC-7) / 2026-10-09 05:49–06:08 UTC

Thread

01a11278-17bd-78f2-9e63-f1a7eb66450d — started 2026-10-06, ~6,066 rollout records, ~54 user turns, 54.3 MB rollout file. Thread token usage at failure: ~217k of a 760k context window (not near the limit).

Symptoms

  1. Normal turns: websocket stream closes 5/5 (stream disconnected before completion: websocket closed by server before response.completed), then HTTP fallback returns POST https://chatgpt.com/backend-api/codex/responses → status=400 Bad Request with body {"detail":"Bad Request"} (content-length 24).
  2. UI shows Reconnecting 5/5 then {"detail":"Bad Request"}.
  3. /compact also fails: Compaction interrupted — Error running remote compact task: {"detail":"Bad Request"}.

Key observations (from local logs and rollout file)

  • Only this thread fails. Two other threads were actively completing turns on the same account/client during the failure window (22:55–23:10). No other thread has ever logged a 400 in logs_2.sqlite.
  • All three request paths for this thread are rejected: websocket sampling, HTTP fallback, and remote compact. Retries are irrelevant — the 400 is deterministic.
  • Last successful turn in the thread: 22:39 local (normal completion). First failure: 22:49 local. Nothing unusual happened between; the user was idle.
  • Auth is healthy: GET /backend-api/codex/models returned 200 between failures.
  • Context window is not the cause: 217k / 760k used.
  • Model/settings are ordinary for this thread: gpt-6.1-sol, effort low.
  • This looks like server-side rejection of the thread's stored history (state/compaction record the backend won't parse). Local /compact cannot repair it because compact itself is rejected.

Similar existing reports (possible duplicates)

This thread used custom_tool_call/custom_tool_call_output items and had one earlier successful session in the same rollout — possibly relevant to the history-rejection theories in the above issues.

What a fix needs

A way to recover or skip the poisoned history (e.g. client-side re-compaction that doesn't hit the rejected remote path, or server-side history repair), or at minimum a clearer error body than a 24-byte {"detail":"Bad Request"}.

Local evidence available on request

  • ~/.codex/logs_2.sqlite entries: 5× status=400 Bad Request on /backend-api/codex/responses, all thread_id=01a11278-17bd-..., plus 5× responses_retry (n/5) websocket-close warnings per failed turn.
  • Rollout file: ~/.codex/sessions/2026/10/06/rollout-2026-10-06T11-27-02-01a11278-17bd-78f2-9e63-f1a7eb66450d.jsonl

Activity

  1. added
    bug
    app
    windows-os
    connectivity
    session
    context
    on Oct 8, 2026
  2. RepressedAlliance commented on Oct 16, 2026

    @RepressedAlliance

    Additional Windows Codex evidence: three confirmed HTTP 400 terminations in the same thread, with a similar retry/HTTP failure sequence. This corroborates the symptom, not necessarily the underlying cause or every-turn/compaction behavior described above.

    Thread: 01a1385c-8a60-7bb2-b644-c3f9f3ec8172
    Model in failure logs: gpt-6.1-sol, reasoning high.
    Session creation metadata records bundled CLI 0.162.0-alpha.17.2; this is not a verified current desktop build.

    Read-only inspection correlated logs_2.sqlite with actual rollout task_complete events (not error strings quoted in chat). All three terminal events have codex_error_info=other and message {"detail":"Bad Request"}:

    Log timestamp UTC Turn ID x-oai-request-id
    2026-10-15 17:46:14 01a1409a-0d37-7f82-be21-cef89c82140b dc333911-ddcd-4cae-b111-b6e0d9c53c6d
    2026-10-16 00:57:07 01a14232-e3c5-7781-a45c-e5e2bfe8a541 203f3d5c-8a83-4c4b-bfd9-c51d91c31377
    2026-10-16 04:24:05 01a142f2-9d28-7781-a6ae-925cd5493e0e 78cb662b-7260-473c-aea8-2b3a394dd63a

    Each has an explicit POST https://chatgpt.com/backend-api/codex/responses status=400 Bad Request record and content-length 24. The first response Date header reads 17:46:16 UTC, two seconds later than the local log timestamp above.

    For the last two turns, codex_core::responses_retry records retries 1/5 through 5/5 with: stream disconnected before completion: websocket closed by server before response.completed. An HTTP responses request then returns the 400 above and the turn terminates. The latest retry sequence runs 04:22:47–04:23:27 UTC, followed by the HTTP 400 at 04:24:05 UTC.

    The UI showed local file edits and image viewing before the failure; the screenshot's edited filename is also present in this thread's rollout. This identifies the affected thread but does not establish an image-size cause. No request payload size or malformed history item has been established, and no compaction reproduction was attempted. The records also do not prove that every turn fails or that edits were lost.

    Impact: interruptions prevent planned Goal-driven work from continuing to completion. Earlier capacity/server_overloaded and HTTP 503 evidence was reported at #53559 (comment) . These new HTTP 400/other failures are being reported separately; we are not assuming they share the overload root cause.

    Please correlate these request IDs and identify why the responses request is rejected, and provide a recovery path that preserves existing work. This investigation only read existing records; it did not interrupt running tasks or generate diagnostic model requests. Raw histories, images, credentials, and private project files are not 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

    appbugconnectivitycontextsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions