snow-ai 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -361,6 +361,19 @@ export async function handleConversationWithTools(options) {
|
|
|
361
361
|
if (confirmation === 'reject') {
|
|
362
362
|
// Remove pending tool messages
|
|
363
363
|
setMessages(prev => prev.filter(msg => !msg.toolPending));
|
|
364
|
+
// User rejected - need to save tool rejection messages to maintain conversation structure
|
|
365
|
+
// Add tool rejection responses for ALL tools that were rejected
|
|
366
|
+
for (const toolCall of toolsNeedingConfirmation) {
|
|
367
|
+
const rejectionMessage = {
|
|
368
|
+
role: 'tool',
|
|
369
|
+
tool_call_id: toolCall.id,
|
|
370
|
+
content: 'Error: Tool execution rejected by user',
|
|
371
|
+
};
|
|
372
|
+
conversationMessages.push(rejectionMessage);
|
|
373
|
+
saveMessage(rejectionMessage).catch(error => {
|
|
374
|
+
console.error('Failed to save tool rejection message:', error);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
364
377
|
// User rejected - end conversation
|
|
365
378
|
setMessages(prev => [
|
|
366
379
|
...prev,
|