mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
* fix(proxy): preserve mid-conversation system messages for prefix cache Remove normalize_openai_system_messages which merged all system messages to the head, breaking radix prefix cache on every turn when Claude Code injects <total_tokens> metadata as a mid-conversation system message. Now system messages from the top-level field are placed first, and all messages (including mid-conversation system) are extended in their original order without any merging or reordering. Also add custom-protocol feature for standalone release builds. * fix(proxy): restore top-level system merge, add regression test Restore merging of top-level system array blocks into a single system message (cross-turn stable, does not affect prefix cache). Mid-conversation system messages from the messages array remain in place without merging or reordering. Add regression test to lock the new behavior: mid-conversation system messages stay at their original position.