[v6.0] fix(openai-compatible): buffer tool call deltas until function.name arrives#16836
Merged
Conversation
…rrives Manual backport of #14760 to release-v6.0: some OpenAI-compatible providers send the first tool-call delta without function.name, which previously threw InvalidResponseDataError. Indexed deltas are now buffered until the delta carrying the name arrives; deltas that never receive a name still fail with the original error during flush. v6 has no StreamingToolCallTracker, so the buffering is implemented inline in front of the existing delta handling. (cherry picked from commit ab81968ddcf7ab6df3dc142000668234d549e848)
Contributor
|
|
Contributor
|
🚀 Published in:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of #14760 to
release-v6.0, ported on top of the #16800 security backport since both rewrite the same delta-handling region. v6 has noStreamingToolCallTracker, so the buffering is implemented inline: indexed tool-call deltas are buffered until the delta carryingfunction.namearrives; deltas that never receive a name still fail with the originalInvalidResponseDataErrorduring flush. Original regression tests apply cleanly. openai-compatible suite passes locally (210/210) plus all dependent provider packages (cerebras, deepseek, groq, alibaba, fireworks, deepinfra, togetherai, baseten, huggingface, moonshotai, vercel).Part of the v6.0 backport tracking issue #16767.