fix: Ensure all tool calls are complete before submitting responses (#689)

This commit is contained in:
N. Taylor Mullen 2025-06-02 01:50:28 -07:00 committed by GitHub
parent 27ba28ef76
commit 34b81abd9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 312 additions and 7 deletions

View file

@ -530,7 +530,10 @@ export const useGeminiStream = (
},
);
if (completedAndReadyToSubmitTools.length > 0) {
if (
completedAndReadyToSubmitTools.length > 0 &&
completedAndReadyToSubmitTools.length === toolCalls.length
) {
const responsesToSend: PartListUnion[] =
completedAndReadyToSubmitTools.map(
(toolCall) => toolCall.response.responseParts,