Skip to content

fix(evals): Run the eval suite on vitest-evals 0.18 - #1973

Merged
dcramer merged 1 commit into
mainfrom
fix/evals-vitest4
Nov 5, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/evals-vitest4

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The Eval workflow on main reports green, but no evals have run. eval:ci fails at startup:

Failed to load custom Reporter from vitest-evals/reporter
cause: Package subpath './reporters' is not defined by "exports" (ERR_PACKAGE_PATH_NOT_EXPORTED)

The cause is that vitest-evals 0.4.0 imports vitest/reporters, which vitest 5 removed. continue-on-error on "Run evals" hides the failure, so no eval-results.json gets written and the status check step throws. Example run: https://github.com/getsentry/toolkit/actions/runs/41951775819

This PR moves the eval package to vitest-evals 0.18.0, which supports vitest 5 (getsentry/vitest-evals#113, peer range vitest >=5 <6). The whole repo stays on vitest 5; there is no vitest 4 pin.

Changes

  • Bump vitest-evals to ^0.18.0. I added vitest-evals@0.18.0 and its @vitest-evals/core@0.18.0 and @vitest-evals/report-ui@0.18.0 dependencies to minimumReleaseAgeExclude, because they were published today. Drop those entries once they are past the 24h window.
  • Import from vitest-evals/legacy. 0.18 keeps the scorer-first API (describeEval with data/task/scorers, ToolCallScorer, Score, ScoreFn, BaseScorerOptions) under vitest-evals/legacy. This is an import-path change only, in the 33 eval imports and the example in docs/testing/overview.md. The eval code is unchanged.
  • Remove the unused root vitest-evals dev dependency. Nothing at the root imports it.
  • Set SENTRY_CLI_NO_TELEMETRY=1 for the scorer's sentry mcp process.
    • ToolPredictionScorer starts pnpm --dir packages/cli run cli mcp from source. On main, that process exits immediately with Package subpath './client' is not defined by "exports", and every scorer then fails with MCPClientError: Connection closed.
    • The exit comes from lazyTelemetry() in src/lib/db/index.ts. It loads ../telemetry.js with createRequire, so its imports resolve @sentry/api/client under the require condition, but @sentry/api exports ./client only for import.
    • Evals shouldn't send CLI telemetry anyway. The CLI bug itself is not fixed here: pnpm --filter sentry run cli help also fails from source. It needs its own CLI fix.

continue-on-error and the eval status check are unchanged.

Verification

  • Local, no LLM key: with no key in the sandbox, pnpm eval:ci on vitest 5.0.5 loads the reporter, collects and runs all 27 files and 121 evals, and writes eval-results.json. On main it stops at startup. Every eval failed, and the only cause was the missing provider key. No Connection closed errors.
  • Checks: pnpm run tsc, pnpm run lint, and pnpm install --frozen-lockfile pass. The full pnpm run test didn't finish inside my sandbox's time limit, so I'm relying on CI for it.

Related

via @dcramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 5, 2026 4:21am UTC

Request Review

@dcramer

dcramer commented Nov 5, 2026

Copy link
Copy Markdown
Member

oops, i meant to have you get vitest-evals working on vitest 5, not downgrade us to vitest 4

@sentry-junior
sentry-junior Bot marked this pull request as draft November 5, 2026 03:50
dcramer pushed a commit to getsentry/vitest-evals that referenced this pull request Nov 5, 2026
Makes `vitest-evals` work on Vitest 5. getsentry/toolkit uses Vitest 5,
and its eval suite can't load the reporter from the `vitest-evals` 0.4.0
release it depends on, because that release imports `vitest/reporters`,
which Vitest 5 removed.

The reporter on `main` already imports from `vitest/node`, and Vitest 5
still exports `DefaultReporter` and `VerboseReporter` from there, so it
runs. What broke were the types and the test fixtures.

> [!WARNING]
> **Breaking change for Vitest 4 consumers.** The `vitest-evals` peer
dependency changes from `vitest >=4 <5` to `vitest >=5 <6`. One `declare
module "vitest"` block can't merge with both the Vitest 4 `Assertion<T>`
and the Vitest 5 `Assertion<R, T>`, so the typed matchers no longer
support Vitest 4. Ship this as a minor bump (**0.18.0**), not a patch.

### Changes

- **Matcher types:** Vitest 5 declares `Assertion<R extends void |
Promise<void> = void, T = unknown>`. The augmentations in `index.ts`
(`toSatisfyJudge`) and `legacy.ts` (`toEval`) used `Assertion<T = any>`,
so `tsc` failed with TS2428. Both now use the Vitest 5 signature.
- **Peer ranges:** `vitest-evals` requires `vitest >=5 <6`, as the
warning above describes. `@vitest-evals/github-reporter` doesn't augment
Vitest types, so it accepts `>=4 <6`.
- **Workspace:** `vitest` and `@vitest/coverage-v8` move to `^5.1.0`,
and the lockfile is regenerated with pnpm 10.33.0.
- **Reporter tests:** Vitest 5's base reporter reads `state` from the
context and calls `benchmarks()` on each test case, so the fake context
and `TestCase` now provide both. The verbose fallback test now expects
`file:12`, because Vitest 5 prints the line number without the column.

### Verification

- `pnpm typecheck`, `pnpm lint`, `pnpm build`, and `pnpm release:check`
pass.
- `pnpm test:ci`: 408 tests pass and 1 fails. The failure is in
`report-ui`, "returns 500 when asset reads fail". It fails the same way
on `main` with Vitest 4 in my sandbox, where the file is still readable
after `chmod 000`, so this change didn't cause it.
- Consumer check: I packed this branch and installed it into
getsentry/toolkit `main`, which runs Vitest 5.0.5. With its imports
switched from `vitest-evals` to `vitest-evals/legacy`, `vitest run
--reporter=vitest-evals/reporter` loaded the reporter. All 27 files and
121 evals ran and wrote `eval-results.json`, and `tsc` passed for the
eval package. The evals themselves failed only because the sandbox has
no provider API keys.

### Follow-up

After 0.18.0 is released, toolkit can move from `vitest-evals` 0.4.0 to
it and keep Vitest 5. That change will replace getsentry/toolkit#1973's
current approach, which pins Vitest 4 for the eval package.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A1de0f02c391e347294cc7ce28353bcfe -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A1de0f02c391e347294cc7ce28353bcfe)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1de0f02c391e347294cc7ce28353bcfe/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
vitest-evals 0.4.0 imports `vitest/reporters`, which vitest 5 removed,
so `eval:ci` failed at startup and no evals ran. vitest-evals 0.18.0
supports vitest 5 (peer `>=5 <6`).

