fix(agent-eval): provide type augmentation for agent-eval/eval#166
Open
huang-julien wants to merge 1 commit into
Open
fix(agent-eval): provide type augmentation for agent-eval/eval#166huang-julien wants to merge 1 commit into
huang-julien wants to merge 1 commit into
Conversation
This was referenced Jul 3, 2026
Merged
gaojude
added a commit
to vercel/next.js
that referenced
this pull request
Jul 6, 2026
…5440) Fixes false-negative regex assertions — observed rejecting correct solutions in recent eval runs — by grading those specific checks with `@vercel/agent-eval`'s agentic LLM judge instead. Only the assertions with demonstrated false negatives change; every deterministic check stays. - `agent-034-async-cookies`: `/await\s+cookies\s*\(\s*\)/` only matched the naive `await cookies()` and rejected the correct (arguably better) `await Promise.all([cookies(), headers()])` — observed failing most runs of a strong model — and the no-sync-call lookbehind wrongly flagged the bare `cookies()` inside the array. The four await-mechanics tests collapse into one judge criterion: the promises must actually be awaited before use, in any correct form. The theme-cookie and Accept-Language content checks stay regex. - `agent-030-app-router-migration-hard`: the home-page test rejected solutions that didn't match one exact shape (e.g. data fetching extracted to a helper means no literal `fetch(` in `page.tsx`). Its body becomes one judge criterion (async Server Component, fetches during server render, no `getServerSideProps`); the file-existence check and the other seven tests stay deterministic. The judge is pinned to **`claude-haiku-4-5`** in the generated experiment configs — a cheap fixed grader, identical for every run regardless of the model under test. Each criterion states the requirement semantically, includes one reference solution to ground the small grader, and fixes the standard of judgment (runtime correctness, not style) — no enumerated failure modes, so the judge stays flexible about equivalent forms. Supporting changes: bumps `@vercel/agent-eval` `0.9.5` → `1.3.0` (ships the judge runtime) and adapts `run-evals.js` to the 1.3 CLI (`run baseline agents-md --force`; `--dry` maps to `status`); generated experiments now run through the Vercel AI Gateway so `vc env pull` is the only credential setup; converted fixtures exclude `EVAL.ts` from tsconfig (the `@vercel/agent-eval/eval` import has no type declarations — vercel-labs/agent-eval#166 — and `next build` type-checks the fixture, so experiments running `scripts: ['build']` would otherwise fail on it, same reason `EVAL.tsx` was already excluded). Not converted: `agent-040` (already redesigned upstream in #94578) and `agent-041` (no diagnosed false negative in the report). Verified end-to-end from this repo: converted `agent-034` with codegen `claude-sonnet-4-5` via the AI Gateway in a Vercel sandbox, judge pinned to `claude-haiku-4-5` — passes, with the judge clause executing in-sandbox. **Running it:** ```bash pnpm install # picks up @vercel/agent-eval 1.3.0 pnpm --filter=next build # pnpm eval packs the locally built next vc env pull .env.local # the only credential: sandbox + AI Gateway (codegen and judge) pnpm eval agent-034-async-cookies # baseline + AGENTS.md variants pnpm eval agent-034-async-cookies --dry # preview only ``` <!-- NEXT_JS_LLM_PR -->
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.
This PR provides type augementation for
@vercel/agent-eval/eva.Users have to provide their own type augementation otherwise.