mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-18 04:14:28 +00:00
Adjacent assistant messages where any message contains tool_calls were being merged by MergeAdjacentMessages, causing tool_calls to be silently dropped. This led to orphaned tool results that could not match any toolUse in history, resulting in Kiro API returning 'Improperly formed request.' Now assistant messages with tool_calls are kept separate during merge, preserving the tool call chain integrity.