Mixed LF/CRLF SSE delimiters prevent Claude Code tool calls
Quick fix
Fix SSE delimiter parsing to recognize mixed LF/CRLF blank-line delimiters and preserve Claude Code tool-call events.
Symptom
Section titled “Symptom”No `tool_use` block is produced.`take_sse_block` recognizes only `\n\n` and `\r\n\r\n`, not `\n\r\n`, where the data line ends with LF and the blank line with CRLF. A complete SSE event is therefore not split immediately; when later events arrive, multiple events may also be merged into one block.
On the path converting OpenAI Chat Completions SSE to Anthropic SSE, this prevents a complete tool call containing the tool name, ID, argument fragments, and `finish_reason: "tool_calls"` from producing a `tool_use` block.
Add `\n\r\n` and `\r\n\n` to the shared SSE delimiter list in `take_sse_block`, and continue selecting the earliest complete delimiter.
Add framing tests for all four LF/CRLF delimiter combinations and transport chunks, plus a Chat Completions-to-Anthropic tool-call regression test.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
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.