Repository navigation
Conversation
…ge part The confirm footer only rendered for the last part of a message. When the assistant proposes multiple queries in one turn, only the first stays pending (others are auto-denied), but it isn't always the last part, so its Skip/Run Query buttons never appeared.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe AI assistant state now sanitizes SDK chat messages before storing them in valtio state. The sanitization helper is exported, and a Vitest regression test verifies approval-response updates remain compatible with ChangesAI assistant message sync
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🎭 Playwright Test Results (next)Details
Flaky testsFeatures › database.spec.ts › Database › Schema Visualizer › table actions work as expected Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
onFinish synced the AI SDK Chat instance's live message array directly into valtio state (chat.messages = messages). valtio's proxy() mutates an object's own nested properties in place rather than cloning them, so this corrupted the SDK's own array with Proxies. The next click on Skip/Run Query hit the SDK's internal structuredClone() call, which throws on a Proxy — an unhandled rejection before any state update or network request, making the buttons silently do nothing. Assign a sanitized copy instead so the live array is never touched.
…st message part" This reverts commit c7fd4bf.
…ns-do-nothing-in-ai-assistant
Braintrust eval report
|
This PR is partly driven by changes in #48102. Claude identified code smells of Valtio state which are not bugs at the moment, but we should address in case their usage changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved AI assistant message updates to prevent unexpected state changes. * Fixed table editing behavior to preserve shared data and prevent accidental in-place mutations. * Improved consent handling by preventing SDK internals from being altered by state management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…fomap-entry-for-pitr-archiving-stale' into hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale * origin/hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale: (35 commits) chore: simplify CPU messaging for compute sizes (#48109) chore(studio): add valtio and react-hook-form ESLint ratchet rules (#48037) feat: Add ai/python federated content and data (#48043) feat: Add ai-skills federated content and data (#48045) feat: Add deployment/ci federated content and data (#48041) fix(studio): wire up siwc-enabled query param opt-in on sign-in/sign-up (#48126) fix(studio): stop stacking overlaid area series in report charts (#48034) Update Dev toolbar to support filtering feature flags (#48137) Update dev toolbar to support mocking org restrictions (#48136) feat: Add terraform federated content and data (#48010) Chore/add sessions database connections (#48094) fix(studio): guard panel collapse/resize on narrow viewports (#48098) Landing page agent focus (#47989) fix(studio): chip away explicit-tabindex ratchet debt (#48040) fix(studio): untangle nested buttons in editor tabs (#48101) fix(docs): broken link (#48117) docs: add VS Code to the AI coding agent plugin install picker (#48108) docs: add Kimi Code to MCP and AI coding agent plugin setup (#48099) fix: preserve function responses (#47920) fix(assistant): SQL approval buttons do nothing (#48102) ...
Fixes FE-3954: clicking Skip/Run Query in the AI Assistant did nothing.
Root cause
onFinishsynced the AI SDKChatinstance's live message array directly into valtio state (chat.messages = messages). valtio'sproxy()mutates an object's nested properties in place instead of cloning them, so this corrupted the SDK's own array with Proxies. The next approval click hit the SDK's internalstructuredClone()call and threwDOMException: Proxy object could not be cloned— an unhandled rejection before any network request, so the buttons silently did nothing.Fix
Assign a sanitized copy of the message array instead of the SDK's live reference.
Test plan
pnpm --filter studio exec vitest run state/ai-assistant-state.test.ts— fails on old code with the exact DOMException, passes on the fixSummary by CodeRabbit
Bug Fixes
Tests