Conversation
The Anthropic Messages bridge attached every streamed tool-call argument fragment to state.current_block_index, so a provider that announces all parallel tool calls before streaming their arguments filed each fragment under whichever tool_use block opened last. One call ended up with the other's arguments concatenated onto its input and the rest received none. Track the content block opened for each OpenAI tool_calls[].index and route fragments through that map. Because parallel calls can interleave, tool_use blocks now stay open for the whole tool section and are stopped together when the section ends, instead of being closed as soon as the next call starts (which would put deltas after their block's content_block_stop). Reusing the map also stops providers that resend the id on every fragment from opening a duplicate block per fragment. Co-authored-by: Tony Coder <407243179@qq.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan includes up to 8 reviews per rolling hour; 2 remain after this review. WalkthroughChangesParallel tool-call streaming
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9 tasks
tonycoder-hub
temporarily deployed
to
integration-tests
August 18, 2026 09:46 — with
GitHub Actions
Inactive
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 34 files with indirect coverage changes 🚀 New features to boost your workflow:
|
tbille
approved these changes
Aug 18, 2026
JamMaster1999
added a commit
to JamMaster1999/any-llm
that referenced
this pull request
Aug 18, 2026
Brings in upstream's merges of our mozilla-ai#1291/mozilla-ai#1292/mozilla-ai#1310 plus mozilla-ai#1297, mozilla-ai#1299, mozilla-ai#1301, mozilla-ai#1302, mozilla-ai#1303, mozilla-ai#1305. Carried-until-merged fork work stays: mozilla-ai#1294 (gemini reasoning_effort=none), mozilla-ai#1308 (aresponses timeout), mozilla-ai#1309 (gemini native tool dicts), and the mozilla-ai#1300 carry. One conflict in tests/unit/test_responses.py: kept our mozilla-ai#1308 timeout test next to upstream's flatten test. Unit suite: 2234 passed. Claude-Session: https://claude.ai/code/session_018D3FGNvb1hRZQmsXFoA44J
This branch was previously deployed
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.
Description
chat_completion_chunk_to_message_stream_events attached every streamed tool-call argument fragment to state.current_block_index instead of the block for that tool_calls[].index. Parallel interleaved calls mixed arguments (one tool got unparseable JSON, the other got none).
StreamingState now maps each tool_calls index to its content block. tool_use blocks stay open through the tool section and stop together. Repeated ids reuse the same block.
Tests: uv run pytest tests/unit — 2160 passed, 69 skipped. Distinct from #1296-#1304.
PR Type
Relevant issues
No open issue.
Checklist
AI Usage Information