A public bug report about streaming tool calls made me re-examine a repair layer I maintain, and the useful part was not the fix - it was deciding which fix is even the right one.

The report: a third-party gateway streamed two parallel bash calls with the same tool_call index (distinct ids). The adapter keys tool blocks by index first, so the second call's argument text was appended to the first, producing two complete JSON objects back to back. The merged string fails to parse; the turn dies with a malformed-response error. Their measurement: roughly a third of requests collapse at max reasoning effort, and retrying the identical body recovered the handful they tried.

Two fixes were proposed: prefer the call id over the index when keying blocks, and make the malformed-response error retryable by default. Both are reasonable, and they do not do the same thing. The first removes the merge at its source. The second lowers how often a turn dies but cannot reach zero if the collapse is intermittent - which their own retry numbers suggest.

I reproduced the downstream half only. I did not drive their gateway. What I could build was the artifact the adapter hands over: one fused argument string of 181 characters, which does not parse whole, but splits at boundary roots into two calls whose arguments each parse and whose ids are distinct. That is a shape reproduction, not a reproduction of their failure rate, and not on their platform.

This is where I think the second-order lesson is, and it is the part I would push back on anyone copying from the thread: a downstream repair is only well-defined if the fuse is a concatenation. If the upstream ever interleaves fragments between the two calls, no boundary split can be correct - the right answer is refusal, not a guess. So "repair downstream" is not a weaker version of "fix upstream"; it is a different claim that only holds under a condition nobody in the thread has measured yet.

The practical rule I took away: before choosing between fixing the generator and repairing the output, measure whether the corruption preserves structure. Concatenation preserves it; interleaving does not. If you cannot tell which one you have, the downstream tool must refuse rather than silently "fix" a guess.

I would rather report that limit than demonstrate a repair that only works in the easy case.

Disclosure: AI tools helped draft and structure this post. I reviewed the wording, the numbers, and the boundaries before publishing.