Skip to content

HTTP 400 for repeated image inputs with zstd request compression; same inputs succeed uncompressed (Windows) #60594

Open

Description

@levastar

Summary

On Windows, two desktop chats and a native desktop-operator subagent became unable to continue with only:

{"detail":"Bad Request"}

The logged failing endpoint was POST https://chatgpt.com/backend-api/codex/responses (HTTP 400, 24-byte response). A fresh replacement chat worked initially, then failed after screenshot-bearing tool results.

A bounded A/B test using synthetic PNGs containing only random pixels and a gray background reproduced the error with request compression enabled. With the same binary, model, prompt, image files, login and proxy configuration, disabling features.enable_request_compression completed successfully.

This points to a request-compression/decoding compatibility problem for some image-bearing requests, but does not establish the precise client or backend defect.

Environment

  • Windows x64.
  • Affected desktop app-server: codex-cli 0.166.0-alpha.6.
  • Original failures: gpt-6-astra / max in two main chats, and native gpt-6.1-terra / xhigh in the operator subagent.
  • Controlled CLI tests: gpt-6-astra / low.
  • Authentication: existing ChatGPT login, not an API key.
  • HTTP Responses transport: OpenAI provider configuration with requires_openai_auth = true, wire_api = "responses", supports_websockets = false; no third-party inference base URL.
  • The same existing local HTTP CONNECT proxy was used for both sides of the comparison. Proxy settings and TLS verification were not changed.
  • The affected desktop is a locally themed/repackaged installation. The same symptom was also reproduced with the corresponding Codex executable in a noninteractive CLI invocation, without exercising the desktop UI or the screenshot MCP.

Synthetic reproduction

Generate a test PNG with Python and Pillow (no screenshot, account data or project content is required):

import random
from PIL import Image

rng = random.Random(20261110)
image = Image.new("RGB", (1568, 1008), (238, 238, 238))
noise = Image.frombytes("RGB", (1568, 175), rng.randbytes(1568 * 175 * 3))
image.paste(noise, (0, 0))
image.save("synthetic-transport-test.png")

The generated file in this test was 830,944 bytes. Attach that same file twice. Run with an existing ChatGPT-authenticated configuration using HTTP Responses transport:

codex exec --ephemeral --json --sandbox read-only --skip-git-repo-check --color never -m gpt-6-astra -c 'model_reasoning_effort="low"' -c 'features.enable_request_compression=true' -i ./synthetic-transport-test.png -i ./synthetic-transport-test.png "Diagnostic image-transport test only. These two images contain only computer-generated noise and gray pixels. Do not call tools, inspect files, or perform any desktop actions. Reply only IMAGE_OK if both images are decodable."

Repeat with only the compression option changed to false.

Observed results on 10 November 2026:

Codex executable Compression Result
0.166.0-alpha.6 enabled explicitly turn.failed, {"detail":"Bad Request"}, exit 1
0.166.0-alpha.6 disabled in config, no CLI override IMAGE_OK, turn.completed, exit 0
0.155.0-alpha.9.2, an older locally available executable used for the initial diagnostic enabled explicitly same error, exit 1
0.155.0-alpha.9.2 disabled explicitly IMAGE_OK, turn.completed, exit 0
0.155.0-alpha.9.2 disabled in config, no CLI override IMAGE_OK, turn.completed, exit 0

These tests used the existing local configuration; this is not yet a clean-profile, cross-account or cross-network reproduction.

Original request evidence

Sanitized original desktop logs, all times UTC on 10 November 2026:

Time Request Uncompressed bytes zstd bytes HTTP result
12:25:52 operator, last accepted request 15,239,945 6,770,174 200
12:26:20 operator, next request 16,261,970 6,770,385 400
13:14:08 main chat, last accepted request 3,240,093 2,000,502 200
13:15:46 main chat, next request 3,778,310 2,014,519 400
13:33:37 replacement chat, last accepted request 1,635,316 924,650 200
13:34:15 replacement chat, next request 2,750,937 933,100 400

Server correlation IDs:

  • Main chat failure at 13:15:46 UTC: 32a71d42-984e-4a19-9c98-6ab50b9b4b97.
  • Same chat follow-ups at 13:25:47 and 13:28:03 UTC: 4e30b821-dea3-4a76-9469-8809178cb3fa, 28ca5e5a-54df-4546-b6cc-139ff8de28bf.
  • Replacement chat at 13:34:15 UTC: a19a47a1-6550-4de2-b8f9-2ec9d07daca3.

The replacement chat's preceding screenshot decoded successfully as PNG, 1568 × 1008, 826,094 bytes. The next tool result repeated the same screenshot bytes. The last successful model input was 131,535 tokens; the client's post-tool estimate was 135,897, with a reported 258,400-token window and both limit-reached flags false. These local figures are not a measurement of server-side validation.

