WIP: Parallel tool calls! Based on Roo Code PRs #9621 and #9273 #4088
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.
Context
Implements parallel tool calling (received in single request from service), executed sequentially, based on Roo Code PRs #9621 and #9273.
Implementation
Native protocol (OpenAI-style) can now execute multiple tools in a single assistant message
Removed didAlreadyUseTool restriction for native protocol
XML protocol maintains single-tool-per-message behavior for backward compatibility
Protocol detection based on presence of tool call ID (native calls have IDs, XML calls don't)
Added didToolFailInCurrentTurn flag to prevent attempt_completion after tool failures
Flag resets at start of each new API request cycle, scoping failures to single assistant messages
Updated all 19 tools to set the flag when encountering errors
Prevents scenarios like: read_file: failure! → attempt_completion: blocked!
Allows user override in subsequent turns: read_file: failure! → user message → attempt_completion: allowed!
Updated tool-use.ts to clarify native protocol supports multiple tools per message
Removed "ALWAYS wait for confirmation" guideline that only applies to XML protocol
Adjusted tool-use-guidelines.ts to be protocol-aware
Implemented duplicate tool_result prevention for native protocol
Each tool call ID only gets one tool_result block
Maintains separate handling for XML vs native protocols
Screenshots
How to Test
Enable the Parallel tool calling experiment in Experimental Settings.
Make a request for 2 independent actions:
`>Read the README.md file in this directory, and update the To Do list to add "Check for coolness". These are independent actions and should be requested in the SAME response.
Get in Touch
mcowger