mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: add explicit native toolProtocol check for parallel subtask queuing
This commit is contained in:
parent
7ada0df3af
commit
56f7be6c7f
2 changed files with 7 additions and 4 deletions
|
|
@ -147,13 +147,16 @@ export class NewTaskTool extends BaseTool<"new_task"> {
|
|||
task.checkpointSave(true)
|
||||
}
|
||||
|
||||
// Queue this new_task if there are:
|
||||
// Queue this new_task if using native tool protocol AND there are:
|
||||
// 1. Multiple new_task blocks (to execute sequentially), OR
|
||||
// 2. Any remaining tool blocks after this one (so they can execute before delegation)
|
||||
// NOTE: XML protocol processes tools one at a time, so this condition is always false for XML.
|
||||
// We add an explicit check for clarity and defensive safety.
|
||||
const isNativeToolProtocol = toolProtocol === "native"
|
||||
const newTaskBlockCount = countNewTaskBlocks(task)
|
||||
const hasRemainingTools = hasRemainingToolBlocks(task)
|
||||
|
||||
if (newTaskBlockCount > 1 || hasRemainingTools) {
|
||||
if (isNativeToolProtocol && (newTaskBlockCount > 1 || hasRemainingTools)) {
|
||||
task.pendingSubtasks.push({
|
||||
toolCallId: toolCallId ?? "",
|
||||
message: unescapedMessage,
|
||||
|
|
|
|||
|
|
@ -775,7 +775,7 @@ describe("newTaskTool parallel execution", () => {
|
|||
handleError: vi.fn(),
|
||||
pushToolResult: mockPushToolResult,
|
||||
removeClosingTag: vi.fn((_: string, v?: string) => v ?? ""),
|
||||
toolProtocol: "xml",
|
||||
toolProtocol: "native", // Native protocol is required for parallel tool execution
|
||||
toolCallId: "tool-1",
|
||||
})
|
||||
|
||||
|
|
@ -802,7 +802,7 @@ describe("newTaskTool parallel execution", () => {
|
|||
handleError: vi.fn(),
|
||||
pushToolResult: mockPushToolResult,
|
||||
removeClosingTag: vi.fn((_: string, v?: string) => v ?? ""),
|
||||
toolProtocol: "xml",
|
||||
toolProtocol: "native", // Native protocol is required for parallel tool execution
|
||||
toolCallId: "tool-2",
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue