mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 13:52:09 +03:00
When thinking is enabled on models like Kimi, assistant messages containing tool_calls must also include reasoning_content. The response sanitizer was incorrectly stripping reasoning_content whenever visible content existed, breaking subsequent requests with: thinking is enabled but reasoning_content is missing in assistant tool call message Now reasoning_content is preserved when tool_calls are present, while still being stripped for plain text responses to avoid client rendering issues. - Add condition !msgRecord.tool_calls before deleting reasoning_content - Update existing test to expect preserved reasoning_content with tool_calls - Add TDD tests covering both preservation and stripping behaviors - Add translator tests for reasoning_content + tool_calls handling Co-Authored-By: OpenClaude (dmassoneto) <openclaude@gitlawb.com>