mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
b710c6549e
Thinking models like kimi/Moonshot and DeepSeek reject any assistant message carrying tool_calls without a non-empty reasoning_content. When cross-turn history recovery misses (proxy restart drops the in-memory cache, ambiguous call_id, or a turn produced no reasoning upstream), the converted assistant message has none and the whole request fails with 'reasoning_content is missing in assistant tool call message'. Add a final-stage backfill that runs after all input items are processed, so genuine trailing reasoning items still attach first and a placeholder is only injected when none remains. Mirrors the placeholder behavior in transform::anthropic_to_openai_with_reasoning_content.