Repository navigation
feat(mcp-server-supabase): let the SQL classifier decide run_notebook prompts - #584
Open
barryroodt wants to merge 2 commits into
Open
barryroodt wants to merge 2 commits into
barryroodt wants to merge 2 commits into
Conversation
This was referenced Nov 20, 2026
Open
barryroodt
marked this pull request as ready for review
November 20, 2026 15:24
…un_notebook Tests for run_notebook asking the configured classifier which cells need confirmation. They fail on this commit by design: the tool does not read the option yet. - One row per outcome class (clears, flags, cannot answer) on each path that classifies, and the paths that must not call the classifier. - When the classifier cannot answer, the error the host's onToolCall gets is a SqlClassifierCallError with no cause and none of the classifier's text. - The loop classifies only selected primary-database cells, in notebook order, and stops at the first flagged cell. - An aborted classification runs no cell and asks about no later cell. - The prompt: the count, the 'at least 1 destructive' clause and the permanent-removal line follow the classifier's flag. - The run mode follows the built-in regex, whatever the classifier says. Two existing prompt assertions move from a destructive count to the approved 'at least 1 destructive' clause.
… prompts run_notebook now asks the server's classify step whether a run needs confirmation, instead of the built-in regex. It checks the database cells in notebook order and stops at the first flagged cell, so the prompt says "at least 1 destructive" in place of a count. A classifier that cannot answer fails the call before any cell runs. The built-in regex still picks the mode each cell runs in, so the mode is the same on every host and an accepted resend needs no classifier call. The classifier doc comments now say which prompt wording belongs to execute_sql and apply_migration, and that run_notebook shows one prompt for the whole notebook.
barryroodt
force-pushed
the
feat/run-notebook-classify-step
branch
from
November 23, 2026 08:44
0de08fc to
d101ca5
Compare
barryroodt
force-pushed
the
feat/sql-classify-step
branch
from
November 23, 2026 08:44
27619f2 to
0162527
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth PR in the stack replacing #454. Base: #583 (4/5).
Why this changes
#583 lets hosts choose the SQL classifier that
execute_sqlandapply_migrationuse for confirmation. This PR makesrun_notebookuse that classifier too. It changes when the notebook asks for approval. A separate check still decides how each cell runs.run_notebookmakes itThe default confirmation classifier uses the same regex as the run-mode check. Setting a custom classifier replaces the regex only for confirmation. For example, if the custom classifier flags a plain read that the regex clears, the user sees a prompt and the cell still runs read-only after approval. Conversely, if only the regex flags that cell, it uses the server’s configured mode and can run without a prompt if nothing else requires approval.
What the user sees
The classifier checks primary-database cells in notebook order and stops at the first flag. With the default classifier, the only visible change is that the prompt says “at least 1 destructive.” With a custom classifier, that wording can be misleading. For example, the classifier may flag SQL because it was too large to inspect.
If classification fails, the tool returns
SqlClassifierCallErrorbefore any cell runs. When the user answers a matching prompt, the tool applies that answer without classifying again.Hold the release until #585 lets hosts see when classification failed.
Refs AI-1338