跳到正文
DEV Community· DebugRadar·· 1 小時前AI 評分30

Codex CLI zstd 壓縮導致 400 錯誤的排查指南

Fix: Codex CLI zstd Compression 400 Error

AI 導讀

Codex CLI 0.167.0 在 ChatGPT auth 下,zstd 壓縮請求可能因個別區塊解壓後膨脹過大而收到 400 錯誤;同一請求未壓縮時則可成功。目前沒有經驗證的用戶端修復方法,停用壓縮尚未驗證,縮小請求也只是未經測試的緩解方式;壓縮整理無助解決問題。

正文

Originally published on DebugRadar.

Fix: Codex CLI zstd Compression 400 Error

Quick Fix Summary

  • Problem: Codex CLI requests fail with a bare 400 {"detail":"Bad Request"} on chatgpt.com/backend-api/codex/responses when the zstd-compressed body contains a part that decompresses far beyond its compressed size. The same request uncompressed succeeds.
  • Fix: No verified user-side fix exists. Disabling request compression is discussed but NOT verified — do not treat it as a fix. Confirm the bug first (zstd on, bare 400, uncompressed succeeds), then shrink the request as an untested mitigation.
  • What happened: First reported November 14, 2026 (GitHub issue openai/codex#61489, 12 comments). Still open as of November 15, 03:30 UTC — no staff reply, very active November 14–15.

Technical Root Cause

Error Code Affected Version Root Cause Current Status
Bare 400 {"detail":"Bad Request"} on requests to chatgpt.com/backend-api/codex/responses Codex CLI 0.167.0, ChatGPT auth (Pro 500), gpt-6.1-sol, Linux x86_64 (CentOS 8) The backend rejects highly compressible zstd bodies (features.enable_request_compression, default on for ChatGPT auth). The documented rule is a 413 at 100x expansion — the backend returns a bare 400 instead, and Codex never retries uncompressed. Per-block expansion triggers it: a 2.65x overall ratio still failed in the related #60594 report. Still open as of Nov 15, 2026 — openai/codex#61489, 12 comments, last activity Nov 15 03:30 UTC, no staff reply. Weakest of this batch on the workaround axis: no verified fix, CLI-only, Linux-heavy, very technical

Step-by-Step: What to Do When Codex CLI Returns a Bare 400

Step 1 — Confirm It Is the zstd Bug

Confirm the three-way pattern before you change anything: the request fails with a bare 400 while zstd compression is on, and the same request succeeds uncompressed. If the uncompressed request also fails, it is a different problem — do not chase the compression angle.

Step 2 — Do Not Rely on Compaction

Compaction will not help — it carries the same payload, so the compressed body trips the same backend limit. Do not waste a session compacting to work around this.

Step 3 — Shrink the Request (Untested Mitigation)

Shrinking the request is the only mitigation on the table, and it is untested — flag it honestly. A smaller, less repetitive body is less likely to trip the per-block expansion limit, but nobody has verified that shrinking fixes a failing request. Try it on a copy, not on your live session.

Step 4 — Do Not Treat Disabling Compression as a Fix

Disabling request compression is discussed in the thread but NOT verified. Do not present it as a fix, and do not change a default you cannot test back. If you try it, treat it as an experiment and report the result on the issue — the thread needs a verified workaround.

Step 5 — Know the Related Reports

This is not a one-off: #60594 (HTTP 400 for repeated image inputs with zstd, Windows, Nov 10) and #41338 (Aug 28, same bare 400 on a 34.78 MB body) show the same pattern. The newest check (Nakagawa-master, Nov 15 03:30 UTC) verified the compression fallback in the current main source — distinct from the reported backend ratio limit — and there is still no staff reply.

The same discipline applied to the desktop app failure in Fix: Codex Desktop App Error 0x80073D02 & 0x800706D9 — when there is no verified user-side fix, say so plainly instead of publishing a fake one. And the same family showed up in the Work Mode outage in Fix: ChatGPT Work Mode HTTP 500 Error — a bare server-side error with no user-side fix, where the honest move is evidence and a workaround.

FAQ

Is there a verified fix for the Codex CLI 400 error?

No. There is no verified user-side fix. Disabling request compression is discussed but not verified, compaction does not help (same payload), and shrinking the request is an untested mitigation. The issue is still open with no staff reply.

Why a bare 400 instead of a 413?

The documented rule is a 413 at 100x expansion, but the backend returns a bare 400 {"detail":"Bad Request"} instead — and Codex never retries uncompressed. The bare 400 is what makes this hard to diagnose: it looks like a bad request, but the request is fine uncompressed.

Does compaction help?

No. Compaction carries the same payload, so the compressed body trips the same backend limit. Do not waste a session compacting to work around this.

Sources: GitHub issue, "Codex CLI zstd Compression 400 Error" (openai/codex#61489), November 14, 2026 (https://github.com/openai/codex/issues/61489).


Read the full guide on DebugRadar

來源:DEV Community · dev.to