fix(openai): tolerate empty/null fields in streaming tool-call deltas (#9828)
Some OpenAI-compatible providers emit empty or null name/arguments/id fields in streaming continuation deltas to keep the response schema stable. pgAdmin's accumulator overwrote the real tool name (captured in the first delta) with the later null, producing a tool call named "null" that could not be dispatched. Skip falsy name/arguments/id when accumulating (matching the OpenAI Python SDK, which ignores nulls the same way) so the values captured in the first delta survive. Also guard against a null `function` object in a delta, which previously raised TypeError. Without the id guard a null id in a continuation delta clobbered the real id, which the final build then replaced with a random uuid rather than the provider's id. Adds a unit test covering the null-continuation, multi-chunk-arguments, and null-function cases, and a 9.16 release note.
A
Adam Tao committed
0223e8a026425c6f4d24a582827427a85aa5ffd2
Parent: 89e84eb
Committed by Dave Page <dpage@pgadmin.org>
on 6/9/2026, 2:08:19 PM