Repository navigation
fix(vue): keep attachment sources structuredClone-safe - #5933
Conversation
fc2b2d6 to
4f29932
Compare
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Tests actually call the real |
|
Adversarial review — verdict: MERGE-WORTHY I reviewed this against current Mechanism confirmed empirically. Running both paths against the workspace
So the What I checked:
|
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
What does this PR do?
Fixes a Vue
DataCloneErrorthat occurred when uploaded attachment sources crossed thestructuredCloneboundary in core. Vue’s deepref()conversion wrapped nested attachment sources in reactive proxies;useAttachmentsnow keeps the attachment container shallow withshallowRef(), preserving externally supplied sources as raw cloneable values before they reach AG-UI/core payloads.The change is intentionally Vue-only: core and React are untouched because the defect is caused by Vue’s reactivity behavior at the framework boundary. Focused regressions cover both the attachment hook and
CopilotChatsubmission path, including non-reactivity and successfulstructuredClonebehavior.Related PRs and Issues
Verification
pnpm nx run @copilotkit/vue:check-types— passed.pnpm nx run @copilotkit/vue:test -- src/v2/hooks/__tests__/use-attachments.test.ts src/v2/components/chat/__tests__/CopilotChat.attachments.test.ts— passed, 18 tests in 2 files.pnpm nx run @copilotkit/vue:build— passed.test-and-check-packages) — passed: 1073 tests, publint, and attw.pnpm nx run @copilotkit/vue:lint— remains blocked by 171 pre-existing errors across unrelated Vue files; no lint errors were introduced in the changed files.git diff --check upstream/main...HEAD— passed.Scope and exclusions
packages/vue/src/v2/hooks/use-attachments.ts, its focused hook andCopilotChattests, and the relatedpackages/vue/PARITY.mdandpackages/vue/AGENTS.mdguidance.PARITY.mdchange removes accidental table-format churn and retains only the meaningful attachment parity note.Checklist