Skip to content

Codex 0.155.0 requests fail when request compression is enabled #469

Description

@cyberElar

Codex 0.155.0 /responses requests fail when zstd request compression is enabled

Environment

  • cc-switch-cli: 5.10.5
  • Codex CLI: 0.155.0
  • Codex app-server: 0.155.0
  • Provider: DeepSeek
  • Codex route: local proxy on 127.0.0.1:15722
  • Model: deepseek-v4-flash

CC Switch proxy configuration includes:

Codex: enabled
127.0.0.1:15722

Routes:
/chat/completions
/v1/chat/completions
/responses
/v1/responses

Problem

With the default Codex configuration, even a simple request fails immediately:

› test

■ Failed to parse the request body as JSON: expected value at line 1 column 1

The failure occurs before model inference.

I initially verified that this was not caused by an app-server version mismatch. Both the CLI and app-server are now running 0.155.0:

cliVersion: 0.155.0
appServerVersion: 0.155.0

The issue still occurs.

Reproduction

Run:

codex

Then send:

test

Result:

Failed to parse the request body as JSON:
expected value at line 1 column 1

Confirmed workaround

Starting Codex with request compression disabled fixes the issue immediately:

codex -c 'features.enable_request_compression=false'

After doing this, the same request works normally through the same CC Switch proxy and the same DeepSeek provider.

The issue can also be avoided permanently with:

[features]
enable_request_compression = false

in ~/.codex/config.toml.

Likely cause

Codex 0.155.0 sends compressed request bodies when request compression is enabled, using zstd through Content-Encoding.

The CC Switch Codex /responses route appears to attempt JSON deserialization before decoding the compressed request body.

This would explain why the parser fails immediately at:

line 1 column 1

rather than failing on a specific JSON field.

The observed request path is approximately:

Codex 0.155.0
    |
    | zstd-compressed Responses request
    v
CC Switch local proxy :15722
    |
    | JSON parsing before decompression
    v
Failed to parse request body as JSON

Expected behavior

When a Codex request contains:

Content-Encoding: zstd

CC Switch should decompress the body before attempting JSON deserialization and Responses-to-Chat conversion.

Actual behavior

The compressed request body appears to be passed directly to the JSON parser, producing:

expected value at line 1 column 1

Additional verification

The following command consistently works:

codex -c 'features.enable_request_compression=false'

while regular:

codex

consistently fails with the JSON parsing error.

This makes request compression the minimal reproducible trigger.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions