mcp tool interrupt fix

This commit is contained in:
Andrew Pareles 2025-06-09 17:30:03 -07:00
parent 97cb63c7fc
commit 40a27cd1ee

View file

@ -366,7 +366,7 @@ const _sendOpenAICompatibleChat = async ({ messages, onText, onFinalMessage, onE
onText({
fullText: fullTextSoFar,
fullReasoning: fullReasoningSoFar,
toolCall: { name: toolName, rawParams: {}, isDone: false, doneParams: [], id: toolId },
toolCall: !toolName ? undefined : { name: toolName, rawParams: {}, isDone: false, doneParams: [], id: toolId },
})
}
@ -513,7 +513,7 @@ const sendAnthropicChat = async ({ messages, providerName, onText, onFinalMessag
onText({
fullText,
fullReasoning,
toolCall: { name: fullToolName, rawParams: {}, isDone: false, doneParams: [], id: 'dummy' },
toolCall: !fullToolName ? undefined : { name: fullToolName, rawParams: {}, isDone: false, doneParams: [], id: 'dummy' },
})
}
// there are no events for tool_use, it comes in at the end
@ -811,7 +811,7 @@ const sendGeminiChat = async ({
onText({
fullText: fullTextSoFar,
fullReasoning: fullReasoningSoFar,
toolCall: { name: toolName, rawParams: {}, isDone: false, doneParams: [], id: toolId },
toolCall: !toolName ? undefined : { name: toolName, rawParams: {}, isDone: false, doneParams: [], id: toolId },
})
}