Commit Graph

316 Commits

Author SHA1 Message Date
Rich Haines d33f7cddac Merge pull request #171 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.3.1
2026-07-06 18:42:27 +02:00
github-actions[bot] fddf0a39fe Version Packages 2026-07-06 16:41:41 +00:00
Rich Haines 435879923d Merge pull request #170 from vercel-labs/rh/opencode-gateway-model-prefix
Route OpenCode explicit model overrides through the AI Gateway
2026-07-06 18:40:57 +02:00
molebox d6e9c86c76 agent-eval: route OpenCode explicit model overrides through the AI Gateway
An explicit --model like anthropic/claude-sonnet-5 was passed to the
OpenCode CLI verbatim, which reads the first segment as its provider id.
The generated opencode.json only configures the vercel (AI Gateway)
provider, so every explicit-model run using a canonical gateway id died
at session start with "Unexpected server error" and a null
observedModel.

- resolveOpenCodeModel (host-side): prefix vercel/ unless the caller
  already targets vercel/... or a configured extraProviders key.
- Threaded to the runner via runnerExtra -> input.extra.cliModel,
  mirroring codex's host-computed model (the judge path ships extra but
  not agentOptions, so the resolution must happen host-side).
- normalizeObservedModel (runner-side): un-apply exactly that prefix on
  the observation, so observedModel === requestedModel holds for
  canonical gateway ids and a gateway substitution still surfaces as a
  clean gateway id. Native-default observations are untouched, and the
  documented vercel/-prefixed form still passes through verbatim.
- README: the OpenCode model format section now documents both forms
  (it previously stated unprefixed ids fail with provider-not-found).
2026-07-06 12:17:19 +02:00
Jude Gao 1d1f4f60b2 Merge pull request #167 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.3.0
2026-07-02 10:02:52 -04:00
github-actions[bot] a9a1d16e6a Version Packages 2026-06-30 17:15:02 +00:00
Jude Gao 6ebfe82f39 Merge pull request #165 from vercel-labs/jude/agent-eval-eval-staleness
[agent-eval] Incremental eval staleness: status / run + content-aware fingerprints
2026-07-01 01:14:13 +08:00
Jude Gao b35873ca4a [agent-eval] Incremental eval staleness: status / run + content-aware fingerprints
Adopting a changed or new eval shouldn't force re-running every model. This adds a
small, explicit workflow and fixes the fingerprinting that made it impossible.

- Fingerprint split: results store a content-only hash alongside the combined
  (content+config) one. A real eval change is never masked; a benign config change
  (timeout bump, pinning a judge) is carried forward by `refingerprint` instead of
  re-running. Existing `fingerprint` values are byte-identical.
- `agent-eval status` — read-only: new vs changed evals, per experiment. `--check`
  exits non-zero on any new/changed eval; `--json` emits per-experiment new/changed.
- `agent-eval run <experiments...>` — run the named experiments' new/changed evals.
- Bare `agent-eval` shows status, then lets you multi-select what to run. Removes
  `run-all` and `--dry`. No in-framework accept/keep — staleness acceptance is the
  consumer's policy (filter `status --json` in CI).

Stacked on #164.
2026-06-30 13:07:13 -04:00
Jude Gao b8bd4ec7f1 Merge pull request #164 from vercel-labs/jude/agent-eval-pinnable-judge
[agent-eval] Pin the agentic judge to a fixed agent and model
2026-07-01 00:51:25 +08:00
Jude Gao 2905905a27 [agent-eval] Pin the agentic judge to a fixed agent and model 2026-06-29 23:45:45 -04:00
Jude Gao 6867dc1cf7 Merge pull request #163 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.2.0
2026-06-30 06:02:53 +08:00
github-actions[bot] 9b2caa0106 Version Packages 2026-06-29 21:33:53 +00:00
Jude Gao 4c67a083a7 Merge pull request #162 from vercel-labs/jude/agent-eval-eval-matcher
[judge] Agentic LLM-judge matcher for EVAL.ts
2026-06-30 05:33:06 +08:00
Jude Gao 122a329c44 Merge pull request #160 from vercel-labs/jude/agent-eval-plugin-migration
[agents] Plugin model: per-agent definition + in-sandbox runner
2026-06-30 05:32:58 +08:00
Jude Gao 7021c4b914 agent-eval: agentic LLM-judge matcher for EVAL.ts
Judge the final state or the transcript from inside EVAL.ts, reusing the
SAME agent + sandbox as codegen (no fresh sandbox, no copied evidence):

  import { environment, transcript } from '@vercel/agent-eval/eval';
  await expect(environment).toSatisfyCriterion('uses Server Components');
  await expect(transcript).toSatisfyCriterion('used DevTools, not guesswork');
  await expect(environment).toScoreAtLeast('code quality', 0.8);

