From c29392c6f62799694f7db667cbdbb5fa85ce7a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Taccoen?= <75009579+LJ5O@users.noreply.github.com> Date: Wed, 4 Jun 2025 08:10:42 +0200 Subject: [PATCH] fix(stage-ui): proxy object could not be cloned (#193) * Fix for proxy could not be cloned error After several debugging, it was found that streamText initialisation called the structuredClone() function on messages. The problem is that messages is an object containing vue3 proxies, that can not be cloned. My proposed fix is to remove those proxies before passing messages to streamText * Revert "Fix for proxy could not be cloned error" This reverts commit 1575d305d5e5df3294991dbf7c8c25abfbfc783e. * Fix for proxy clone error rest.tool_results is also a proxy that was not removed properly --- packages/stage-ui/src/stores/chat.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stage-ui/src/stores/chat.ts b/packages/stage-ui/src/stores/chat.ts index 20d8ef73d..358ae6263 100644 --- a/packages/stage-ui/src/stores/chat.ts +++ b/packages/stage-ui/src/stores/chat.ts @@ -136,6 +136,7 @@ export const useChatStore = defineStore('chat', () => { const newMessages = messages.value.slice(0, messages.value.length - 1).map((msg) => { if (msg.role === 'assistant') { const { slices: _, ...rest } = msg // exclude slices + rest.tool_results = toRaw(rest.tool_results) return toRaw(rest) } return toRaw(msg)