Repository navigation
Description
Summary
Codex in the macOS desktop app repeatedly fails with HTTP 400 and {"detail":"Bad Request"} while continuing a long-running task. Successful tool operations can be followed by a failed model-continuation request. The UI then shows the generic error and the goal becomes blocked. Retrying/resuming sometimes makes progress before the error recurs.
This report summarizes diagnostics captured on October 30, 2026. It is not a minimal deterministic reproduction, and the backend rejection reason is unknown.
Environment at the time of failure
- ChatGPT desktop app:
26.1027.30824 - Bundled Codex CLI:
0.166.0-alpha.5.1 - macOS:
15.5, build24F74 - Model in failed requests:
gpt-6-astra - Reasoning effort:
xhigh - Transport recorded locally:
responses_http, HTTP/1.1
Observed sequence
- Continue an existing long-running task involving local tool operations.
- A tool completes successfully and its matching response is present in the local session record.
- The subsequent model-continuation request to
POST https://chatgpt.com/backend-api/codex/responsesreturns HTTP 400. - The UI displays only
{"detail":"Bad Request"}; work is interrupted and the goal is shown as blocked. - Resume/retry. Some operations succeed, but the error recurs. Reducing work to individual small tool calls did not eliminate it.
One confirmed occurrence followed a file-save operation; another followed read-only diagnostics. The failure is therefore not observed exclusively after an editing-app mutation. Saved local work remained intact.
Two confirmed failures for server-side correlation
| Failure time (UTC) | America/Los_Angeles time | HTTP status | x-oai-request-id |
|---|---|---|---|
| 2026-10-30 19:59:35 | 2026-10-30 12:59:35 PDT | 400 | 4dcae5bc-69a7-4286-8c75-578144d31e1f |
| 2026-10-30 19:55:21 | 2026-10-30 12:55:21 PDT | 400 | a5feda72-047d-4a5b-978b-4752c152bdf7 |
Both returned the same generic JSON error from the endpoint above.
Diagnostic observations, not a root-cause claim
- Available local debug/trace diagnostics provide request IDs but no rejected field or actionable backend validation reason.
- The latest failed request was recorded as 43,836,758 bytes before zstd compression and 1,724,026 bytes after compression. Immediately preceding requests of almost the same size succeeded. Request size is a possible factor, not an established cause.
- The local core reported 197,439 tokens, below its configured 244,800 auto-compaction threshold and 258,400 full-context limit; local limit-reached flags were false. These figures do not establish how the server evaluated the request.
- This report does not establish media corruption, an external-tool failure, or a specific context-limit bug.
Expected behavior
Continue after successfully completed tool operations, or provide an actionable validation error and supported recovery path. A generic HTTP 400 should not repeatedly strand the user without identifying what can safely be retried or changed.
Requested investigation
Please correlate the two request IDs, identify the rejected field or server condition, and advise a supported workaround. Please also investigate the client experience: only a generic error is displayed and the goal repeatedly becomes blocked after successful work.
Potentially related symptom reports: #55930 and #57874. They concern other environments; a common cause has not been established.
Privacy
Only this sanitized summary is shared. Email, conversation and turn identifiers, local paths, raw logs, prompts, session transcripts, credentials and project media are intentionally omitted. No attachments are included.
Activity
github-actions commentedon Oct 31, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
statuscompleted-arch commentedon Nov 5, 2026
Additional Windows desktop observation with a potentially useful recovery clue: changing the selected model can temporarily restore continuation in the same chat.
My workflow involves creating image batches. The first batch of eight images can complete successfully in a fresh chat, while a subsequent request fails with
{"detail":"Bad Request"}. In one inspected occurrence, reference-image inspection had completed, and the failure happened before the image-generation call. Manual/compacthas also failed withError running remote compact task: {"detail":"Bad Request"}.Workaround observed: when Terra returns the error, switching to Sol sometimes lets the chat continue. The error can recur later on Sol, and switching back to Terra helps again. This avoids starting over for a while, but repeated model switching is necessary and the problem is intermittent.
This is on Windows rather than macOS, so I cannot confirm the same underlying cause.
yinyajun commentedon Nov 10, 2026
We reproduced a similar 400 with repeated inline images. With identical JSON:
All compressed payloads decoded locally to the exact original JSON. This suggests a compression-dependent issue in our case; the backend rejection reason remains unknown.
r266-tech commentedon Nov 10, 2026
Offline follow-up to the window comparison: the current HTTP encoder uses
zstd::stream::encode_all(Cursor::new(body.as_bytes()), 3).I exercised that source in isolation with the locked
zstd 0.13.3 / zstd-safe 7.2.4 / zstd-sys 2.0.16+zstd.1.5.7versions. For four synthetic JSON bodies (1,146–8,388,730 bytes), its frames advertised a 2 MiB window and no frame content size. Changing only the streaming encoder'swindow_log(19)produced 512 KiB windows, still with no frame content size. All decoded to the identical original JSON. The local window comparison leaves the presence of the content-size field unchanged.A minimal local compatibility example (no HTTP or model calls):
Output with libzstd 1.5.7:
Here both compressed bodies are 164 bytes and omit frame content size; the intentionally limited decoder rejects the default frame but accepts the smaller-window frame containing the same 4 MiB of JSON. That demonstrates a possible decoder-window compatibility mechanism, not a reproduction of the production HTTP 400 or evidence that the backend has this limit. The default also advertised 2 MiB for the 1,146-byte input, so a uniform low decoder limit alone would not explain intermittent failures on the same path.
There is also a bandwidth tradeoff: for synthetic JSON repeating a 768 KiB base64 block eight times, reducing the window increased compressed size from 590,875 to 4,722,534 bytes (same 6,292,194-byte JSON). A backend comparison holding the JSON, compression level, content-size/checksum flags and HTTP route fixed, while varying only the window and correlating request IDs with decompression errors, would help establish whether this mechanism applies here.
Validation: the copied encoder source is byte-identical to current main, and its three unit tests passed in the isolated harness. AI-only analysis on macOS arm64 / Rust 1.99.1; synthetic JSON and local decoders only.
Linuxdazhao commentedon Nov 13, 2026
Additional sanitized occurrence: November 11–13, 2026
Adding new versioned diagnostic evidence to this existing report rather than opening a duplicate. I also checked #44408 and #59185. The symptoms match this issue, but a common underlying cause has not been established. The compression-related observations in the comments above have not been tested in this case.
Summary
Local Codex session records contain 10 distinct failed turns across four chats between November 11 and November 13, 2026. Eight failures occurred on November 13. Every recorded error has the same generic
Codex: Bad Requestmessage, HTTP status400, andinvalid_request_errortype, with no specific error code or parameter.In two chats, follow-up attempts also failed within 1.353–5.249 seconds, without recorded model reasoning or tool calls in those attempts. Repeated continuation did not recover those chats during the observed sequences. In another chat, the requested local changes, commit, merge, and cleanup had already succeeded, but the next request failed before a final response was produced.
This report documents observed failures, not a confirmed root cause or a deterministic reproduction.
Environment and evidence scope
Codex Desktop26.1106.51428, build26605, as recorded in application logs and installed application metadata0.167.0-alpha.3.2and0.167.0-alpha.4.1, from session metadata; these are not desktop version numbersgpt-6.1-sol/openai, as recorded in the affected sessions27.2,arm64; historical OS version at every incident was not independently established2026-11-11T05:07:12.366Zthrough2026-11-13T11:34:39.398ZFailed-turn records were deduplicated by their original turn identifiers before those identifiers were removed. The count includes follow-up failures; it does not represent ten independent initial triggers. This is a bounded local sample, not an account-wide failure rate. No comparison with another model, a clean client configuration, or a different network was performed.
Recorded incidents
All timestamps below are UTC. Chat aliases are local pseudonyms, not actual chat titles or identifiers. Duration is the full turn duration reported by the client, not HTTP request latency.
The runtime suffixes in this table share the prefix
0.167.0-.Error and representative timeline
The following error payload is reproduced from the locally recorded error message, with whitespace formatted for readability. It contains no account or project data:
{ "error": { "code": null, "message": "Codex: Bad Request", "param": null, "type": "invalid_request_error" }, "status": 400, "type": "error" }The enclosing local completion event records
codex_error_info: "other". No server request identifier was present in that completion error.For E10:
11:34:38.742Z: the final cleanup command completed with exit code0; the requested local commit had already been merged and the request branch/worktree removed.11:34:38.811Z: the tool result was recorded in the session.11:34:39.398Z: the turn ended with the HTTP 400 error above andlast_agent_message: null.The interval from the recorded tool result to failure was 0.587 seconds. This is an event interval, not a measured server response time. The failure interrupted reporting after successful local side effects; it did not roll those effects back.
Reproduction status and limits
Observed sequence:
These are retrospective observations. The exact trigger is unknown, and a minimal synthetic reproducer has not been established. Private prompts, repository contents, and raw session histories are intentionally excluded. No additional paid or state-changing requests were made to reproduce the failures for this report.
The last successful requests before the five non-immediate failures recorded 86,512–360,831 input tokens, against a client-reported context window of 475,000 tokens. These figures are not measurements of the rejected requests and do not establish their validity. They are insufficient either to prove context overflow or to rule out a different input-size limit. Some affected histories contained compaction records and others did not; a compaction trigger has not been established.
The available records cannot determine whether the defect is in client request construction, conversation-state handling, or server validation. A model-specific cause, a particular runtime regression, and a network cause have not been isolated. Starting a fresh chat or switching models has not been validated as a workaround in a controlled comparison.
Expected behavior, impact, and investigation request
Expected behavior: a supported continuation should succeed, or the client should surface a specific, actionable rejection reason. If a chat cannot be resumed, explain the recovery path and distinguish completed local work from an unfinished assistant response.
Actual behavior: generic HTTP 400 errors terminate active work, and some affected chats continue rejecting follow-ups. Users must inspect local state to determine what completed before failure, which complicates safe recovery.
Please investigate the requests around the UTC timestamps above and identify the validation reason currently hidden behind
Codex: Bad Request. In particular, check whether a rejected history item or continuation state explains the rapid repeated failures, and whether the client can preserve a useful server error code, parameter, and request identifier. This is an investigation request, not a claim that any of these mechanisms is the proven cause.Names, account identifiers, original chat/turn/request identifiers, local paths, repository names and URLs, prompts, tool commands/results, credentials, and encrypted reasoning content are omitted. Exact UTC timestamps and technical versions are retained. Original chat identifiers are not included in this public comment.
Sanitized evidence: 10 normalized JSONL records
These are allowlisted diagnostic records, not raw transcript exports. Input-token counts refer to the last successful request in the available record and can carry forward across subsequent failed attempts; null means unavailable in that record.
{"incident_id":"E01","chat_alias":"A","timestamp_utc":"2026-11-11T05:07:12.366Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.3.2","duration_ms":1042299,"last_successful_request_input_tokens":360831,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E02","chat_alias":"A","timestamp_utc":"2026-11-11T10:11:46.087Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.3.2","duration_ms":159804,"last_successful_request_input_tokens":264070,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E03","chat_alias":"B","timestamp_utc":"2026-11-13T08:56:24.761Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":426109,"last_successful_request_input_tokens":86512,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E04","chat_alias":"B","timestamp_utc":"2026-11-13T08:58:42.775Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":2809,"last_successful_request_input_tokens":86512,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E05","chat_alias":"B","timestamp_utc":"2026-11-13T08:58:52.990Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":1353,"last_successful_request_input_tokens":86512,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E06","chat_alias":"B","timestamp_utc":"2026-11-13T08:59:09.220Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":2814,"last_successful_request_input_tokens":null,"reported_context_window_tokens":null,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E07","chat_alias":"C","timestamp_utc":"2026-11-13T09:01:52.390Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":768604,"last_successful_request_input_tokens":226598,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E08","chat_alias":"C","timestamp_utc":"2026-11-13T09:02:03.640Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":2324,"last_successful_request_input_tokens":226598,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E09","chat_alias":"C","timestamp_utc":"2026-11-13T09:02:52.364Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":5249,"last_successful_request_input_tokens":null,"reported_context_window_tokens":null,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"} {"incident_id":"E10","chat_alias":"D","timestamp_utc":"2026-11-13T11:34:39.398Z","event_type":"task_complete","model":"gpt-6.1-sol","agent_runtime_version":"0.167.0-alpha.4.1","duration_ms":801261,"last_successful_request_input_tokens":194950,"reported_context_window_tokens":475000,"error":{"error":{"code":null,"message":"Codex: Bad Request","param":null,"type":"invalid_request_error"},"status":400,"type":"error"},"codex_error_info":"other"}lulucui-tech commentedon Nov 14, 2026
Additional macOS / Apple Silicon report (2026-11-14).
In an existing long-running desktop Work/Codex task, tool operations and local file edits completed, then continuation repeatedly failed with
{"detail":"Bad Request"}. The user subsequently received the more specific error:Error running remote compact task: {"detail":"Bad Request"}The original task is now blocked, and the user is concerned about recovering the conversation while preserving previously saved local project files. The app/client version reported in the session is
26.1106.51428(not independently verified from the About dialog). We do not have request IDs or a minimal deterministic reproduction.Please investigate remote compaction and request validation in longer-running tasks, and provide a non-destructive way to resume a blocked conversation without losing its existing work/history. A related but distinct new-Work-conversation send-button failure is documented in #51636. No private project content or session identifiers are included.
lyspursue-maker commentedon Nov 14, 2026
Additional Windows desktop occurrence — recurring HTTP 400 stalls an active goal
26.1103.7773.0, bundled Codex CLI0.167.0-alpha.3.2. Recent continuation turns in this chat usedgpt-6.1-solwithxhigh. The model for every failed request has not been independently verified.{"detail":"Bad Request"}and goal progress stalled. Manually continuing sometimes allowed work to proceed, but the error repeatedly returned, including several times within 24 hours. There is no deterministic minimal reproduction yet./responsesat 2026-11-13 20:12:37 UTC (November 14 04:12:37 UTC+08:00), request ID527163bd-e903-4468-9f0c-bcdcba1c5eb9. The local response exposed only the generic body, with no rejected field or actionable reason.New recurrence after this report was posted: At 2026-11-14 14:21:38 UTC, the same Windows desktop chat logged a failed
POST /responsesoverresponses_http(HTTP/1.1). The response status was 400 and the same turn reported{"detail":"Bad Request"}. The response headerx-oai-request-idwasd930ce00-8de1-4d85-9bd9-8ddb507ba71b. The failing turn usedgpt-6.1-sol, reasoning effortxhigh. This is a second server-side correlation point; the reason for the rejection remains unknown. The local project had sufficient free disk space at the subsequent check and was able to resume from its saved release.lyspursue-maker commentedon Nov 15, 2026
Follow-up on the Windows desktop recurrence above
The same long-running goal again displayed
{"detail":"Bad Request"}on November 15, 2026 (UTC+08). I could not match the latest banner to a new HTTP 400 or request ID in the available local logs, so please use the two confirmed request IDs in the earlier comment for server-side correlation.At 04:42:44 UTC on November 15, the local client logged HTTP 200 for the same chat's remote compaction attempt. The session then recorded a completed compaction at 04:44:07 UTC, and subsequent
/responsescalls in that chat returned HTTP 200. An existing local supervisor and its two workers remained running and produced a later verified output during the current session. These observations do not establish the cause of the previous 400s or show that retry is reliable.If the next automatic goal turn fails with this generic body, please surface its request ID and failure category in the desktop app and provide a recovery path for the same goal and checkpoint.
xf5464 commentedon Nov 17, 2026
I observed a similar symptom in Codex Goal mode on Windows, with ChatGPT desktop app product version
157.0.8103.51.During a long-running Goal with local tool calls, a continuation request returned HTTP 400 with
{"detail":"Bad Request"}at 2026-11-16 17:52:37 UTC. The turn ended as failed. The next recorded turn did not start until 2026-11-17 01:54:50 UTC, when work resumed from saved artifacts. A separate monitoring chat saw the same response at 2026-11-16 14:08:39 UTC, 11 seconds after a successful request to the same Codex endpoint. The local logs did not identify a rejected field or a confirmed root cause.Feature request: Please add bounded automatic recovery for Goal mode when a model request fails in a way the service considers retryable. Use backoff, keep the same Goal and saved progress, and reconcile the outcome of any tool call before replaying an action with side effects. For a generic HTTP 400, please return a reason or an explicit retryability signal so the client can distinguish transient failures from requests that require a change. If retries are exhausted, surface the reason and an actionable Resume option.
This is a sanitized summary. Request IDs and raw diagnostics can be supplied through a private support channel if needed.