- eval-helper.mjs: shipped in-sandbox (aliased to @vercel/agent-eval/eval +
  vitest setup file); each assertion re-invokes __agent_eval__/run.mjs with a
  judge prompt and parses the verdict. You give only the criterion.
- orchestrator/shared: ship the helper, materialize the raw transcript to a
  file (read by path, never dumped into a prompt), record judge-config (same
  model), pass auth env to validation, gitignore __agent_eval__/.
- Failures are attributable: '[judge:environment] FAIL (score): reason'.

Verified: unit tests + real e2e (Vercel sandbox + Claude via gateway) — judge
confirms true criteria (eval passes) and rejects a false one (eval fails).
2026-06-29 14:28:25 -04:00
Jude Gao d9b0cb1696 agent-eval: deslop plugin migration
Review cleanups (no behavior change):
- contract.ts: drop dead AgentRunResult re-export; fix wrong
  'editPrompt'd by the runner' comment; de-dup the extra/runnerExtra docs.
- codex/agent.ts: extract parseOptionsModel() — configFiles() and
  runnerExtra() shared the same parse (DRY).
- run.mjs headers: honest, terse export rationale (the old wording claimed
  helpers were test-verified when codex/gemini/cursor have none).
2026-06-26 20:20:18 -04:00
Jude Gao 1bdd92462f agent-eval: migrate codex/opencode/gemini/cursor to the plugin model
Port the remaining four adapters onto the generic orchestrator: each becomes a
host-side definition (agent.ts) + an in-sandbox runner (run.mjs); the old
single-file adapters are deleted. The Agent interface + registry are unchanged.

- codex: host-computed values (resolved --model, reasoning effort, verbosity from
  parseModelString) must match the TOML profile, so AgentDefinition gains an
  optional runnerExtra(options) threaded to the runner as input.extra (the only
  contract addition). generateCodexConfig/parseModelString stay host-side + exported.
  login is a separate spawn piping the key on stdin (no secret in a shell string);
  the && short-circuit is preserved.
- opencode: opencode.json config + log-scrape then `opencode export` observedModel
  fallback chain preserved; generators stay host-side + exported.
- gemini/cursor: stdout-only stream-json, no config, observedModel null. cursor
  binary is 'agent', prompt-first arg order.

Adversarially reviewed each plugin vs its origin/main adapter: zero critical/major
findings. Live-validated end to end against a real Vercel sandbox + AI Gateway:
claude 7/7 and codex 6/6 integration tests pass. 216 unit + lint + build green.
2026-06-26 17:18:06 -04:00
Jude Gao 45e22f6b4e agent-eval: plugin model — generic orchestrator + claude-code migrated
Introduce the agent plugin contract + a single generic host orchestrator, and
migrate claude-code onto it as the first vertical slice.

Each agent is now: a host-side DEFINITION (agent.ts: install/configFiles/authEnv/
getApiKeyEnvVar/defaultModel) + an in-sandbox RUNNER (run.mjs: invoke the CLI +
capture the transcript, returning a typed RunnerResult). The generic
runWithDefinition() drives the shared, agent-agnostic flow (sandbox lifecycle,
git baseline, neutral workspace, validation, generated-file capture, o11y parse,
abort/timeout) — reproducing the old claude-code.ts run() exactly.

