-
Notifications
You must be signed in to change notification settings - Fork 1.5k
allow use five tools in one call #3840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
// Ignore any content after a tool has already been used. | ||
cline.userMessageContent.push({ | ||
type: "text", | ||
text: `Tool [${block.name}] was not executed because a tool has already been used in this message. Only one tool may be used per message. You must assess the first tool's result before proceeding to use the next tool.`, | ||
text: `Tool [${block.name}] was not executed because too many tools has already been used in this message. Only five tool may be used per message. You must assess the first tool's result before proceeding to use the next tool.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: The phrase too many tools has already been used
should be too many tools have already been used
, and Only five tool may be used
should be Only five tools may be used
.
@@ -3,6 +3,7 @@ import { ToolArgs } from "./types" | |||
export function getNewTaskDescription(_args: ToolArgs): string { | |||
return `## new_task | |||
Description: This will let you create a new task instance in the chosen mode using your provided message. | |||
IMPORTANT: This tool could only called once per message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: In the sentence IMPORTANT: This tool could only called once per message.
, please change it to IMPORTANT: This tool can only be called once per message.
IMPORTANT: This tool could only called once per message. | |
IMPORTANT: This tool can only be called once per message. |
assistantMessage += | ||
"\n\n[Response interrupted by a tool use result. Only one tool may be used at a time and should be placed at the end of the message.]" | ||
"\n\n[Response interrupted by a tool use result. Only five tool may be used at a time and should be placed at the end of the message.]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: In the message string, consider changing "Only five tool may be used"
to "Only five tools may be used"
for grammatical correctness.
"\n\n[Response interrupted by a tool use result. Only five tool may be used at a time and should be placed at the end of the message.]" | |
"\n\n[Response interrupted by a tool use result. Only five tools may be used at a time and should be placed at the end of the message.]" |
Hey, i also have a version for multi-tool-calling, though yours is much cleaner. I also see you limited attempt_completion to be called alone, very nice. Some things to consider maybe:
You can check out my glued-together PoC version here: https://github.com/Ruakij/Roo-Code/tree/feat/multiple-tool-calls |
why limit to 5? why not make it adjustable? |
The current implementation has the potential to introduce bugs when tools are executed in complex sequences (e.g., read → write → read → write → search → write) or when specialized tools like attempt_completion are used. This essentially creates race conditions where the timing and order of tool execution can lead to unpredictable behavior. To mitigate these issues, tools should be categorized into functional groups that support parallel execution, enabling multiple tools to operate simultaneously without conflicts. |
Related GitHub Issue
Closes: #3839
Description
didAlreadyUseTool
to an integer type, and updated the corresponding logic for setting and checking it.new_task
andattempt_completion_task
.Based on my testing, the LLM generally does not overuse tool calls, and it performs well in scenarios where multiple tool calls are genuinely needed.
Test Procedure
Type of Change
src
or test files.Pre-Submission Checklist
npm run lint
).console.log
) has been removed.npm test
).main
branch.npm run changeset
if this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Allows up to five tool uses per message, updates tool usage logic, and modifies related prompts and functions.
didAlreadyUseTool
changed to integer inTask
class to track tool usage count.presentAssistantMessage()
.attempt_completion
tool from being used with others inpresentAssistantMessage()
.getSharedToolUseSection()
to reflect new tool usage limit.getNewTaskDescription()
thatnew_task
can only be called once per message.newTaskTool()
, incrementsdidAlreadyUseTool
by 5 to prevent further tool use after creating a new task.This description was created by
for 55e6c13. You can customize this summary. It will automatically update as commits are pushed.