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:
Then send:
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:
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:
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:
consistently fails with the JSON parsing error.
This makes request compression the minimal reproducible trigger.
Codex 0.155.0
/responsesrequests fail when zstd request compression is enabledEnvironment
5.10.50.155.00.155.0127.0.0.1:15722deepseek-v4-flashCC Switch proxy configuration includes:
Problem
With the default Codex configuration, even a simple request fails immediately:
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:The issue still occurs.
Reproduction
Run:
Then send:
Result:
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:
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
/responsesroute appears to attempt JSON deserialization before decoding the compressed request body.This would explain why the parser fails immediately at:
rather than failing on a specific JSON field.
The observed request path is approximately:
Expected behavior
When a Codex request contains:
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:
Additional verification
The following command consistently works:
codex -c 'features.enable_request_compression=false'while regular:
consistently fails with the JSON parsing error.
This makes request compression the minimal reproducible trigger.