Skip to content

feat(studio): add AssistantQueryCell on the shared QueryEditor - #49169

Merged
SaxonF merged 2 commits into
feat/assistant-confirmfrom
feat/assistant-query-cell
Aug 20, 2026
Merged

SaxonF merged 2 commits into
feat/assistant-confirmfrom
feat/assistant-query-cell

Conversation

@SaxonF

@SaxonF SaxonF commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Feature.

What is the current behavior?

Notebooks and query tabs use QueryEditor. Assistant SQL still uses DisplayBlockRenderer / QueryBlock.

What is the new behavior?

Adds AssistantQueryCell, a local-state wrapper around the shared QueryEditor (variant="viewport", isRunDisabled while confirming). Nothing is wired into the conversation yet — that is #49170 — so this PR is the reusable cell plus the small editor/report-container hooks it needs.

Additional context

Part of stack #49171. Base: feat/assistant-confirm (#49168).

Test plan

  • AssistantQueryCell.utils.test.ts passes
  • Query editor still runs in Explorer notebooks / query tabs
  • No assistant conversation UI change in this PR (still DisplayBlockRenderer)

@SaxonF
SaxonF requested a review from a team as a code owner August 18, 2026 03:38
@vercel

vercel Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview Aug 20, 2026 12:55am
docs Ready Ready Preview, v0 Aug 20, 2026 12:55am
studio-self-hosted Ready Ready Preview Aug 20, 2026 12:55am
studio-staging Ready Ready Preview Aug 20, 2026 12:55am
ui-library Ready Ready Preview Aug 20, 2026 12:55am
zone-www-dot-com Ready Ready Preview, v0 Aug 20, 2026 12:55am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 20, 2026 12:55am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 14fad105-7256-4d0e-acca-4b8230415411

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  4 minutes, 27 seconds
commit  9754567

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@github-actions

github-actions Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  4 minutes, 33 seconds
commit  c49cde2

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@SaxonF
SaxonF force-pushed the feat/assistant-query-cell branch 5 times, most recently from 6f0c6f7 to a032bcf Compare August 18, 2026 06:16
joshenlim added a commit that referenced this pull request Aug 18, 2026
## 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?

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 v6 `needsApproval` flag on individual tools.

## What is the new behavior?

Upgrades Studio to AI SDK 7 (`ai` 7.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

- Stack: #49167 → #49168 → #49169 → #49170
- `needsApproval` on tools is left as-is in this PR so the upgrade can
land independently. A follow-up can move those gates to `streamText({
toolApproval })` and `experimental_toolApprovalSecret`.
- Independent of the notebook preview stack
([#49112](#49112),
[#49159](#49159)), which should
merge first before we wrap notebook proposals in Confirm.

## Test plan

- [ ] `pnpm --filter studio test` for `lib/ai/tools/*` and assistant
generate path
- [ ] Assistant chat still streams and tool-approval SQL / Edge Function
still pause for confirm
- [ ] Evals still run with mock tools (`needsApproval: false` overrides)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Improvements**
* Updated AI-powered chat, onboarding, SQL, code completion, and recipe
generation workflows for more reliable responses.
* Streaming responses now better preserve reasoning and source
information where available.
* Improved tool privacy notices while preserving dynamically generated
tool descriptions.
* Refined AI response handling, including step limits and structured
policy results.
* **Bug Fixes**
* Improved compatibility across AI-powered tool interactions and
execution scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@charislam
charislam force-pushed the feat/assistant-query-cell branch from a032bcf to eafd12a Compare August 19, 2026 13:55
xAxis?: string
yAxis?: string
}): QueryDisplay {
const hasChartAxes = Boolean(xAxis || yAxis)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be &&? Is it possible to produce a valid chart if either axis is missing?

SaxonF and others added 2 commits August 20, 2026 10:37
Keep notebook persistence and assistant tool state as separate wrappers around the same editor, including viewport mode and a run-disabled gate for confirmations.

Co-authored-by: Cursor <[email protected]>
@SaxonF
SaxonF force-pushed the feat/assistant-query-cell branch from eafd12a to c49cde2 Compare August 20, 2026 00:41
@SaxonF
SaxonF merged commit 6e64ad0 into master Aug 20, 2026
42 of 61 checks passed
@SaxonF
SaxonF deleted the feat/assistant-query-cell branch August 20, 2026 01:35
SaxonF added a commit that referenced this pull request Aug 20, 2026
<img width="1512" height="861" alt="image"
src="https://github.com/user-attachments/assets/404c9a27-dc10-497e-a5ec-003cd4b9705a"
/>


## 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.

## What is the current behavior?

Assistant `execute_sql` tool parts and markdown SQL fences render
through `DisplayBlockRenderer`. The confirm footer is gated to the last
part of the last message, so a pending SQL approval can disappear if the
assistant keeps writing.

## What is the new behavior?

SQL tool parts and markdown fences use `AssistantQueryCell` inside
`Confirm`. The footer follows the same manual-approval helpers as Edge
Functions. `DisplayBlockRenderer` is removed.

## Additional context

Top of stack #49171. Base: `feat/assistant-query-cell` (#49169).

Does not wrap notebook create/update proposals. That depends on
[#49159](#49159) merging first.

## Test plan

- [ ] `execute_sql` approval shows Run query / Skip on the Confirm card
under the editor
- [ ] Footer still shows if the assistant writes text after the SQL tool
part
- [ ] Markdown SQL fences render as AssistantQueryCell without a confirm
footer
- [ ] After skip, the query cell remains so the user can run it locally
- [ ] Edge Function confirm from #49168 still works

---------

Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants