Repository navigation
Open
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)sessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems
Description
{"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, effortlow - 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
- Normal turns: websocket stream closes 5/5 (
stream disconnected before completion: websocket closed by server before response.completed), then HTTP fallback returnsPOST https://chatgpt.com/backend-api/codex/responses→status=400 Bad Requestwith body{"detail":"Bad Request"}(content-length 24). - UI shows
Reconnecting 5/5then{"detail":"Bad Request"}. /compactalso 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/modelsreturned 200 between failures. - Context window is not the cause: 217k / 760k used.
- Model/settings are ordinary for this thread:
gpt-6.1-sol, effortlow. - This looks like server-side rejection of the thread's stored history (state/compaction record the backend won't parse). Local
/compactcannot repair it because compact itself is rejected.
Similar existing reports (possible duplicates)
- "Bad request" error #10571 —
"Bad request" errorafter resume - CLI intermittently halts with
{"detail":"Bad Request"}and requires manual resume #34899 — CLI intermittently halts with{"detail":"Bad Request"}and requires manual resume - Desktop threads can be poisoned by inline base64 tool images, leading to
{"detail":"Bad Request"}on resume and likely inflated token usage #18629 — desktop threads affected by inline base64 tool images, leading to{"detail":"Bad Request"}on resume
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.sqliteentries: 5×status=400 Bad Requeston/backend-api/codex/responses, allthread_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
Metadata
Metadata
Assignees
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)sessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems
Activity
RepressedAlliance commentedon Oct 16, 2026
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"}:
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.