When a Chat Completions stream sends a call's id first and then id: null or
id: "" in a later delta for the same index, the buffered call kept the later
value, so the client got null/"" ids and a later request failed with
"Duplicate value for 'tool_call_id'" (#188). A later null or empty id now
keeps the id already buffered; an id that first arrives in a later delta is
still taken.
Run at the reviewed head 8f19ba1e6bf09f105a47e4fb2f7233de22a99b06 (base 5b68df0, main):
- packages/zen-free: bun test (bun 1.4.2, temp HOME): 195 pass, 0 fail.
- bun scripts/check.mjs: passes.
- #188's literal repro script (node 22.22.0): prints call_0/call_1 for both
null and "" and exits 0; on main's tool-response.mjs it prints [null,null]
and ["",""] and fails its assert.
- The PR's new test with main's tool-response.mjs: red (null, '' instead of
call_0, call_1); green with the fix.