Bug in Sentry JS SDK logs each Google GenAI streaming tool call twice with mismatched data
A bug in Sentry's JavaScript SDK causes tool calls made during Google GenAI streaming sessions to be recorded twice in the span attribute gen_ai.response.tool_calls. The duplicate entries stem from two separate code paths in the streaming instrumentation file both reading the same underlying data — once via the SDK's chunk.functionCalls accessor and once by iterating candidate content parts directly. The two duplicate entries also disagree on key naming, using 'args' in one and 'arguments' in the other, which can mislead any downstream system counting tool invocations. The non-streaming path in the same SDK does not have this issue, as it reads tool calls only once from the SDK accessor. The proposed fix removes the redundant second push and standardises the streaming path to use the same single-source accessor already trusted by the non-streaming code.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in