mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
HTTP 400 "invalid argument" was triggered when OmniRoute translated OpenAI tool_calls to Gemini format, because thoughtSignature was injected onto every functionCall part unconditionally. thoughtSignature is only valid on thinking/reasoning parts (those with thought: true). The Gemini API rejects any request where a functionCall part carries a thoughtSignature field, returning HTTP 400. Fix: remove the thoughtSignature field from functionCall parts. The thinking parts that legitimately require thoughtSignature (emitted when a message has reasoning_content) are unchanged. Adds regression test (T43) with three cases: - single tool call: no thoughtSignature on functionCall part - multiple tool calls: none carry thoughtSignature - thinking part regression guard: thoughtSignature still present on thought parts Fixes #725