feat(lm): update rig-core v0.31.0, fix reasoning in tool loops, parallel tool calls#80
Merged
darinkishore merged 1 commit intomainfrom Feb 19, 2026
Merged
feat(lm): update rig-core v0.31.0, fix reasoning in tool loops, parallel tool calls#80darinkishore merged 1 commit intomainfrom
darinkishore merged 1 commit intomainfrom
Conversation
701d11a to
1d3d116
Compare
…pport parallel tool calls - Bump rig-core to v0.31.0, reqwest to 0.13 - Fix response.choice processing: scan all content blocks via classify_choice() instead of only checking .first(), which missed tool calls behind reasoning blocks - Preserve full assistant content (reasoning + tool calls) in chat history so Anthropic thinking signatures are echoed back correctly - Support parallel tool calling (multiple tool_use blocks in one response) - Extract find_and_execute_tool / execute_tool_batch helpers to deduplicate tool lookup - Add 8 unit tests for classify_choice covering all code paths
1d3d116 to
803382a
Compare
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.
Summary
response.choiceisOneOrMany<AssistantContent>— providers like Anthropic return[Reasoning, ToolCall]or[Reasoning, Text]. The old code only checked.first(), which caused tool calls behind reasoning blocks to be silently dropped and reasoning blocks to be stripped from chat history (breaking Anthropic's required thinking signature echo)tool_useblocks in a single response are now all executed and their results batched into a single User messagefind_and_execute_tool/execute_tool_batch/push_tool_resultshelpers to deduplicate the tool-lookup-by-name loop that was copy-pasted 2xclassify_choicecovering: text-only, single tool call, reasoning+tool call, reasoning+text, reasoning-only fallback, tool-call-wins-over-text, multiple parallel tool calls, image-only fallbackBugs fixed
[Reasoning, ToolCall]responses treated as terminal reasoning — tool call never executed, tool loop exits prematurelyOneOrMany::one(ToolCall), dropping reasoning blocks — subsequent Anthropic API calls would fail due to missing thinking signatures.first()bug in the initialcall()dispatchTest plan
cargo clippyclean (0 warnings)cargo testall 30 unit tests + 10 doc-tests passclassify_choiceunit tests covering all code paths