Qwen model errors or truncation - CC Switch
Quick fix
Upgrade to CC Switch v3.16.4 and use the matching new Qwen / OpenCode Go presets.
Symptom
Section titled “Symptom”Range of max_tokens should be [1, 8192]This cluster holds several variants of Qwen connectivity problems: 1) an early Qwen request port change producing 404s or parameter errors; 2) strict OpenAI-compatible backends such as Nvidia rejecting a request because the conversion left several system messages; 3) the OpenCode Go /v1/messages endpoint being unavailable so Claude Code retries endlessly, while /v1/chat/completions works; 4) Codex with Qwen going through a Responses→Chat conversion that truncates the stream abnormally; 5) models such as qwen-vl-plus capping max_tokens, so a Claude Code initialisation request above 8192 errors. Maintainers confirmed across several issues that upgrading to v3.16.4 and using the new provider presets resolves the Qwen / OpenCode Go / Codex routing problems; the max_tokens cap has no confirmed fix in the issues provided.
Upgrade CC Switch to v3.16.4 or newer.
Delete the old Qwen, OpenCode Go, or related manual provider configurations, then pick the built-in preset again.
If you use OpenCode Go in Claude Code, pick the newly added OpenCode Go preset so it goes through openai_chat on the /v1/chat/completions channel.
If you use Qwen / Bailian in Codex, use the v3.16.4 Codex preset that switched to the native OpenAI Responses endpoint, avoiding stream truncation from the Responses→Chat conversion.
For a qwen-vl-plus max_tokens limit error, the issues offer no confirmed fix. Use a model not subject to that cap for now, or wait for an option that clamps max_tokens.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 5 real issues
- Why does configuring environment variables directly work for Qwen in Claude Code without CC Switch?
- Users report the Qwen config in older CC Switch failing because of an incorrect request port or conversion path. After upgrading, use the built-in preset again rather than carrying the old manual config forward.
- Why are OpenCode Go /v1/messages models unavailable in Claude Code?
- Maintainers explain v3.16.4 added an OpenCode Go preset that converts through openai_chat onto the working /v1/chat/completions channel, sidestepping the unavailable native /v1/messages endpoint.
- Why does Codex truncate abnormally with Qwen?
- In v3.16.3, Codex reaching Qwen went through a Responses→Chat routing conversion that could truncate the stream abnormally. v3.16.4 switched to the native OpenAI Responses endpoint.
- qwen-vl-plus reports Range of max_tokens should be [1, 8192]. What now?
- The max_tokens in the Claude Code initialisation request exceeds the model cap. Users asked for an option to clamp max_tokens, but no maintainer has confirmed a fix.
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.