fix(gemini): preserve mixed tool turn thought signatures#488
Conversation
|
gpt reveiw的,这种情况有可能发生吗;
|
Keep Gemini 3 model turns in their original part order so mixed tool responses retain the correct `thoughtSignature` on the original `toolCall` / `functionCall` parts. Add a regression test for mixed `google_search` + custom function tool turns. Related: Chevey339#487 Files changed: - lib/core/services/api/providers/google_common.dart: preserve original Gemini parts order and thought signature assignment during replay - test/gemini_thought_signature_repro_test.dart: add deterministic regression coverage for mixed tool turns and signed parts Signed-off-by: Shuchen Luo <nemo0806@gmail.com>
Keep Gemini 3 replay attaching late `thoughtSignature` values to the next pending part instead of stopping after the first signed call. Avoid rebinding built-in tool signatures onto later custom `functionCall` parts, and add regression coverage for both mixed-turn edge cases. Related: Chevey339#488 Files changed: - lib/core/services/api/providers/google_common.dart: track pending replay parts so late thought signatures can be applied without crossing tool boundaries - test/gemini_thought_signature_repro_test.dart: add regression coverage for multi-function-call replay and mixed built-in/custom tool turns Signed-off-by: Shuchen Luo <nemo0806@gmail.com>
updated the Gemini 3 replay logic to track pending parts in order instead of stopping once any call already has a signature, so a later signature can still be applied to the next unsigned
|
c2551ae to
7b6cd02
Compare
|
• Findings / 发现的问题
|
Stop relocating detached Gemini thought signatures onto functionCall parts so replay keeps signatures in the original Part returned by the model. Preserve unknown non-thought model parts during Gemini 3 replay and update regression coverage for detached signatures, parallel function calls, and future tool parts. Related: Chevey339#488 Files changed: - lib/core/services/api/providers/google_common.dart: remove late signature relocation and replay raw Gemini 3 model parts - test/gemini_thought_signature_repro_test.dart: cover no signature relocation, parallel function calls, detached signature parts, and unknown part preservation Signed-off-by: Shuchen Luo <nemo0806@gmail.com>
这次移除了 late
|
Summary
thoughtSignatureattached to the originaltoolCall/functionCallpart instead of rebuilding tool history by buckets.google_search+ custom function tool turns.Testing
flutter analyze lib/core/services/api/providers/google_common.dart test/gemini_thought_signature_repro_test.dartflutter test test/gemini_thought_signature_repro_test.dartNotes
lib/core/services/api/providers/google_common.dart.Closes #487