run.mjs is self-contained (only node:*), dual-mode (importable + runnable), and
exports its pure helpers so host tests verify exactly what the sandbox runs. The
Agent interface is unchanged, so registry/runner/results are untouched.

- plugin/contract.ts: AgentDefinition, AgentRunInput, RunnerResult (+ InstallStep/ConfigFile)
- plugin/orchestrator.ts: runWithDefinition() — the generic run()
- claude-code/agent.ts + claude-code/run.mjs; index.ts points at the new path
- build: scripts/copy-runners.mjs ships each run.mjs into dist
- claude-code.test.ts: import paths updated (helpers from run.mjs, factory from agent.ts)

Host<->sandbox result contract: run.mjs writes __agent_eval__/agent-result.json
(+ a __AGENT_RESULT__ stdout marker fallback); host reads it, splitting agent
failure (ok) from runner crash (node exit). Validated end-to-end against a real
Vercel sandbox + AI Gateway: 7/7 claude integration tests pass (gateway + direct
API + parallel + invalid-model error path); 216 unit tests + lint green.
2026-06-26 17:07:20 -04:00
Jude Gao a9dcc9a8c5 Merge pull request #155 from vercel-labs/jude/publish-reconcile
Reconcile against the npm registry when changeset publish reports failure
2026-06-11 10:36:14 -07:00
Jude Gao ac1bc65c01 Reconcile against registry when changeset publish reports failure 2026-06-11 12:52:51 -04:00
Rich Haines ed5fdc4c69 Merge pull request #154 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.1.1
2026-06-11 18:49:03 +02:00
github-actions[bot] bb7cbed5dd Version Packages 2026-06-11 16:46:15 +00:00
Rich Haines 220a788a7a Merge pull request #152 from vercel-labs/rh/fix-claude-allowed-tools-order
Fix Claude prompt consumed by variadic --allowedTools in webResearch runs
2026-06-11 18:45:20 +02:00
molebox c016ea0319 Fix Claude prompt consumed by variadic --allowedTools
The comma-separated token from #150 prevents the tools list itself from
splitting, but --allowedTools is variadic: it keeps capturing positional
tokens until the next flag. With the prompt directly after the value,
claude 2.1.112 consumed it as another tool name and failed with 'Input
must be provided either through stdin or as a prompt argument when using
--print' — caught by a live a0-local smoke run, invisible to the unit
tests because they asserted the broken order.

Emit --allowedTools first so the always-present
--dangerously-skip-permissions terminates the variadic capture before
the trailing prompt. Verified live: the reordered invocation accepts the
prompt. Default-off argument construction is byte-identical. New test
asserts the token after the allowedTools value is always a flag.
2026-06-11 17:00:37 +02:00
Rich Haines 090c8290de Merge pull request #151 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.1.0
2026-06-11 16:14:41 +02:00
github-actions[bot] 7a23a1377a Version Packages 2026-06-11 14:13:27 +00:00
Rich Haines 086a33e0fb Merge pull request #150 from vercel-labs/rh/opt-in-web-research
Add opt-in webResearch option for agent web tools
2026-06-11 16:12:39 +02:00
molebox 17d246965c Include webResearch in result-reuse fingerprints when enabled
Conditional include (same pattern as native-default modelPolicy) so
default-off fingerprints are byte-identical to existing releases, while
research and non-research configs never share a fingerprint — result
reuse must not serve a cached parametric-only result for a research
run, or vice versa.
2026-06-11 15:43:16 +02:00
molebox 1d8321f0c6 Thread webResearch through ExperimentConfig and the runner
The adapters read options.webResearch, but runExperiment built
AgentRunOptions from an explicit field list that never included it, so
the option was unreachable for experiment-config consumers (a0-local
calls runExperiment, not executeAgent). Adds the field to
ExperimentConfig/ResolvedExperimentConfig/RunnableExperimentConfig, the
zod schema (z.object strips unknown keys, so schema membership is
required for validateConfig not to drop it), resolveConfig, and both
agent.run call sites (runExperiment and runSingleEval).

