Errors
Every evals.* error code, when it is raised, and what to do about it.
Every error Viewport Evals raises extends Viewport Core's ViewportError, carries a stable code, and has the same
code and message in both languages. Classes: ViewportEvalsError for most codes, FixtureError for fixture
problems, ConfigError for config and agent lookup, CaseLoadError (a core SpecError) for invalid case files.
TypeScript also has ReplayMissError for a request the recording cannot answer.
A code can reach you two ways. Thrown: from trace(), t.called, t.meets or a config load, as an exception.
In a verdict: when the runner cannot evaluate a case, its status is error and verdict.error holds
{ code, message }. Either way the CLI exits 1 for a case error and 2 for a usage or config error.
| Code | When | What to do |
|---|---|---|
evals.case_invalid | a case file or an inline expect block fails validation: unknown key, wrong type, bad matcher. Issues carry file, line, column and a did-you-mean | fix the key; viewport-evals validate lists every issue |
evals.invariant_invalid | an invariant (inline, in a policy file or in code) fails invariant/v1: no operator, duplicate name, bad path, glob or duration. Raised as InvariantLoadError | fix the invariant; validate also prints warnings such as an after without same |
evals.config_invalid | an unknown or ill-typed config key, a bad VIEWPORT_EVALS_* value, an unknown reporter, or a Trace entered twice | the message names the key or variable |
evals.agent_not_found | a case names an unregistered agent, no agent is registered, or several are and the case names none | register the agent, or add agent: to the case |
evals.world_not_found | a case's world: { name: { use } } names neither a configured world nor a pack | register it under worlds in config; the message lists the known names |
evals.world_invalid | a world's name, state or seed is not valid: state must be a JSON object | fix the definition or the seed |
evals.world_fault | a world tool raised something other than WorldError. The call was rolled back and the test fails, because it is a bug in the tool | fix the tool, or raise WorldError for errors the model should see |
evals.fixture_missing | replay or rescore with no fixture, or a replaying trace() that calls a model with no recording | record locally (auto, or --mode record) and commit the fixture |
evals.fixture_stale | in CI, the fixture's case_hash no longer matches the case's input, agent or runs, or it has fewer runs than the case asks for | re-record with --rerecord |
evals.fixture_invalid | a fixture file is not valid JSON or not evals/fixture/v1 | re-record it; do not hand-edit exchanges |
evals.recording_miss | in replay, a model request matches no recorded exchange. The message shows a diff against the closest one. The Claude Agent SDK proxy reports it in an x-viewport-error header | re-record after an intended change; otherwise the diff shows what drifted |
evals.replay_blocked | in replay, the agent opened a connection with no recording to a host not in replay.allow_hosts (any transport: fetch, node:http, sockets, httpx, requests, boto3). The case errors even if the agent caught ReplayBlockedError; the verdict and report count blocked | a model provider: add its host to replay.hosts (or wrap() the client) and re-record; your own service: add it to replay.allow_hosts, or fake it |
evals.recording_unused | TypeScript ReplaySession.assertConsumed() found recorded exchanges the run never requested | re-record, or check why the agent made fewer calls |
evals.replay_proxy_upstream | the replay proxy for a child process could not reach the real provider while recording (sent as the x-viewport-error header of a 502) | check the network and the provider's base URL |
evals.replay_tool_miss | with replay: { tools: recorded }, the agent called a tool with arguments the imported trace never saw, and on_miss is error | an intended change: set on_miss: world or live, or re-import; otherwise it is the regression |
evals.nothing_captured | a trajectory assertion or t.called ran on a trace with no model or tool call, so a negative check could pass by accident. The message suggests the likely cause | wrap the client or install the adapter for your stack; set allow_empty for code that calls no model |
evals.judgment_missing | a judge matcher needs a verdict that is not cached in the fixture, in replay or rescore, where judges are never called | run locally in auto to cache it, commit the fixture |
evals.judge_invalid | an llm_judge / llmJudge completion did not answer with {"passed", "score", "reason"} JSON | fix the judge prompt or model |
evals.judge_needs_async | Python only: t.meets (sync) needed a judge that awaits IO | use await t.ameets(...) |
evals.plugin_not_found | a use: entry names a plugin not registered in the running language. The message says where to register it | register the plugin in this language too |
evals.plugin_options_invalid | an assertion plugin's options failed its schema | fix the options in the case's use: entry |
evals.unpriced_model | t.usage.cost_usd was read for a model the price table does not know. In a case, budget.cost_usd fails with the same message instead | add the model under pricing in config, or report usage.cost_usd |
evals.simulated_time_exceeded | a run on a simulated clock passed max_simulated (default 30 days), usually a runaway interval | find the timer that keeps rescheduling, or raise clock.max_simulated |
evals.clock_unsupported | TypeScript: a simulated clock was asked to patch Date or timers while vitest fake timers are on | call vi.useRealTimers() in that test |
evals.import_invalid | viewport-evals import got a source it cannot read: an unknown format, a malformed export, JSON nested deeper than 128 levels, an invalid trace id | check the file or id |
evals.import_failed | fetching a trace from Langfuse, LangSmith or Braintrust failed: missing keys, auth, network | the message names the variable or the HTTP status |
evals.export_failed | a score exporter failed under --strict-export (without it, the failure prints one line and the run continues) | check the platform's keys and URL |
evals.results_locked | the results directory's index lock is held by another process past the wait | retry; remove a stale lock left by a killed process |
evals.script_exhausted | a scripted model or fake judge was asked for more than it was given, or assert_consumed / assertConsumed found turns left over. The message shows the unexpected request | add the missing turn, or remove the extra one |
evals.run_failed | the runner hit an unexpected error outside your agent while running a case | report it; the message has the cause |
A run that exceeds timeout_ms is aborted and recorded with error type TimeoutError, and a tool call the framework
rejected (unknown tool, invalid arguments) is a tool_call whose error.type is invalid_tool_call. Both are
trajectory errors, asserted like any other, not Evals error codes.
Errors from your agent
An exception in your agent is not an Evals error. It becomes the trajectory's error (type and message). By
default error: false applies, so the run fails with a single error assertion, agent failed: <type>: <message>,
and the other assertions are skipped, so a crash is never buried under secondary failures. Assert on expected
failures with error: true or error: { type: ..., message: ... }. retries re-runs a crashed run when the case
does not expect an error.