"Expecting property name enclosed in double quotes" Codex
Quick fix
Upgrade CC Switch to v3.16.4 or newer to fix the JSON parse error caused by a large request body not being decompressed.
Symptom
Section titled “Symptom”CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Agnes; model: agnes-2.0-flash; upstream_status: HTTP 400; cause: ***.BadRequestError: OpenAIException - {"error":{"message":"Expecting property name enclosed in double quotes: line 1 column 2 (char 1)","type":"BadRequestError","param":null,"code":400}}Sending a large or complex request through Codex, the CC Switch Responses-to-Chat-Completions conversion layer hits a JSON serialization error, so the upstream provider rejects the request with HTTP 400.
The root cause is a large request body not being decompressed correctly before the JSON parse (with gzip, br, deflate, and zstd encodings stacked). The proxy handed the raw compressed bytes to serde_json, producing illegal JSON missing its double quotes ({property_name: "value"}, for instance). This was resolved in v3.16.4 by fixing the decompression logic.
Upgrade CC Switch to v3.16.4 or newer, which fixes a large request body not being decompressed correctly before the JSON parse.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- After upgrading to v3.16.4 the JSON error is gone, but cache hit tokens stay at 0 while input tokens keep accumulating. Why?
- That is a separate problem. A cache hit of 0 usually relates to the caching mechanism or API implementation of the upstream provider (Agnes AI), not the CC Switch JSON parsing fault.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.