mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-13 18:52:18 +03:00
The direct Claude<->Gemini translator (claude-to-gemini.ts / gemini-to-claude.ts) never persisted the thoughtSignature Gemini returns on functionCall parts, and never re-attached one on the next turn. Gemini 3+/2.5 strictly reject a native functionCall part with no signature (400), which surfaces whenever a combo falls back onto a Gemini model mid-conversation (the fallback tool_use never went through Gemini, so no signature exists for it). - gemini-to-claude.ts: store the signature (keyed by tool_use id + connection namespace) when Gemini's response carries one, mirroring the existing gemini-to-openai.ts hub-path behavior. - claude-to-gemini.ts: resolve a stored signature for historical tool_use blocks; when none exists and the target model requires one, downgrade the tool_use/tool_result pair to inert text instead of sending a signature-less native part, matching the "context" fallback already used by the OpenAI hub path (#3358) rather than the removed fake-signature injection. Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>