The thinking process is not shown after using the Claude Code proxy feature - cc-switch
Quick fix
Switch back to the Anthropic protocol to restore the thinking display; on openai_chat, change the block conversion in streaming.rs.
Symptom
Section titled “Symptom”我使用cc-Switch的代理功能,让claudecode使用openai协议的api来调用模型,但是在使用中无法显示模型的思考过程,使用anthropic协议却可以正常显示I use the cc-Switch proxy feature to make claudecode call the model through an openai-protocol api, but the thinking process is not shown in use — with the anthropic protocol it displays normally.
Both issues point at `create_anthropic_sse_stream` in `src-tauri/src/proxy/providers/streaming.rs`. An OpenAI-compatible vendor (Qwen, for instance) may send `reasoning_content` and `content` alternately, while Anthropic SSE content blocks are sequential. The current implementation tracks only `current_non_tool_block_type`, so every switch between `reasoning` and `content` emits a `content_block_stop` and a new `content_block_start`.
That produces two variants: in #2009, the thinking content of models like Qwen is not mapped to a displayable `thinking` block, so the user cannot see the thinking process; in #5692, the alternating stream turns into 24 `thinking` blocks and 23 `text` blocks, and Claude Code renders each `text` block as its own bullet, producing a fragmented reply. To be clear: #5692 proposes ignoring late `reasoning` once text has started, and its local normalizer verification shows displayed thinking blocks at `0`, which does not match what #2009 wants — the thinking process displayed normally. Neither issue is closed, and there is no merged fix yet.
Temporary check: if the provider also offers the Anthropic protocol, switch back to it and confirm the thinking process displays normally (#2009 reports that protocol works).
If you must use `openai_chat`, open `src-tauri/src/proxy/providers/streaming.rs` and find the block-switching logic in `create_anthropic_sse_stream` that turns `reasoning` into `thinking` and `content` into `text`.
Following the proposed fix in #5692, add a "visible text has started" state flag: before the first text delta arrives, `reasoning` can enter a `thinking` block; once text has started, late `reasoning`/`reasoning_content` no longer closes the current text block and no longer emits a new `content_block_start`.
Add a regression test that constructs a stream alternating `reasoning_content` and `content`, asserting exactly 1 `thinking` block and 1 `text` block, that the text delta concatenation loses nothing, and that reasoning after text starts is no longer emitted.
Restart cc-switch, then run `claude -p --verbose --output-format stream-json --include-partial-messages "What model are you?"` and confirm Claude Code no longer shows multiple fragmented bullets.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Why do some models (km2.5, gpt120b) show the thinking process while Qwen and others do not?
- Vendor APIs are not entirely consistent and orchestrate the thinking stream differently. When the way cc-switch recognizes and converts `reasoning`/`reason_context` or `reasoning_content` does not match how Qwen emits it, the thinking process is invisible.
- When the thinking process is not shown, does that mean the model did not have thinking/`high` enabled?
- Per the comments on #2009, even with nothing displayed the reply can still come from a model with `high` thinking enabled — not seeing it does not necessarily mean the model did not think.
- Will the thinking process still be displayed after applying the proposed fix in #5692?
- No. The local verification in #5692 shows displayed thinking blocks at `0`, meaning late `reasoning` after text starts is ignored. If your goal is to display the whole thinking process, this direction does not resolve #2009 directly.
- Does this change affect tool calls, parallel reads, multi-turn, or subagents?
- #5692 used a local normalizer to verify that sequential tools, parallel reads, multi-turn resume, and subagents keep working, but that verification is not merged into cc-switch — run your own regression before merging.
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.