- Bump the catalog to ^0.18.0 and keep the eval package on vitest 5.
  Allow vitest-evals and its @vitest-evals/core and report-ui 0.18.0
  deps past minimumReleaseAge, as they were published today.
- Import the scorer-first API from `vitest-evals/legacy`, where 0.18
  keeps it.
- Remove the unused root vitest-evals dev dependency.
- Set SENTRY_CLI_NO_TELEMETRY=1 for the scorer's `sentry mcp` process.
  Evals must not send telemetry, and it skips the lazy telemetry
  require that fails when the CLI runs from source.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@sentry-junior sentry-junior Bot changed the title fix(evals): Run the eval suite on vitest 4 fix(evals): Run the eval suite on vitest-evals 0.18 Nov 5, 2026
@dcramer
dcramer marked this pull request as ready for review November 5, 2026 04:31
@dcramer

dcramer commented Nov 5, 2026

Copy link
Copy Markdown
Member

can we not also bump vitest to 5? or is it too much effort

@dcramer
dcramer merged commit 02ca9bf into main Nov 5, 2026
46 checks passed
@dcramer
dcramer deleted the fix/evals-vitest4 branch November 5, 2026 04:42

This branch was successfully deployed

1 active and 1 inactive deployments
Preview — 50cdbb16 Deployed Nov 5, 2026 by vercel[bot]
Actions — 50cdbb16 Deployed Nov 5, 2026 by sentry-junior[bot] via eval #1561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant