Files
supabase/apps/studio
Matt Rossman 87681812a0 fix(studio): assistant get_active_incidents url in prod (#51047)
The Assistant's `get_active_incidents` tool has [failed in prod 99.8% of
the time over the past 60
days](https://supabase.slack.com/archives/C051L8U2EJF/p1790712805774689),
so users reporting outages get told it couldn't check incident status.
The failures never showed up as errors, which is why nobody noticed.

The Assistant now includes the `/dashboard` base path when it calls its
own API routes, so the tool stops hitting a 404 in prod
([`/api/incident-status`](https://supabase.com/api/incident-status) is a
404,
[`/dashboard/api/incident-status`](https://supabase.com/dashboard/api/incident-status)
is a 200). The tool also throws on a failed fetch now instead of
returning an `{ error }` result. That way failures show up as span
errors in Braintrust and as a failed tool call in the UI. The model
still gets the error message and tells the user it couldn't check.

When the fetch fails (in dashboard):

| Before (prod) | After (local, path temporarily broken) |
| --- | --- |
| <img width="1036" height="784" alt="CleanShot 2026-09-29 at 5 08 49
PM@2x"
src="https://github.com/user-attachments/assets/4539f968-4aa6-49a5-8c7f-7911b6b497a0"
/> | <img width="1026" height="716" alt="CleanShot 2026-09-29 at 5 08 06
PM@2x"
src="https://github.com/user-attachments/assets/7c9a565c-efe1-4d1a-901b-e440bbb5a739"
/> |

When the fetch fails (in Braintrust):

| Before (prod) | After (local, path temporarily broken) |
| --- | --- |
| <img width="2218" height="920" alt="CleanShot 2026-09-29 at 5 19 07
PM@2x"
src="https://github.com/user-attachments/assets/87860568-b50f-49ee-98fd-4c82f14d1913"
/> | <img width="2218" height="920" alt="CleanShot 2026-09-29 at 5 19 10
PM@2x"
src="https://github.com/user-attachments/assets/64f58d47-e083-464e-b8d0-8b9c57710a05"
/> |

When the fetch works (local):

| Dashboard | Braintrust |
| --- | --- |
| <img width="1054" height="808" alt="CleanShot 2026-09-29 at 5 20 58
PM@2x"
src="https://github.com/user-attachments/assets/1c9e4cf8-79f0-48e6-b95a-1694fc00a9f9"
/> | <img width="2918" height="1144" alt="CleanShot 2026-09-30 at 9 07
03 AM@2x"
src="https://github.com/user-attachments/assets/0d2b9685-57a9-4028-a451-272b3de8e23a"
/> |

Ran it locally with tracing on. Here's a [successful
call](https://www.braintrust.dev/app/supabase.io/p/Assistant/logs?r=251bcd44-c55b-44bb-9ce2-b034b26f8832),
and one with the path temporarily broken, which now [logs a span
error](https://www.braintrust.dev/app/supabase.io/p/Assistant/logs?r=637f2dc8-f65b-4d65-9d86-0511b36e8685).
Local dev has no base path, so the prod URL is covered by the new
`getBasePathURL` tests.

Closes AI-1272




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

* **Bug Fixes**
* Incident lookups now report fetch, HTTP, parsing, and validation
errors rather than returning an empty incident result.
* AI SQL generation now accounts for the configured site base path when
building its service URL.
* **Improvements**
* Site URLs now handle trailing slashes and existing base paths
consistently, avoiding duplicate path segments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-05 09:37:51 -04:00
..

Supabase Studio

A dashboard for managing your self-hosted Supabase project, and used on our hosted platform. Built with:

What's included

Studio is designed to work with existing deployments - either the local hosted, docker setup, or our CLI. It is not intended for managing the deployment and administration of projects - that's out of scope.

As such, the features exposed on Studio for existing deployments are limited to those which manage your database:

  • Table & SQL editors
    • Saved queries are unavailable
  • Database management
    • Policies, roles, extensions, replication
  • API documentation

Managing Project Settings

Project settings are managed outside of the Dashboard. If you use docker compose, you should manage the settings in your docker-compose file. If you're deploying Supabase to your own cloud, you should store your secrets and env vars in a vault or secrets manager.

How to contribute?

  • Branch from master and name your branches with the following structure
    • {type}/{branch_name}
      • Type: chore | fix | feature
      • The branch name is arbitrary — just make sure it summarizes the work.
  • When you send a PR to master, it will automatically tag members of the frontend team for review.
  • Review the main contributing guide to help test your feature before sending a PR.
  • The Dashboard is under active development. You should run git pull frequently to make sure you're up to date.

Developer Quickstart

Note

Supabase internal use: To develop on Studio locally with the backend services, see the instructions in the internal infrastructure repo.

# You'll need to be on Node v22
# in /studio

## For external contributors
pnpm install # install dependencies
pnpm run dev # start dev server

## For internal contributors
## First clone the private supabase/platform repo and follow instructions for setting up mise
mise studio  # Run from supabase/platform alongside `mise infra`

## For all
pnpm run test # run tests
pnpm run test -- --watch # run tests in watch mode

Running within a self-hosted environment

Follow the self-hosting guide to get started.

cd ..
cd docker
docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up

Once you've got that set up, update .env in the studio folder with the corresponding values.

POSTGRES_PASSWORD=
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_KEY=

Then run the following commands to install dependencies and start the dashboard.

npm install
npm run dev

If you would like to configure different defaults for "Default Organization" and "Default Project", you will need to update the .env in the studio folder with the corresponding values.

DEFAULT_ORGANIZATION_NAME=
DEFAULT_PROJECT_NAME=