Repository navigation
fix: keep parallel Gemini tool calls when replaying thought signatures - #4167
L00PLeGeNd wants to merge 1 commit into
Conversation
Google GenAI attaches a thought signature to only the first function call in a parallel batch. Replaying signed parts alone dropped the remaining calls (and unsigned text), so the following tool-response turn mismatched. Also accumulate streaming signature deltas across chunks instead of keeping only the last chunk's set. Fixes deepset-ai#4120
|
Heads-up for maintainers This PR is from a fork and touches integrations whose integration tests require API keys. Affected integrations:
Please run the integration tests locally ( |
Coverage report (google_genai)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
|
Hi @L00PLeGeNd, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @L00PLeGeNd! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
Possible Risk/Impact
Without this fix, Gemini agent loops that use thinking + parallel tool calls fail on the second request: the replayed model turn omits unsigned sibling function calls (and unsigned text), so function-call / function-response counts diverge.
How to handle those risks to be safer?
Unit tests cover:
thought_signature_deltasacross streaming chunks instead of keeping only the last chunkHow to test it?
cd integrations/google_genai && hatch run test:unit -- tests/test_chat_generator_utils.py(45 passed locally).Notes for the reviewer / relevant issues for details when applicable
Fixes #4120
Related streaming parallel-tool work: #4141 / #4121 (separate bug).