Repository navigation
fix(floxi): keep streamed tool call fragments separated by index - #1519
Open
pcbeingused33 wants to merge 2 commits into
Open
pcbeingused33 wants to merge 2 commits into
pcbeingused33 wants to merge 2 commits into
Conversation
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
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.
When a FloxiAI backend streams parallel tool calls, the arguments of a second call can be appended to the first one.
CollectToolCallDeltareadstool_calls[0]of every chunk and never looks atindex, so a fragment for index 1 lands in the same buffer as index 0. With deltas for indexes0, 1, 0, the resulting function arguments are no longer valid JSON.The provider still follows a single call, as before. It now remembers the
indexof the first call it sees and only collects fragments carrying that index, including when one chunk holds several entries. An entry withoutindexfalls back to its position in the array, so when a backend omits it only the first entry of each chunk is collected, as before.The tests feed synthetic stream chunks to the aggregator (they were not run against a live FloxiAI backend). The two interleaving tests fail on master and pass with this change; the third covers a chunk without
indexand passes on both.BotSharp.LLM.Testsgains a project reference to the FloxiAI plugin for this.dotnet test tests/BotSharp.LLM.Tests/BotSharp.LLM.Tests.csproj --filter FullyQualifiedName~FloxiStreamToolCallTestsThis change was prepared with assistance from an AI coding tool (Claude Code).