mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-27 07:26:48 +00:00
The upstream _parse_chat_history enforcement code uses a first_fc_seen flag that only adds DUMMY_THOUGHT_SIGNATURE to the first function_call without thought_signature. Parallel function calls (position 2+) remain unpatched, causing Gemini API 400 errors for all Gemini 2.5+ models. Additionally, _is_gemini_3_or_later only matches 'gemini-3', missing Gemini 2.5 models entirely. This patch: 1. Extends _is_gemini_3_or_later to also match gemini-2.5 models 2. Wraps _parse_chat_history to ensure ALL function_call parts in ALL model messages have thought_signature (not just the first one)