Repository navigation
A streamed tool call without an index starts a new call when it brings an id - #1190
Merged
WaylandYang merged 2 commits intoOct 11, 2026
Merged
Conversation
…s an id Gemini's OpenAI-compatible endpoint streams parallel tool calls one per chunk, none numbered: no index, an id each, the arguments whole. Keyed by a missing index read as 0, two calls merged into one, and the model was refused for calling `find_entitiessearch_chunks`. A delta that names an index goes there. One that does not and carries an id is a new call; one with neither continues the last, which is the only shape an unnumbered continuation has. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
gedaiu
force-pushed
the
fix/parallel-tool-calls-without-index
branch
from
October 10, 2026 20:27
b10ac07 to
cb4a493
Compare
WaylandYang
approved these changes
Oct 11, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you for following the Gemini path to the end. The cause is clear from the two frames you quote, and the rule reads correctly: a numbered delta goes where it says, an unnumbered one with an id starts a call, an unnumbered one without continues the last. Checked here: 53 utopia-llm tests pass, and parallel_tool_calls_without_an_index_stay_separate fails without the change. One note, not blocking: the continuation test passes without the change too, since with a single call both rules pick slot 0; a second call ahead of the fragment would make it bite. Merging now. Thanks again.
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.
What happened
With #1183 in place, a question against Gemini (
gemini-3.8-flash, OpenAI-compatible endpoint) still failed on its first turn. The log line from #1189 says why:Gemini had made two parallel calls. Its stream sends them one per chunk, with no
indexon either and anidon each:The streaming parser keyed each delta by
index, reading a missing one as 0, so both calls merged into slot 0 and the names concatenated.What changed
tool_call_slotdecides where a delta goes: a numbered one where it says; an unnumbered one with anidstarts a new call; an unnumbered one without anidcontinues the last call, which is the only shape an unnumbered continuation can have (OpenAI's continuation deltas carry argument fragments and no id). Numbered streams behave exactly as before.Tests: the Gemini two-chunk shape yields two calls with their own ids, names and arguments; an unnumbered, id-less fragment appends to the previous call.
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test -p utopia-llmpass (49).Related: #1135, #1183, #1189.