mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: omit parallel_tool_calls when not explicitly enabled (COM-406) (#10671)
This commit is contained in:
parent
a12163d762
commit
2d4dba0286
2 changed files with 20 additions and 13 deletions
|
|
@ -71,10 +71,13 @@ describe("OpenAiHandler native tools", () => {
|
||||||
function: expect.objectContaining({ name: "test_tool" }),
|
function: expect.objectContaining({ name: "test_tool" }),
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
parallel_tool_calls: false,
|
|
||||||
}),
|
}),
|
||||||
expect.anything(),
|
expect.anything(),
|
||||||
)
|
)
|
||||||
|
// Verify parallel_tool_calls is NOT included when parallelToolCalls is not explicitly true
|
||||||
|
// This is required for LiteLLM/Bedrock compatibility (see COM-406)
|
||||||
|
const callArgs = mockCreate.mock.calls[0][0]
|
||||||
|
expect(callArgs).not.toHaveProperty("parallel_tool_calls")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,9 +162,10 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
||||||
...(reasoning && reasoning),
|
...(reasoning && reasoning),
|
||||||
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
||||||
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
||||||
...(metadata?.toolProtocol === "native" && {
|
...(metadata?.toolProtocol === "native" &&
|
||||||
parallel_tool_calls: metadata.parallelToolCalls ?? false,
|
metadata.parallelToolCalls === true && {
|
||||||
}),
|
parallel_tool_calls: true,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add max_tokens if needed
|
// Add max_tokens if needed
|
||||||
|
|
@ -231,9 +232,10 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
||||||
: [systemMessage, ...convertToOpenAiMessages(messages)],
|
: [systemMessage, ...convertToOpenAiMessages(messages)],
|
||||||
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
||||||
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
||||||
...(metadata?.toolProtocol === "native" && {
|
...(metadata?.toolProtocol === "native" &&
|
||||||
parallel_tool_calls: metadata.parallelToolCalls ?? false,
|
metadata.parallelToolCalls === true && {
|
||||||
}),
|
parallel_tool_calls: true,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add max_tokens if needed
|
// Add max_tokens if needed
|
||||||
|
|
@ -357,9 +359,10 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
||||||
temperature: undefined,
|
temperature: undefined,
|
||||||
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
||||||
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
||||||
...(metadata?.toolProtocol === "native" && {
|
...(metadata?.toolProtocol === "native" &&
|
||||||
parallel_tool_calls: metadata.parallelToolCalls ?? false,
|
metadata.parallelToolCalls === true && {
|
||||||
}),
|
parallel_tool_calls: true,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// O3 family models do not support the deprecated max_tokens parameter
|
// O3 family models do not support the deprecated max_tokens parameter
|
||||||
|
|
@ -392,9 +395,10 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
||||||
temperature: undefined,
|
temperature: undefined,
|
||||||
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
...(metadata?.tools && { tools: this.convertToolsForOpenAI(metadata.tools) }),
|
||||||
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
||||||
...(metadata?.toolProtocol === "native" && {
|
...(metadata?.toolProtocol === "native" &&
|
||||||
parallel_tool_calls: metadata.parallelToolCalls ?? false,
|
metadata.parallelToolCalls === true && {
|
||||||
}),
|
parallel_tool_calls: true,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// O3 family models do not support the deprecated max_tokens parameter
|
// O3 family models do not support the deprecated max_tokens parameter
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue