claude-code-best/packages
ymonster 1b10ea391a fix: preserve empty reasoning_content for DeepSeek v4 thinking mode (#399)
DeepSeek v4 in thinking mode sometimes returns reasoning_content: ""
when the model answers directly without internal reasoning. Two places
were filtering the empty string out, which dropped the thinking block
from the assistant turn entirely. The next request then omitted
reasoning_content for that prior turn, and DeepSeek rejected with
400 "reasoning_content ... must be passed back to the API".

Fix:
- openaiStreamAdapter: open a thinking block whenever reasoning_content
  is present (including ""); skip the empty thinking_delta event since
  the empty value is already conveyed by the block's initial state.
- openaiConvertMessages: preserve empty thinking blocks as
  reasoning_content: "" when serializing assistant messages back to
  the OpenAI/DeepSeek format.

Tests:
- New: empty reasoning_content opens a thinking block (adapter).
- Updated: empty thinking blocks now round-trip as reasoning_content: ""
  instead of being dropped.
- New: assistant messages with no thinking block still omit
  reasoning_content (regression guard for non-thinking models).
2026-05-02 14:58:29 +08:00
..
@ant fix: preserve empty reasoning_content for DeepSeek v4 thinking mode (#399) 2026-05-02 14:58:29 +08:00
acp-link style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
agent-tools style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
audio-capture-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
builtin-tools style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
color-diff-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
image-processor-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
mcp-client fix: 优化内存峰值与 CPU 性能,降低 100-300MB 内存占用 2026-05-02 00:45:03 +08:00
modifiers-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
remote-control-server style: 添加 biome-ignore 消除 noUnusedPrivateClassMembers 警告 2026-05-01 22:01:54 +08:00
url-handler-napi style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
weixin style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
tsconfig.json feat: 重构供应商层次 (#286) 2026-04-17 09:33:14 +08:00