mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-10 01:51:30 +08:00
- Responses API: only hoist developer/system messages before conversation starts to systemInstruction, keeping token 0 cache prefix immutable. Demote mid-session developer messages to user role and merge consecutive user turns via MergeAdjacentGeminiUserContents without crossing functionResponse boundaries. - Tool Call Buffer: buffer mid-session developer messages during pending function calls and emit after functionResponse, preserving valid tool pairing and reason replay. - Chat Completions API: apply the same leading/mid-session distinction for system/developer messages and guard against empty parts. - Claude Messages API: align role: "developer" in messages with role: "system", demoting to <system-reminder> user turns and avoiding upstream 400s. - Validation: update ValidateGeminiFunctionCallPairing to allow intervening user turns before functionResponse, matching upstream Antigravity tolerance. - Role Normalization: ensure functionResponse turns in Antigravity are always normalized to role: "user".