fix: correlate id-less parallel tool-call fragments by stream index - #13278
Open
ege-arhan wants to merge 3 commits into
Open
fix: correlate id-less parallel tool-call fragments by stream index#13278ege-arhan wants to merge 3 commits into
ege-arhan wants to merge 3 commits into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
2 similar comments
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
I have read the CLA Document and I hereby sign the CLA |
ege-arhan
force-pushed
the
fix/issue-13223
branch
from
September 14, 2026 14:41
1ce1c26 to
da297d7
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
ege-arhan
force-pushed
the
fix/issue-13223
branch
from
September 14, 2026 14:43
da297d7 to
e20bdb3
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Problem
OpenAI streamed tool-call deltas carry a stable
index, whileidis optional on continuation fragments. Continue'sfromChatCompletionChunk()droppedtool_call.index, andapplyToolCallDelta()fell back to updating the most recently tracked tool call whenever a fragment had noid. With two parallel tool calls whose argument fragments interleave, one call's arguments were applied to the other call.Fixes #13223.
Solution
tool_call.indexthroughToolCallDelta(new optionalindex?: numberon the type + converter passthrough).applyToolCallDelta(), when a delta has noidbut has anindex, match the existing tool-call state by stream position instead of "last array element".Impact
Evidence
core/llm/openaiTypeConverters.test.tsassertingindexsurvivesfromChatCompletionChunk().npm installin this sandbox failed on /tmp disk quota (chromium-bidi tar write), so the repo vitest suite could not run here; test added for CI.Fixes #13223