mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix: pass mergeToolResultText option to convertToR1Format when R1 mode is enabled
When both "Enable R1 model parameters" and "Strict tool message ordering" are enabled, the mergeToolResultText option was not being passed to convertToR1Format, causing the 400 error to still occur. This fix ensures the strictToolMessageOrdering setting is respected in both the streaming and non-streaming code paths when using R1 format.
This commit is contained in:
parent
4111aa6bcf
commit
809602f2b8
1 changed files with 6 additions and 2 deletions
|
|
@ -111,7 +111,9 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
|||
let convertedMessages
|
||||
|
||||
if (deepseekReasoner) {
|
||||
convertedMessages = convertToR1Format([{ role: "user", content: systemPrompt }, ...messages])
|
||||
convertedMessages = convertToR1Format([{ role: "user", content: systemPrompt }, ...messages], {
|
||||
mergeToolResultText: strictToolMessageOrdering,
|
||||
})
|
||||
} else {
|
||||
if (modelInfo.supportsPromptCache) {
|
||||
systemMessage = {
|
||||
|
|
@ -235,7 +237,9 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
|
|||
const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming = {
|
||||
model: modelId,
|
||||
messages: deepseekReasoner
|
||||
? convertToR1Format([{ role: "user", content: systemPrompt }, ...messages])
|
||||
? convertToR1Format([{ role: "user", content: systemPrompt }, ...messages], {
|
||||
mergeToolResultText: strictToolMessageOrdering,
|
||||
})
|
||||
: [
|
||||
systemMessage,
|
||||
...convertToOpenAiMessages(messages, { mergeToolResultText: strictToolMessageOrdering }),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue