Claude Code errors or model mapping fails with the CC Switch proxy on
Quick fix
Upgrade to v3.15.0 or newer, then set the global outbound proxy explicitly in cc-switch so a stale system proxy cannot be cached by an old process.
Symptom
Section titled “Symptom”开启ccswitch代理后,在vscode中使用cc插件,会出现Cannot read properties of null (reading 'output_tokens')导致对话中断,但通过ccswitch的会话管理,可以看到对话其实并没有真的中断With the ccswitch proxy on, using the cc plugin in vscode produces Cannot read properties of null (reading 'output_tokens') and the conversation breaks off — but through ccswitch's session management you can see the conversation did not actually stop.
This cluster covers several related problems in the cc-switch proxy and network layer. At their core: request forwarding, model mapping, and system proxy state sync are all unstable. The most typical, now fixed, one: with the cc-switch proxy on, the Claude Code VS Code plugin or CLI hits an empty field while reading the upstream response, so the front end reports Cannot read properties of null (reading 'output_tokens') while cc-switch session management shows the conversation still running. A maintainer confirmed this was fixed in v3.15.0.
The other variants: cc-switch does not follow the system proxy automatically, and may keep using the old proxy address after you close or switch proxy software, so you have to restart cc-switch or configure a global outbound proxy explicitly; proxy ports save incorrectly; incomplete model mapping or unregistered date aliases break routing; conflicts with Surge and similar tools on macOS; plus some unclosed issues around model pass-through, system role conversion, and image tool_result serialisation. They all belong to the proxy/network/routing path but are fixed to different degrees, so if one persists after upgrading, troubleshoot it separately.
Upgrade cc-switch to v3.15.0 or newer. A maintainer confirmed that version fixes Cannot read properties of null (reading 'output_tokens') in the Claude Code plugin/CLI with the proxy on.
If you use a system proxy tool such as Surge, Clash, mihomo, or v2ray, do not rely on cc-switch detecting it automatically. Fill in the address and port explicitly under 设置 -> 路由 -> 全局出站代理 (Settings > Routing > Global outbound proxy).
If Claude Code requests still fail after you close or switch the system proxy, restart cc-switch so it re-reads the current network and proxy state.
If the error is that a model does not exist, is not registered, or that model mapping failed, check the provider model mapping is complete — Claude Code / Claude Desktop / Cowork may request a model name with a date suffix, such as claude-haiku-4-5-20251001, which has to map to a model actually available upstream.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 21 real issues
- #716代理问题,无法携带图片
- #855[Bug] 软件无法自动识别系统代理
- #1117vs code的claude code插件无法被代理
- #1532bug: 全局出站代理和单独配置代理无法保存自己的端口号
- #1684CCS,在claudecode 中使用gpt系列模型需要开启代理的时候出现下面的错误。ccs版本3.12.3
- #1965cc还是无法使用gpt模型
- #2041打开代理失败
- #2180出现Cannot read properties of null (reading 'output_tokens')该如何解决
- #2224Responses adapter drops tool_result images, serializing them as raw JSON / Responses 适配器丢弃 tool_result 图片,被序列化为原始 JSON
- #2501内置提示词注入:代理层向每条消息注入 <think> 思维链指令
- #2881代理相关问题
- #2900claude 桌面版模型映射问题
- #2964macOS 上,使用 surge,无法正常使用 CC-switch 代理功能。
- #2983Cowork 调用子代理时无法解析claude-haiku-4-5-20251001
- #4115不支持将Claude的message中system role转为不支持system role的 OpenAI 兼容的Chat Completions API
- #4219ClaudeCode代理出现模型代理失败的情况
- #4445关闭mihomo之后ccs全都无法连接了
- #4739bug: 启用多个 Xiaomi MiMo 供应商时,向上游请求 claude-opus-4-8 导致 API 响应错误并触发 provider 熔断
- #5035大家是否遇到CC Switch运行后,VScode Roo Code plugin 无响应异常情况?
- #5399claude-desktop gateway: requests containing official Grep tool (offset description with shell pipe) or mcp__Claude_Browser__preview_* tools silently fall back to broken passthrough → 502 SendRequest
- #6042Bug: Claude Code workflow 运行日志 journal.jsonl 在会话管理中以幽灵会话显示
- What if Cannot read properties of null (reading 'output_tokens') persists after upgrading to v3.15.0?
- A maintainer asked for the original issue to be reopened with the latest version number, reproduction steps, and relevant logs, noting it may be a remnant in the new version or a different proxy-path problem.
- Does cc-switch use the system proxy automatically?
- Not reliably. Several issues show cc-switch may still use the old proxy after you close or switch the system one. Configure a global outbound proxy explicitly, or restart cc-switch.
- The cc-switch proxy does not work with Surge on macOS. What now?
- Try configuring a rule in Surge so it does not intercept cc-switch HTTP requests, or set the Surge proxy address under 设置 -> 路由 -> 全局出站代理 (Settings > Routing > Global outbound proxy). Some users have still not confirmed this fully resolved.
- Is a model mapping failure, or a model-does-not-exist / no-permission error, related to the proxy?
- Yes. The cc-switch proxy layer has to map the model name Claude Code requests onto one the upstream provider supports. If the mapping is incomplete, or upstream does not accept a date-suffixed model name, it surfaces as model not found, no permission, or a routing failure.
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.