Skip to content

Install vitest before validating when the agent removed it - #195

Merged
gaojude merged 2 commits into
mainfrom
ensure-validation-runner
Aug 25, 2026
Merged

Install vitest before validating when the agent removed it#195
gaojude merged 2 commits into
mainfrom
ensure-validation-runner

Conversation

@gaojude

@gaojude gaojude commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

An eval whose agent replaces package.json loses vitest, and validation then fails to start rather than grading — so the harness records a failure for work it never ran. This puts the runner back before validating.

Comes up with blank-slate fixtures, where the agent scaffolds a project from scratch and owns the manifest.

Validation runs `npx vitest`, and the generated vitest.config.ts imports
`vitest/config`, resolved from the workspace. Fixtures supply vitest as a
devDependency, but package.json belongs to the agent for the length of a run. An
agent scaffolding into an empty directory tends to replace that file rather than
edit it, the next install prunes vitest, and npx then fetches it into a cache
that does not satisfy the config's import.

The run dies at startup with `Cannot find package 'vitest'`. Nothing downstream
distinguishes that from a bad result: the eval never executes, and the harness
records a failure for work it never graded. A wrong answer and an ungraded one
score the same.

runValidation now checks for the runner and installs it when missing. The repair
must not read as the agent's work, so `--no-save` keeps it out of the manifest
and `--no-package-lock` out of the lockfile, which is not gitignored and would
otherwise be captured as a file the agent wrote.

Verified end to end against a fixture with no vitest: without this the run fails
to start, with it the eval executes and grades.
# Conflicts:
#	packages/agent-eval/src/lib/agents/shared.test.ts
@gaojude
gaojude marked this pull request as ready for review August 25, 2026 15:58
@gaojude
gaojude merged commit 701c1e1 into main Aug 25, 2026
4 checks passed
@gaojude
gaojude deleted the ensure-validation-runner branch August 25, 2026 16:21
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
gaojude added a commit to vercel/next-evals-oss that referenced this pull request Aug 25, 2026
Picks up the async judge matchers (vercel-labs/agent-eval#196) and the
vitest reinstall guard (vercel-labs/agent-eval#195), moving the harness
onto the 2.x line.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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