Important limits / counterexample

Not every compressed image request fails. A separate native Terra/medium check in the already-running 0.166.0-alpha.6 host returned two identical synthetic images in one tool output and completed. Its request was still zstd-compressed (2,380,507 → 892,754 bytes). The running host retained its previous compression setting despite the config-file edit.

Therefore this report does not claim that duplicate images are always invalid, that all compressed requests fail, or that there is a universal request-size threshold. Differences in request shape, compressed-frame properties or backend handling still need investigation.

Workaround and requested behavior

Adding the following to the existing [features] table allowed newly launched CLI tests to complete:

[features]
enable_request_compression = false

Already-running sessions may retain their old setting and need to reload/restart. The original failed desktop chats have not been resumed as part of this diagnostic, to avoid re-running their unfinished external actions. Their transcripts and generated work were not modified.

Please investigate the compression-dependent failures and return an actionable validation/decompression error rather than a bare 24-byte 400. A supported way to reload the setting or recover a stranded chat without losing its history would also help.

Potentially related symptom reports: #59621 and #58569. A shared root cause is not assumed.

Submitted through the user's Codex assistant with the user's explicit request to report the bug. Only this sanitized report is being posted: no original screenshots, private conversations, local user paths, full logs, credentials or account identifiers are attached.

Activity

  1. added
    bug
    CLI
    windows-os
    connectivity
    on Nov 10, 2026
  2. github-actions commented on Nov 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. duyc392 commented on Nov 10, 2026

    @duyc392

    Confirming this on the Windows desktop app, and adding a config-level (not CLI-flag-only) verification, plus one detail that I think is central: the duplicated image is produced by normal use, not by the user.

    Environment

    • Desktop app 26.1103.7773.0 (MSIX, OpenAI.Codex_26.1103.7773.0_x64__2p2nqsd0c76g0), bundled kernel codex-cli 0.167.0-alpha.3.2
    • Windows 11 x64
    • ChatGPT auth (no API key); provider OpenAI, wire_api = "responses", supports_websockets = false
    • gpt-6.1-sol, model_reasoning_effort = "high"

    The duplicate image is unavoidable for the user

    The user attaches a reference image once. The model then calls view_image on that same file, so the identical image ends up in the request twice: once as the user's input_image, once inside custom_tool_call_output. Every subsequent turn in that chat carries both copies and fails — including a one-character follow-up.

    Observed sequence in one chat (UTC, 2026-11-10):

    Time Event
    14:27:04 user message with 2 attached images
    14:27:23 model calls view_image on the same 2 files
    14:27:24 custom_tool_call_output returns both images again (1.75 MB base64)
    14:27:25 POST /backend-api/codex/responses → 400, 24-byte body {"detail":"Bad Request"}

    Across three separate chats on the same day, every turn after the first image-bearing tool result failed. One chat accumulated 5 failed turns, including follow-ups of two characters that triggered no tools at all.

    So the failure is not "very long conversation" and not "too many images" — it reproduces within two turns of a fresh chat.

    A/B with truly identical inputs

    Single 1254×1254 JPEG (0.92 MB, ~1.29 M base64 chars), same file passed twice via -i:

    codex exec --ephemeral --skip-git-repo-check -C <dir> --sandbox read-only `
      -c features.enable_request_compression=true -i same.jpg -i same.jpg
    # -> ERROR: {"detail":"Bad Request"}          (fails in ~7s)
    
    codex exec --ephemeral --skip-git-repo-check -C <dir> --sandbox read-only `
      -c features.enable_request_compression=false -i same.jpg -i same.jpg
    # -> succeeds in ~16s, correctly reports "image 2 is the same as image 1"

    One clarifying data point: I also ran 2-image and 4-image tests using different files, on both the compressed and uncompressed paths, and both succeeded (including four images totalling 6.36 MB). The trigger is specifically the same image repeated, not image count or payload size. That may explain why this is hard to reproduce with arbitrary test images — which is exactly the case in normal editing workflows, where the model re-reads the user's reference image.

    Config-level workaround

    Setting this in ~/.codex/config.toml:

    [features]
    enable_request_compression = false

    was verified to be honoured by the kernel: a codex exec run with no -c override at all (relying purely on the config file) succeeds on the same duplicated-image input.

    Relevant for the app path: the desktop app launches its kernel as

    codex.exe -c features.code_mode_host=true app-server --analytics-default-enabled \
      -c features.prefer_mxc=true \
      -c [email protected]_servers.codex_app.enabled=true \
      -c features.windows_sandbox_service=true
    

    It does not pass enable_request_compression, so the config value should apply to app traffic after an app restart. I have not yet completed the app-level retest with compression disabled; I will follow up in this thread once the app has been restarted, to confirm the config path is sufficient end-to-end.

    If it is, this turns the workaround from "pass a CLI flag" into something a normal desktop user can apply while the compression/decoding defect is being investigated.

  4. CQQ-ING commented on Nov 10, 2026

    @CQQ-ING

    Additional reproduction with text-only first turns on Windows. This broadens the observed trigger beyond image-bearing conversations.

    Environment

    • Windows 11 x64, build 26200
    • Desktop package 26.1103.7773.0
    • Bundled engine 0.167.0-alpha.3.2
    • Model gpt-6.1-sol, medium reasoning for the original failed turns
    • Existing ChatGPT authentication
    • Official endpoint https://chatgpt.com/backend-api/codex/responses
    • Provider configuration uses wire_api = "responses", requires_openai_auth = true, and supports_websockets = false
    • enable_request_compression resolves to its enabled default

    First-turn failure

    Two fresh desktop conversations failed on their first request after the user entered only a short request to reply ok. Their inputs contained the automatically supplied instructions, tools, project rules and environment context. No report document content or image attachments were present in these first-turn inputs.

    Original desktop log observations on 10 November 2026, UTC

    Time Result Request ID
    19:38:48 HTTP 400, {"detail":"Bad Request"} 87ed1b09-b829-4a74-9a28-c7e6d9deb4ab
    19:51:20 HTTP 400 on a follow-up e67286b6-f915-40a3-98b0-a7050b14bf16
    19:51:35 HTTP 400 in another fresh conversation 8abd8c96-6698-401f-9a14-56de1fd566be

    The last request was logged as 133,212 bytes before compression and 50,179 bytes after compression. A nearby fresh conversation in another project succeeded with a 123,127-byte request compressed to 44,381 bytes.

    The project rules were injected once. The project path resolved successfully. The same project-rule text was present in earlier successful report conversations that day.

    Same-body transport comparison

    A reconstruction of the first failed conversation was serialized once as compact UTF-8 JSON, 131,601 bytes. This reconstruction is distinct from the original on-wire desktop request.

    SHA-256 of this diagnostic JSON

    d258be93cd372ac33fd1838f6560fd2d97d752d81c315a0918eb756fb11e6dc8

    The same bytes were sent using native libzstd 1.5.7 streaming compression, with input length initially unknown, and as plain JSON. Both compressed variants were locally decompressed and verified byte-for-byte against the same JSON.

    Encoding Wire bytes HTTP Request ID
    zstd level 3 49,636 400 73ee303c-b50b-4211-b55f-5f58bb1b0b8e
    zstd level 1 55,920 200, ok 4b6b61d6-9177-490c-b73d-e9f63169ee42
    Plain JSON 131,601 200, ok 9e456f6b-c284-4227-8b14-0a91bcdb9322

    Synthetic reproduction without project content

    The following body also reproduced compression-dependent failure. Serialize with compact separators and encode as UTF-8.

    body = {
        "model": "gpt-6.1-sol",
        "instructions": "Ignore filler. Reply OK.",
        "input": [{"role": "user", "content": "a" * 140000}],
        "stream": True,
        "store": False,
    }
    raw = json.dumps(body, separators=(",", ":")).encode("utf-8")

    POST the same JSON bytes to the official endpoint using existing ChatGPT authentication. Compare plain JSON against valid zstd level-3 encoding with Content-Encoding: zstd.

    For this 140,132-byte JSON, plain requests repeatedly returned 200. Native libzstd streaming compression produced 146 bytes and returned 400. Example request IDs

    • Plain JSON, 200 — 6f39762e-136a-42f1-9eba-88fcfb049d3b
    • Streaming zstd, 400 — 1d9651e7-dd38-4e7c-ac2e-d5444f2165a6

    The result persisted with Python requests environment-proxy handling disabled. No environment proxy was configured in these diagnostic requests. This was a same-account, same-machine test.

    An additional native zstd block-encoding comparison of that synthetic body gave 400 with the original two compressed blocks, but 200 when either block was encoded as a raw zstd block. Every variant passed local byte-identical decompression. A similar block replacement did not recover the reconstructed project request, so a universal multi-block failure is not established.

    These results point to handling of particular valid compressed representations somewhere in the endpoint's receive path. The exact backend component and implementation defect remain unconfirmed. There is no demonstrated universal 128 KiB request limit.

    Please correlate the request IDs and investigate the compression-dependent rejection. An actionable error and an uncompressed retry for this opaque 400 would help recover affected chats.

    Submitted through the user's Codex assistant at the user's request. The original project payload and documents remain local. The reproduction above contains synthetic filler only.

  5. xiaolian20267-crypto commented on Nov 11, 2026

    @xiaolian20267-crypto

    Additional Windows desktop observations, submitted with the affected user's explicit authorization. These may be related to this report, but request-compression A/B testing has not been performed in this environment.

    Desktop version observed during diagnostics on 10 November 2026 was 26.1103.60933, build 25894, production channel. The app's local Codex executable reported 0.167.0-alpha.3.2.

    Three chats became unable to continue following screenshot-bearing tool results. The image was supplied through view_image inside a code-mode exec call and emitted as input_image, not Base64 text. Reading another chat's text history succeeded, and subsequent code-reading calls also succeeded. The first failure followed opening the referenced screenshot. Later plain-text follow-ups returned the same HTTP 400 body, {"detail":"Bad Request"}, from POST https://chatgpt.com/backend-api/codex/responses.

    The failing PNGs decoded and passed Pillow verification. Observed properties were 1280x720, RGBA, 3,690,783 bytes, with IHDR, one 3,690,726-byte IDAT chunk, and IEND. Lossless PNG re-encoding produced a 27,180-byte file with identical dimensions, mode and pixel bytes. That re-encoded image was successfully consumed in the separate diagnostic chat. A newly generated screenshot bypassed that preprocessing, again produced 3,690,783 bytes, and preceded another chat's first 400. This is a correlation and cross-chat workaround observation, not a controlled demonstration that PNG size or encoding is the root cause.

    Server correlation evidence, all UTC on 10 November 2026:

    • 05:04:40 screenshot tool output, then 05:04:41 HTTP 400, request 8ab48903-b02d-4164-be9d-3a1f2240b805, gpt-6-astra.
    • 05:05:10 follow-up HTTP 400, request 9fd60d75-5121-4e8f-b102-151beed9fcbc.
    • 06:07:04 new screenshot tool output in another chat, then 06:07:05 HTTP 400, request 09ec17ba-080e-48ab-a5b3-df77047716d1, gpt-6.1-sol.
    • 06:31:40 follow-up HTTP 400, request 08d68a4d-da3a-47de-a4e6-4b2d87056e52.

    Local logs near the first listed failure reported about 78,834 tokens, with full_context_window_limit_reached=false and token_limit_reached=false. These are client estimates only.

    Please correlate these requests with the compression-dependent failures above, improve the generic 400 diagnostic, and provide a supported recovery path for chats that repeatedly fail after an image enters their history. Re-encoding a file on disk does not replace its previously embedded bytes in the chat history. Recovery of the original chats has not been verified.

    Only this diagnostic summary and request correlation IDs are shared. No screenshots, private project content, account credentials or full transcripts are attached.

  6. xzchahaha-ctrl commented on Nov 11, 2026

    @xzchahaha-ctrl

    macOS corroboration with a strict same-body encoding comparison.

    Environment: macOS arm64; desktop 26.1103.60933; bundled codex-cli 0.167.0-alpha.3.2; ChatGPT authentication; official HTTP endpoint https://chatgpt.com/backend-api/codex/responses.

    The original desktop chat recovered with features.enable_request_compression=false, failed again after restoring the enabled default, and recovered after disabling it again. Runtime telemetry confirmed the disabled setting in the original restored core session. History and project files were preserved.

    A historical input reconstruction was generated in an isolated disposable session. This was NOT a capture of the original failed request. One native CLI zstd entity was captured locally, decoded and validated, then replayed as native zstd and as the exact decoded JSON bytes. The JSON was not reserialized. Both variants used the same HTTPS client, official endpoint, authentication and other headers; only Content-Encoding/Length differed. No redirects or automatic retries were used.

    Raw JSON: 53,642,541 bytes
    SHA-256: 53d5fd694b5e048e1af8fbf2b42ea7968fdb6193fafdcac7e3e6d7b2a5caf8c2
    Native zstd: 35,658,740 bytes
    SHA-256: 83c5ce31421e4118a4657dbb5787c9fde0fd0bfb15e8b213aaa10bc778d762ef
    Local zstd decompression and JSON validation both passed.

    Results on 2026-11-11 (UTC):

    • 07:03:50: zstd returned HTTP400 with the 24-byte body {"detail":"Bad Request"}; CF-Ray a58b708249da7963-NRT.
    • 07:04:10: identity returned HTTP200 and response.completed; CF-Ray a58b70fd6ee0de48-NRT.

    Earlier original desktop failure request IDs: 9f3c1fac-fbd8-43ae-bf8a-1ea51a7f4e2f and fa442a97-c05a-4da2-b9da-8760de560028.

    Counterexamples: some compressed original requests succeeded; a separate reconstructed input of about21.6MB completed in both encodings. No universal size threshold, duplicate-image rule, client compression corruption or specific backend component has been established. A separate WebSocket probe upgraded successfully but did not complete within90 seconds; it was stopped and no global transport change was made.

    Please correlate the request IDs/CF-Ray values and inspect entity receipt, Content-Encoding handling, decompression and post-decode validation. A supported recovery that preserves compression, plus an actionable error or controlled identity fallback, would help.

    This report contains no request body, images, game files, credentials, account identifiers or full logs. Original session content remains private.

  7. xulongwu4 commented on Nov 11, 2026

    @xulongwu4

    Same-body comparison from a different client, text only, with a sharp size boundary. Posting in case it helps narrow this down.

    Setup. Not the Codex CLI: requests were sent from Node 24.21 on Linux x64 to POST https://chatgpt.com/backend-api/codex/responses with ChatGPT auth. The body is compressed with Node's zlib.zstdCompressSync at level 3 and sent with Content-Encoding: zstd. I ran into this through the pi coding agent, which compresses its SSE requests this way. No images are involved anywhere.

    Captured requests. Four requests from long agent sessions (131 KB to 271 KB of JSON, text and tool calls only) were replayed with identical JSON bytes, changing only the encoding:

    Encoding Result
    zstd, level 3 HTTP 400 {"detail":"Bad Request"} in 13 of 13
    uncompressed completed in 18 of 18

    One of them was replayed again today at 14:56 UTC: still 400 with zstd, 200 without.

    Synthetic request. One user message, no tools, no images, padded with a fixed phrase to an exact JSON size:

    import fs from 'node:fs';
    import zlib from 'node:zlib';
    
    const bytes = Number(process.argv[2] ?? 131073);
    const body = {
      model: 'gpt-6-luna',
      instructions: 'Reply OK only.',
      input: [{ role: 'user', content: 'Test data follows; ignore it and reply OK. ' }],
      store: false,
      stream: true
    };
    const unit = '0123456789 abcdefghijklmnopqrstuvwxyz. ';
    const pad = bytes - Buffer.byteLength(JSON.stringify(body));
    body.input[0].content += unit.repeat(Math.ceil(pad / unit.length)).slice(0, pad);
    const json = JSON.stringify(body);
    const zst = zlib.zstdCompressSync(json, { params: { [zlib.constants.ZSTD_c_compressionLevel]: 3 } });
    fs.writeFileSync('body.json', json);
    fs.writeFileSync('body.json.zst', zst);
    console.log(Buffer.byteLength(json), 'JSON bytes,', zst.length, 'zstd bytes');
    JSON bytes zstd, level 3 uncompressed
    131,000 completed 1/1
    131,071 completed 2/2
    131,072 completed 2/2
    131,073 400 in 6/6 completed 3/3
    140,000 400 in 1/1
    262,144 400 in 2/2
    262,145 400 in 3/3

    The 131,073-byte body has SHA-256 6d1761c69066915a608491107189457fd986da5f1d43d213bb7f9de3fdeefaa1 and compresses to a 186-byte frame: one compressed block that decodes to 131,072 bytes, then a one-byte raw block. Node and the zstd 1.5.7 CLI both decode it back to the same bytes.

    What it is not. It is not a plain size limit and not every multi-block frame:

    • The same 131,073-byte JSON in a hand-built zstd frame of raw blocks only completed 2/2.
    • One captured 133 KB request failed 4/4 at level 3 and completed 2/2 at level 1 and 2/2 at level 9.
    • Larger zstd requests from the same sessions pass most of the time; in my runs about one request in 450 turns hits it.
    • Sending the compressed body in two chunks split at the block boundary did not help (400 in 3/3).

    So for this padding family at level 3 the boundary is exactly 128 KiB of decoded output in the first block, which looks like a decoder or buffer problem on the receiving side. I do not know the general rule for which frames fail.

    Response. Always the 24-byte body above, with server: cloudflare and x-openai-proxy-wasm: v0.1. Request ids (x-oai-request-id), 2026-11-11 UTC:

    • synthetic 131,073 bytes, 06:11:47: 5e168ad5-2973-40ee-ade8-0922eb98750b
    • captured request, 05:58:03: 457abe9c-acac-40d3-a6ed-6e91a7adcbfa
  8. WQMYH commented on Nov 12, 2026

    @WQMYH

    Additional Windows desktop occurrence on November 12, 2026. An active turn ended when POST https://chatgpt.com/backend-api/codex/responses returned HTTP 400 with the 24-byte body {"detail":"Bad Request"}.

    The environment was Windows 11 26H2 (build 26300.9974), Codex desktop package 26.1106.6628.0, and a locally built app-server based on 0.167.0-alpha.3.2. The failed request used gpt-6.1-sol.

    The same chat and app-server process used zstd for all four requests below.

    Response time (UTC) Bytes before compression zstd bytes HTTP status
    00:58:46.285 2,211,451 1,212,576 200
    00:59:26.975 2,230,039 1,224,366 400
    01:02:34.942 2,232,265 1,224,753 200
    01:04:59.707 2,286,878 1,258,926 200

    The x-oai-request-id was 06f2a997-21a0-4e99-b412-e72098233478 for the 400 and 21c5cad7-54f7-4217-ad7c-643181891282 for the first successful continuation.

    The failed turn recorded zero new image items. The later requests succeeded with larger compressed and uncompressed sizes. An identical-body compression A/B and the exact rejection reason remain unverified for this occurrence.

  9. hesssamu commented on Nov 12, 2026

    @hesssamu

    Linux corroboration (CLI app-server, not desktop), with failing request IDs.

    Environment

    • Linux x64, codex-cli 0.167.0 / 0.167.2, codex app-server driven by a third-party IDE
    • gpt-6-astra, medium reasoning; ChatGPT OAuth auth
    • wire_api = "responses", supports_websockets = false; requests pass through a local HTTP reverse proxy that forwards unchanged to https://chatgpt.com/backend-api/codex/responses
    • enable_request_compression at its default (true), so every request below was sent with zstd

    Observed: 11 HTTP 400 {"detail":"Bad Request"} failures across 6 conversations from 10 to 12 November 2026. After the first 400, every later message in the same conversation failed again (willRetry: false). Starting a fresh conversation with a summarized handoff was the only way to recover. Five of the six conversations were image-heavy (22 to 118 view_image / image-generation items). One was text-only, which matches the text-only report above.

    Size is not the trigger. In the same period, zstd requests of 100 to 132 MB pre-compression returned 200, while a 263 KB text-only request returned 400.

    UTC pre-compression bytes zstd bytes x-oai-request-id
    2026-11-11 18:56:57 262,790 99,136 25a455f8-1235-48b0-bb4b-0239e5aa0d0d
    2026-11-11 19:02:02 263,149 99,216 943b2c40-9624-47cc-a6fa-5cebc8752bb5
    2026-11-11 19:13:57 263,495 99,286 5e8cb239-c6ec-4ddd-becb-772f8c5b08a9
    2026-11-11 23:23:19 36,498,978 23,976,072 078f80cf-0114-4ff6-9f20-7cfea88e2c3f
    2026-11-11 23:24:54 36,500,046 23,976,156 06ca1be1-86b7-40ff-8855-9915ed0e5760
    2026-11-12 00:46:30 59,071,854 43,012,640 5db37aab-f6f7-4922-aade-d4c17526ff3b
    2026-11-12 03:20:36 23,814,657 17,238,588 ac0c1a84-1475-40e6-98d1-23b128c0c239
    2026-11-12 03:27:28 13,760,976 9,325,090 e97c1891-342b-41ef-af2f-fce9cb1bc8c8

    The first three rows (and rows 4–5, plus two more retries not listed) are repeated attempts on the same stuck conversation, each with only a few hundred bytes of new input.

    I have not yet run the compression on/off A/B on these conversations. I'm switching to features.enable_request_compression = false and will report back if the 400s stop or continue.

  10. xiaodongdong388 commented on Nov 15, 2026

    @xiaodongdong388

    macOS corroboration: controlled same-body HTTP test reproduces compression-dependent 400 (2026-11-16)

    I reproduced a compression-dependent rejection using synthetic inputs only on macOS. No original conversations, screenshots, project files, credentials, account IDs, or user paths are included here. No new desktop chat was created.

    Environment: desktop 26.1111.21308 build 27194; bundled CLI 0.169.0-alpha.11.1. The controlled test used Python urllib, the existing ChatGPT login, model gpt-6-astra / low, and POST https://chatgpt.com/backend-api/codex/responses. This is a direct HTTP reproduction, not an assertion that its serialized request matches the original desktop request. Existing networking and TLS verification were retained, with no redirects or auth refresh.

    The exact synthetic request body was:

    body = {
      "model": "gpt-6-astra",
      "instructions": "Transport diagnostic only. Ignore synthetic filler and images. Reply only PROBE_OK. Do not use tools.",
      "input": [{"role": "user", "content": [{"type": "input_text", "text": "a" * 140000}]}],
      "reasoning": {"effort": "low"},
      "tools": [],
      "stream": True,
      "store": False
    }
    raw = json.dumps(body, separators=(",", ":"), ensure_ascii=False).encode("utf-8")

    Raw JSON: 140280 bytes; SHA256 2128d5f91665ed53c2a0d8ce1d73d36bed1abdd73686bc825b87fb2ed3cdab1f.
    Python zstandard backed by zstd 1.5.7 produced a 245-byte frame:

    compressor = zstd.ZstdCompressor(level=3, write_content_size=False).compressobj()
    wire = compressor.compress(raw) + compressor.flush()

    Compressed SHA256: 48e1c5da4172200c75890ddfb959c8df5f2ae93f781bd593e0301c543289124d.
    Decompressing with ZstdDecompressor().stream_reader verified exact equality to raw before each compressed request. Compressed requests used Content-Encoding: zstd; plain requests omitted this header. All other request content was unchanged.

    Observed sequence (UTC+08:00):

    • 2026-11-16T06:26:51.480955+08:00: zstd, HTTP 400, request ID 218eb949-3cce-4c65-a5eb-3d81a49ad032, result {"detail":"Bad Request"}.
    • 2026-11-16T06:26:56.016440+08:00: plain, HTTP 200, request ID ffd50176-017c-4539-86a8-4faa506f6fa6, result PROBE_OK.
    • 2026-11-16T06:27:15.261140+08:00: plain, HTTP 200, request ID a87514fb-d3f9-4150-a28d-a35a2cfacfd5, result PROBE_OK.
    • 2026-11-16T06:27:26.326031+08:00: zstd, HTTP 400, request ID 3b01ced7-955d-4119-92d5-6e0f45708e3e, result {"detail":"Bad Request"}.

    The order was compressed / plain / plain / compressed: both plain requests completed, both compressed requests returned only {"detail":"Bad Request"}. A small plain-text baseline and a separate pair of repeated synthetic PNG inputs succeeded; the repeated-image pair succeeded both compressed and uncompressed. This is not a universal rejection of compression, images, or request size.

    Separate desktop recovery evidence: after project-level features.enable_request_compression=false and a full app restart, two existing chats (including the previously failed execution chat) each returned the original triggering JPEG twice and continued successfully. Runtime flags confirmed false. Original histories and production files were preserved. This is a targeted recovery result, not proof that all HTTP400 causes are fixed.

    Please correlate the four request IDs and fix the receive-path handling of this valid compressed representation. The precise internal component remains unknown from client evidence. Please also return actionable validation details or provide a safe uncompressed fallback instead of stranding existing chats with a generic400.

    Submitted by the user's Codex assistant with explicit permission to publish this sanitized report only.

  11. Lzy0128 commented on Nov 16, 2026

    @Lzy0128

    Windows desktop recovery of a repeatedly failing existing chat (2026-11-16)

    An existing Windows desktop chat repeatedly returned HTTP 400 with the 24-byte body {"detail":"Bad Request"}. After disabling request compression and reloading the app, the same chat resumed and its next six completed HTTP requests returned 200.

    Environment: Windows 11 x64, build 26200; Codex Desktop 26.1111.2228.0; ChatGPT authentication; gpt-6.1-sol, reasoning effort ultra. The logged endpoint was POST https://chatgpt.com/backend-api/codex/responses.

    Failure sequence

    All times below are UTC on 2026-11-16. Byte counts are logged sizes before compression and after zstd compression.

    Response time HTTP Raw bytes zstd bytes x-oai-request-id
    03:50:15 200 4,313,654 2,662,318 0d9ca3d3-877a-4eb8-8ad1-ff00f9bcc680
    03:50:41 400 4,699,368 2,668,476 a6a1f74f-12ee-48b4-8aa1-2199af0ab3b1
    05:16:18 400 4,699,743 2,668,620 e46693ce-2d3a-4766-b560-ab030ec1a6f4
    05:16:51 400 4,700,097 2,668,674 1bbd11f0-d272-46bd-a75b-891b930b885d
    05:18:13 400 4,700,475 2,668,765 70ba2b88-43a0-4e39-8939-18332f5a6241
    05:22:06 400 4,701,469 2,669,147 173e9113-2e2d-4709-b8fa-a0e4c4088d8b

    Immediately before the first failure in this sequence, view_image returned a PNG already shown successfully about six minutes earlier. Its embedded data URL matched the earlier one byte for byte: 1900 × 1344 pixels, 280,534 decoded bytes, detail=original. Later short text-only follow-ups in that same chat also failed.

    The preceding successful model response reported 196,084 input tokens and 196,741 total tokens. The client then reported a 200,036-token post-tool context estimate against an 828,400-token usable window and a 784,800-token auto-compaction threshold. Both limit-reached flags were false. Automatic history compaction had completed about 30 minutes earlier, followed by many successful requests.

    Recovery of the original chat

    At 05:28 UTC, this setting was saved in the existing user configuration:

    [features]
    enable_request_compression = false

    After the app reloaded, runtime telemetry confirmed feature.enable_request_compression=false. The original chat continued with HTTP 200 at 05:31:16, 05:31:59, 05:32:27, 05:33:03, 05:34:52 and 05:37:31. Its request logs no longer showed zstd request compression. Two correlation IDs after recovery:

    • 05:31:16: e6296024-5519-4e80-bfc1-5a3e8d7ff077.
    • 05:37:31: 5b6eaba4-c660-4fc1-b77d-c43b860fd38c.

    The existing history and data-storage layout were retained. Recovery required no reinstall or restoration of older runtime packages.

    This records recovery after a configuration change and app reload. A byte-identical request-body A/B test has not been performed on this installation. Some compressed requests had succeeded earlier. These observations support investigating the compressed-request path; the precise internal failure remains unknown from client evidence.

    Please correlate these request IDs and investigate why this request sequence returns only a generic 400. An actionable validation/decompression error and a safe, bounded uncompressed fallback would help users recover existing chats without moving their work to new ones.

    Original conversations, images and full logs remain local. The technical metadata and correlation IDs above should allow server-side investigation.

  12. hukaiedu commented on Nov 17, 2026

    @hukaiedu

    Also hitting this on Windows 11 with a different build, and it matches the image-bearing-request pattern.

    Environment

    • Codex Desktop 26.1111.2228.0, bundled CLI 0.169.0-alpha.11.1
    • Windows 11 Pro (26200)
    • Model gpt-6.1-sol, reasoning effort high, ChatGPT auth
    • Transport: Responses API (supports_websockets = true at the time of the failure)

    Observed sequence

    1. Attached a ~700 KB PNG screenshot to a new chat. The image item was sent with detail: "original" (in earlier chats that worked, images were sent with detail: "high").
    2. The model replied, then a local exec tool call re-read the same PNG via view_image; the custom_tool_call_output contained the same image (base64 length 931,662).
    3. The next continuation request failed with {"detail":"Bad Request"}. The UI showed "Reconnecting 5/5" for ~2 minutes before the failure (time_to_first_token_ms ≈ 117 s in the rollout).
    4. After that, every message in the chat failed immediately with the same 400, including one-character text messages.
    5. Reproduced in a second new chat with the same screenshot: the failure occurred again right after the tool returned the image.

    Notes

    • Earlier sessions with images of ~160-500 KB (detail: "high") completed normally.
    • No local server is involved; the failure is on the model request, not on any project code.
    • enable_request_compression is present in this build. I will A/B test with features.enable_request_compression = false and report back.
  13. orkunkinay commented on Nov 17, 2026

    @orkunkinay

    Tested client recovery that preserves the existing conversation

    I investigated the client-side continuity failure and prepared a small patch with deterministic regression tests. The production change is confined to the HTTP Responses client; it preserves the serialized conversation and adds a bounded encoding fallback.

    Review the patch · Implementation · Investigation · Validation details

    Reproduction and recovery

    A local receiver rejects zstd requests with the reported 400 {"detail":"Bad Request"} and accepts uncompressed JSON. Submit retained history containing a user image and the completed result of reading that same image. The original implementation stops with HTTP 400; the patched client completes. The test verifies byte-for-byte equality between the decoded compressed request and the uncompressed fallback.

    The fallback sends the same serialized JSON once without compression after an explicit pre-stream rejection: the exact opaque 400 above, HTTP 413, or HTTP 415. Authentication is reapplied to the prepared body. Detailed validation/policy errors, disconnects, and errors inside an accepted stream do not trigger encoding recovery. A rejected fallback returns its normal error and correlation data.

    Proof that the conversation survives

    Two core regressions check durable continuity:

    • Failed image continuation → restart → recovery: a real image tool completes, both encodings of its continuation are rejected, and the same persisted thread is restarted. Recovery retains the original user content, attachment, and completed tool output unchanged. The image tool executes exactly once across failure and restart.
    • Compaction → restart → recovery: the client recovers a rejected remote compaction request, persists its checkpoint, restarts the same thread, and retains both the checkpoint and user decision in the next recovered request.

    API fault-injection tests · Core continuity tests

    cargo test -p codex-api --test responses_compression
    RUST_MIN_STACK=33554432 cargo test -p codex-core --test all suite::request_compression

    Validation and limits

    525 targeted tests passed on macOS arm64 with Rust 1.99.1, covering the API, HTTP client, image utilities, and focused core recovery, WebSocket, resume, and compaction suites. API Clippy passed with warnings denied. Three additional code-mode cases failed with an unavailable exec tool on both the original and patched implementations; they are recorded separately.

    An unused V8 Chromium dependency fetch blocked normal workspace resolution. Validation used an isolated copy with workspace members narrowed to API and core and the unused V8 git patch excluded. Changed source and tests were identical, and the resolved dependency versions matched the repository lockfile. This is targeted validation; Windows, Linux, and the proprietary desktop/backend were not exercised.

    The receiver fixture establishes client recovery under controlled rejection. The precise production rejection mechanism remains unconfirmed, and a generic 400 does not prove a compression defect. Invalid attachments, corrupt persistence, and oversized uncompressed requests remain separate failures. The patch adds no history deletion, persistence migration, or production dependency.

    Would maintainers consider adopting this bounded client protection while investigating the receiver-side rejection? The patch is provided in a public fork in accordance with the issue-first contribution policy.

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

    CLIbugconnectivitywindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions