Skip to content

content_block_start events fragmented hundreds of times - Claude Code

Quick fix

Upgrade to the next cc-switch version with b78192e8f; it ignores empty reasoning_content and merges consecutive text deltas.

Error output
continuous text is broken into dozens of separate lines.

During cc-switch's openai_chat-to-Anthropic SSE conversion, when an upstream delta contains both content and an empty reasoning_content field, the converter handles block lifecycles based on field presence. As a result, each content delta closes the text block, opens an empty thinking block, then reopens the text block, causing Claude Code to render the response as many separate lines or bullet points.

This issue was reproduced in both v3.16.3 and v3.20.0. The maintainer confirmed that the fix was merged into main (b78192e8f): it ignores empty reasoning_content and appends consecutive content deltas to the same text block. The fix will be released in the next version. Truly interleaved non-empty reasoning/content, and other fragmentation cases where every chunk carries finish_reason: "", are outside this page's scope.

  1. Upgrade to the next cc-switch version that includes the b78192e8f fix. After upgrading, when reasoning_content is empty in an upstream delta, cc-switch should ignore it and merge consecutive content deltas into one text block.

  2. Before the fixed version is released, use LiteLLM's native /v1/messages Anthropic adapter endpoint, or another adapter that correctly accumulates content blocks.

  3. If the issue still reproduces after upgrading, provide a raw SSE capture through a local proxy as requested by the maintainer, then reopen the issue.

ToolClaude Code
Version3.16.3 - 3.20.0(已知受影响;修复将在下一版本发布)
PlatformsWindows

(No FAQ yet)

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.