Still default-off: absent config yields webResearch: undefined, which
leaves every adapter branch untaken.
2026-06-11 15:37:29 +02:00
molebox 084d895f66 Add opt-in webResearch option for agent web tools
Safe redo of #141 (reverted in #144). webResearch defaults to false, so
command construction is byte-identical for existing consumers; coding
evals are unaffected unless they opt in.

The #141 breakage is fixed and regression-tested: Claude Code's
--allowedTools is variadic, so WebSearch/WebFetch are passed as a single
comma-separated value instead of separate tokens that consumed the
trailing positional prompt.

Verified against AI Gateway with live spikes: Claude Code WebSearch
executes (tool_use/tool_result events), OpenCode Exa websearch executes,
and Codex researches via shell even though no web_search items appear
through the responses wire (setting kept for direct-OpenAI runs and
future gateway support).
2026-06-11 15:03:59 +02:00
Rich Haines 966aea0b25 Merge pull request #149 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.0.1
2026-06-11 08:29:29 +02:00
github-actions[bot] c4961d7cbc Version Packages 2026-06-11 06:26:45 +00:00
Rich Haines 1d580086bf Merge pull request #148 from vercel-labs/rh/opencode-observed-model-export
Fix OpenCode observed model extraction for OpenCode >= 1.17.0
2026-06-11 08:25:50 +02:00
molebox b4841d6791 Fix OpenCode observed model extraction for OpenCode >= 1.17.0
OpenCode 1.17.0 rewrote its logging pipeline and removed the
service=llm log lines the adapter scraped for providerID/modelID,
so native-default runs silently lost model observation.

Fall back to 'opencode export <sessionID>' when log scraping yields
nothing: the session id comes from the --format json event stream and
the exported assistant message carries providerID/modelID. Observation
never fails the run. The log scrape stays as the first, cheaper source
for OpenCode <= 1.16.x.
2026-06-10 16:54:43 +02:00
Rich Haines 8fea011ea6 Merge pull request #147 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@1.0.0
2026-06-01 19:12:13 +02:00
github-actions[bot] 1ee6ee852e Version Packages 2026-06-01 17:11:11 +00:00
Rich Haines 17f5987722 Merge pull request #146 from vercel-labs/feat/native-default-model-policy
Use native model defaults when model is omitted
2026-06-01 19:10:24 +02:00
molebox cedf84b4bc Use native default when model is omitted 2026-06-01 18:48:13 +02:00
molebox aa66c4d35b Add native default model policy 2026-06-01 17:01:36 +02:00
Allen Zhou e4587b5434 Merge pull request #145 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@0.14.5
2026-05-29 17:35:24 -07:00
github-actions[bot] 3db1716a00 Version Packages 2026-05-30 00:34:54 +00:00
Allen Zhou fb4005237c Merge pull request #144 from vercel-labs/revert-141-enable-web-sources
Revert "Enable source-capable web tools for agent runs" (#141)
2026-05-29 17:34:02 -07:00
Allen Zhou 450bed3b94 Add changeset for revert of #141 2026-05-29 17:30:46 -07:00
Allen Zhou 2b7eddf90f Revert "Merge pull request #141 from vercel-labs/feat/enable-agent-web-sources"
This reverts commit daaeccb42c, reversing
changes made to cb2280db61.
2026-05-29 17:30:14 -07:00
Rich Haines ff51aaf83d Merge pull request #143 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@0.14.4
2026-05-29 17:06:41 +02:00
github-actions[bot] e0db9a3813 Version Packages 2026-05-29 15:03:07 +00:00
Rich Haines daaeccb42c Merge pull request #141 from vercel-labs/feat/enable-agent-web-sources
Enable source-capable web tools for agent runs
2026-05-29 17:02:23 +02:00
molebox 74be0aa25b Merge main into feat/enable-agent-web-sources 2026-05-29 16:51:52 +02:00
Allen Zhou cb2280db61 Merge pull request #142 from vercel-labs/changeset-release/main
Version Packages
@vercel/agent-eval@0.14.3
2026-05-28 14:04:44 -07:00
github-actions[bot] a53721752b Version Packages 2026-05-28 18:45:17 +00:00