<thinking> 标签作为正文输出 Claude Code
Quick fix
将 provider 的 apiFormat 从 openai_chat 改为 anthropic(若上游支持),可绕过内联
Symptom
Section titled “Symptom”<thinking>tool call</thinking>
日志很大。我先看当前配置和最近的日志内容。在 Claude Code 使用 `apiFormat: "openai_chat"` 时,Anthropic 流式转换路径会把 `choice.delta.content` 直接作为 `text` 块输出,未剥离流首内联的 `<thinking>...</thinking>` 标签。因此思考内容会和正文一起以明文显示。
该问题发生在 `<thinking>` 变体:已有处理分别只识别 `<think>`,或仅覆盖 Codex 路径,均未覆盖 Claude 的此转换路径。问题报告确认,若上游支持原生 Anthropic 接口,改用 `anthropic` 格式即可避开该转换路径。
确认上游 provider 支持原生 Anthropic 接口。
将该 provider 的 `apiFormat` 从 `openai_chat` 改为 `anthropic`,使请求走 passthrough 路径并避开该流式转换。
Affected Versions
Section titled “Affected Versions”ToolClaude Code
Version3.20.4(受影响版本)
PlatformsWindows
Source Issues
Section titled “Source Issues”本页汇总自 1 个真实 issue
(暂无 FAQ)
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。