Repository navigation
chore(studio): upgrade AI SDK to v7 - #49167
Conversation
|
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 Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR upgrades the AI SDK to version 7, updates generation and streaming APIs, preserves callable tool descriptions, and adds the required tool execution context to mock and integration tests. ChangesAI SDK migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR updates AI SDK usage across Studio AI handlers and tests. No concrete correctness, availability, security, deployment, or readiness issue is identified at the current head, so it is merge-ready after normal checks. Sequence Diagram(s)sequenceDiagram
participant ChatTemplate
participant streamText
participant toUIMessageStream
participant createUIMessageStreamResponse
ChatTemplate->>streamText: Generate response with instructions
streamText->>toUIMessageStream: Convert result.stream with reasoning and sources
toUIMessageStream->>createUIMessageStreamResponse: Create UI message response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
🎭 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 |
There was a problem hiding this comment.
Just to check - is this nextjs endpoint still being used?
i don't see any internal reference to this, but are there are external references?
There was a problem hiding this comment.
we could probably remove , it was used as part of project creation experiments that we may want to bring back at some point but not worth extra surface area. Can create follow up PR
There was a problem hiding this comment.
yeah - if its not used lets remove it then, reduce the surface area of our API
can do separately 🙂
|
okay disabled the vercel toolbar for staging and re-tested - all good! |
Braintrust eval report
|
## Context Think the TS issue was introduced [here](#49167) but not sure why the TS action didn't catch this on that PR <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved AI assistant chat state handling for more consistent chat interactions and reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…#49168) <img width="1512" height="862" alt="image" src="https://github.com/user-attachments/assets/79a6d4dc-dcd2-489f-97d7-3ee7a0196b7d" /> ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Feature / UI refactor. ## What is the current behavior? Assistant Edge Function approval nests `ConfirmFooter` under the function block. `addToolApprovalResponse` is wired whenever state is `approval-requested`, including automatic approvals. ## What is the new behavior? Introduces a `Confirm` card that owns the frame, with the footer attached below the body. Edge Function approval uses that card. Interactive Approve/Deny only runs for manual `approval-requested` parts (`!approval.isAutomatic`), matching the [AI SDK tool-approvals `useChat` guidelines](https://ai-sdk.dev/docs/agents/tool-approvals). SQL still uses `DisplayBlockRenderer` until #49170. `ConfirmFooter` is inlined into `Confirm` so SQL can keep importing the named footer until that PR. ## Additional context Part of stack #49171. Base: `chore/ai-sdk-7` (#49167). Notebook proposal Confirm wrapping is **not** in this stack — that file lives on [#49159](#49159). Follow up after that stack merges. ## Test plan - [ ] Deploy-edge-function tool part shows Confirm with Skip / Deploy - [ ] Existing-function replace warning still requires the second confirm - [ ] After approve, footer morphs to loading and buttons disable - [ ] `Confirm.utils.test.ts` and `EdgeFunctionRenderer.test.tsx` pass <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added confirmation cards for AI-assisted actions, including approve and cancel controls. * Improved handling of manual approval requests for SQL execution, notebook changes, and Edge Function deployment. * Added support for customizing report and Edge Function block styling. * **Bug Fixes** * Automatic approvals no longer appear as pending manual confirmations. * Skipped SQL actions now provide clearer messaging. * **Tests** * Expanded coverage for approval states, confirmation controls, and automatic decisions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Chore / dependency upgrade.
What is the current behavior?
Studio is on AI SDK 6 (
ai^6.0.174,@ai-sdk/react^3). Tool approvals still use the v6needsApprovalflag on individual tools.What is the new behavior?
Upgrades Studio to AI SDK 7 (
ai7.0.59) and the matching@ai-sdk/*packages. Aligns call sites with v7 names (instructions,isStepCount,onEnd,ToolExecutionOptions).This is the bottom of stack #49171. Later layers add a shared Confirm card and AssistantQueryCell.
Additional context
needsApprovalon tools is left as-is in this PR so the upgrade can land independently. A follow-up can move those gates tostreamText({ toolApproval })andexperimental_toolApprovalSecret.Test plan
pnpm --filter studio testforlib/ai/tools/*and assistant generate pathneedsApproval: falseoverrides)Summary by CodeRabbit