codex - 💡(How to fix) Fix Feature request: make request compression explicit instead of conditional behind enable_request_compression

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

Request compression should support an explicit user-controlled mode, rather than only a conditional auto-enable path.

Today features.enable_request_compression = true sounds like "compress request bodies when this is enabled", but the actual behavior is narrower:

  • compression is only used for Responses API requests
  • only when using ChatGPT auth
  • only when the provider is OpenAI
  • otherwise the client silently falls back to no compression

That makes the config name misleading for operators. If I explicitly enable request compression in ~/.codex/config.toml, I expect it to either:

  1. force compression when possible, or
  2. fail loudly / log clearly when the request will not be compressed

A more explicit configuration model would be easier to reason about, for example:

  • request_compression = "off" | "auto" | "zstd"
  • or keep the current default behavior and add force_request_compression = true

The current design behaves more like auto_if_supported_for_selected_auth_and_provider than enable_request_compression.

Additional information

Why this matters in practice:

  • resumed / long-running threads can produce very large /responses request bodies
  • these bodies often contain large JSON structures, tool state, image references/base64, HTML, and encrypted reasoning payloads
  • compression can be the difference between fitting through a proxy/gateway body limit or failing with 413 Payload Too Large

In a real session I measured, the serialized rollout was about 30.6 MB:

  • raw: 30.6 MB
  • gzip -6: 21.7 MB
  • zstd -3: 10.6 MB

So this is not just a naming nit; it materially changes whether large resumed threads succeed.

I am not asking for the current default to change unconditionally. The request is to expose a configuration surface whose semantics match what operators expect:

  • off: never compress
  • auto: current conservative behavior
  • zstd / force: always compress outgoing JSON request bodies for Responses API

If there are compatibility concerns for some providers or auth modes, a clear warning would still be much better than silently ignoring an explicitly enabled setting.

extent analysis

TL;DR

To address the issue, consider adding a more explicit configuration model for request compression, such as request_compression = "off" | "auto" | "zstd", to provide operators with clear control over compression behavior.

Guidance

  • Introduce a new configuration option, e.g., force_request_compression, to allow operators to explicitly enable compression for all requests, regardless of the auth mode or provider.
  • Update the features.enable_request_compression configuration to clearly reflect its current behavior, such as renaming it to features.enable_auto_request_compression.
  • Consider adding a warning or log message when the features.enable_request_compression setting is enabled but compression is not actually used, to alert operators to potential issues.
  • Evaluate the feasibility of supporting compression for all requests, regardless of auth mode or provider, to simplify the configuration model and improve usability.

Example

# Example configuration snippet
[features]
request_compression = "auto"  # or "off", "zstd", etc.
force_request_compression = true  # optional

Notes

The proposed solution focuses on improving the configuration model and providing clearer control over compression behavior. However, the actual implementation details may vary depending on the specific requirements and constraints of the Codex project.

Recommendation

Apply a workaround by introducing a new configuration option, such as force_request_compression, to provide explicit control over compression behavior, as this approach allows operators to opt-in to the desired behavior without changing the default settings.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Feature request: make request compression explicit instead of conditional behind enable_request_compression