expected value at line 1 column 1 - Claude Code / Codex
Quick fix
Upgrade to cc-switch v3.14.1 or newer to fix the JSON parse failure caused by Codex OAuth forcing an SSE stream.
Symptom
Section titled “Symptom”解析上游响应失败: expected value at line 1 column 1Failed to parse the upstream response: expected value at line 1 column 1
On the Codex (ChatGPT Plus/Pro) provider through the OAuth reverse proxy, the upstream interface chatgpt.com/backend-api/codex/responses always returns an SSE streaming response regardless of the client stream parameter.
In cc-switch v3.13.0, when the client (Claude Code or Codex) sends a non-streaming request (stream: false), the proxy layer forces stream: true upstream, but the response handling side (handle_claude_transform) does not know that and still parses the SSE data the upstream returns as ordinary JSON — hence the expected value at line 1 column 1 parse error.
Upgrade cc-switch to v3.14.1 or newer. That version handles the upstream response as SSE for the Codex OAuth combination and aggregates it for a non-streaming client.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- What if it still reproduces after upgrading?
- Make sure you really upgraded to v3.14.1 or newer. If it persists, reopen the issue on GitHub with the latest logs attached.
- How do I fix this by hand in the source?
- In the handle_claude_transform function in src-tauri/src/proxy/handlers.rs, change the streaming test to let is_stream = is_stream || api_format == "openai_responses"; so openai_responses always takes the streaming parse path, then rebuild.
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.