Skip to content

fix(sandbox): start each local eval run on a fresh database - #466

Merged
raulb merged 2 commits into
mainfrom
claude/zealous-neumann-055c5f
Nov 13, 2026
Merged

raulb merged 2 commits into
mainfrom
claude/zealous-neumann-055c5f

Conversation

@raulb

@raulb raulb commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Fixes AI-1386

Local pnpm eval runs reused the previous run's database, so every run after the first started with earlier agents' migrations and grants. CI isn't affected: it runs each eval in a fresh Vercel sandbox.

Why

The sandbox image's Docker CLI was Debian's 20.10. With a client older than 23.0, supabase stop --no-backup on CLI versions before 2.122.0 removes the containers but fails to delete the database volume (CLI-2637, fixed upstream in supabase/cli#7177). The harness ignored the failure, and the next supabase start booted from the old volume.

Fix

  • Install Docker's official 27.5.1 CLI in the sandbox image instead of Debian's. This fixes the stop for every pinned CLI version, including evals that pin one older than 2.122.0. The image tag now includes a hash of the Dockerfile, so cached images get rebuilt.
  • Log when supabase stop --no-backup fails instead of ignoring it.
  • Before starting, stop the workspace's project, which clears a stack left by a run that died before teardown (e.g. Ctrl-C).
  • Tear down the stack when setup fails, instead of only stopping the sandbox.

This covers sequential runs only; running local evals concurrently is out of scope.

Testing

New Docker test (SANDBOX_DOCKER_TESTS=1 pnpm --filter @supabase-evals/sandbox test:docker): run 1 applies a migration and creates a table, and run 2 must start with neither. Run 2 is then killed before teardown, and run 3 must start clean. With the old Dockerfile the test fails, because run 1's database volume survives teardown. All 8 Docker tests and the unit tests pass.

🤖 Generated with Claude Code

@raulb
raulb requested a review from a team as a code owner October 30, 2026 14:24
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Nov 13, 2026 10:52am UTC

Request Review

@raulb raulb self-assigned this Oct 30, 2026
@raulb raulb changed the title fix(sandbox): start every local-stack run from a fresh database fix(sandbox): fresh database per local-stack run, and stop runs killing each other Oct 30, 2026
@raulb raulb changed the title fix(sandbox): fresh database per local-stack run, and stop runs killing each other fix(sandbox): start each local eval run on a fresh database Oct 30, 2026
Comment thread packages/sandbox/src/stack-ownership.ts Resolved
Comment thread packages/sandbox/src/docker-sandbox.ts Resolved
Comment thread packages/sandbox/src/stack-ownership.ts Resolved
Local `pnpm eval` runs reused the previous run's database. The sandbox
image's Docker CLI was Debian's 20.10, and with a client older than 23.0
`supabase stop --no-backup` on CLI versions before 2.122.0 removes the
containers but fails to prune the database volume (CLI-2637,
supabase/cli#7177). The harness ignored the failure, and the next
`supabase start` booted from the old volume.

- Install Docker's official 27.5.1 CLI in the sandbox image, so the stop
  works for every pinned CLI version. The image tag now includes a hash
  of the Dockerfile, so cached images get rebuilt.
- Log when `supabase stop --no-backup` fails instead of ignoring it.
- Before starting, stop the workspace's project, removing a stack left
  by a run that died before teardown.
- Tear down the stack when setup fails, instead of only stopping the
  sandbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@raulb
raulb force-pushed the claude/zealous-neumann-055c5f branch from f022b22 to 02a4702 Compare November 11, 2026 14:47

@mattrossman mattrossman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Ran the same local eval twice and confirmed the second started fresh, and teardown removed the database volume.

Non-blocking, but might be worth a comment-trimming pass (e.g. this comment could just explain why the Dockerfile hash is included).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@raulb
raulb merged commit 27bf2d9 into main Nov 13, 2026
10 checks passed
barryroodt added a commit that referenced this pull request Nov 24, 2026
## Problem

PRs here inherit the org template from `supabase/.github`, and nobody
fills it in. Recent evals PRs (#463, #466, #506, #514, #535) all go
Problem, then Changes or Fix, then Verification with the exact `pnpm
eval` command and a pass count. There's also nowhere that tells authors
how to show CI results, which changed when #535 moved results to
Braintrust only.

## Changes

Adds `.github/PULL_REQUEST_TEMPLATE.md` with the shape those PRs already
use:

- **Problem** and **Changes** replace the org template's four prompts.
- **How to Review** is optional, for multi-file PRs. The eval reading
path sits in a comment and links to the reviewer checklist in
`CONTRIBUTING.md` so it doesn't get copied.
- **Verification** asks for the exact commands and before/after pass
counts. The eval checklist matches `CONTRIBUTING.md` after #535:
`run-evals-changed` or Refresh eval results, then link the Braintrust
run.
- A closing comment prompts for the Linear issue.

Small PRs can still replace the whole thing with a couple of sentences.

## Verification

One new file, `.github/PULL_REQUEST_TEMPLATE.md`. Both `CONTRIBUTING.md`
anchors it links to (`#reviewing-an-eval`,
`#submitting-evals-for-review`) exist on `main`.

Closes AI-1130
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.

3 participants